On Sat, Jan 17, 2026 at 11:49:58AM +0200, Eli Zaretskii wrote:
> The reason I asked is that Windows has some peculiar rules for how it
> finds and loads shared libraries.  Unlike Posix systems, on Windows
> the DLL files are supposed to be either in the same directory as the
> executable file of the program which loads them, or from a system
> directory where DLLs are usually installed, or somewhere on PATH
> (which on Windows includes the current directory of the running
> process).
> 
> (This is a simplification; the actual rules are much more complex, see
> https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#standard-search-order-for-unpackaged-apps
> and
> https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#factors-that-affect-searching)
> 
> Since the tests run with Terxinfo uninstalled, I wonder whether the
> test suite harness sets things up so as to find and load the DLLs
> just built.  Showing that as part of the test would go a long way
> towards flagging any issues with finding the DLLs, and will also
> indicate which parts of the code were actually tested -- the Perl code
> or the equivalent C code.  Right now, I have no idea.  And looking in
> config.log and Makefile's doesn't help, because I already know the
> configure script concluded the extensions could be built, and I also
> know that they were in fact built.  I just don't know whether they
> were used when running the test suite.

If you set TEXINFO_XS=debug in the environment, you will see all the
XS modules and XS functions (when the whole module is not overriden, but
some functions are) that are loaded and whether it failed or it was a
success.

> Which brings me to the installation.  I've just run "make install",
> and I see that various libtexinfo*.dll DLLs are installed in
> $prefix/lib/bin.

That is somewhat unexpected.  In tta/C/Makefile.am, there is

converterlibdir = $(libdir)/$(CONVERTER)
xsdir = $(converterlibdir)

and the libraries are in xs_LTLIBRARIES, and therefore should be
installed in $(libdir)/texi2any, since CONVERTER=texi2any.

xs_LTLIBRARIES += libtexinfo.la

>  What I don't know is whether they will be found and
> loaded at run time.  Can you explain how this is set up when running
> texi2any?  Which program will load them?

If the Perl implementation is used, the libraries are preloaded by the
code in tta/perl/Texinfo/XSLoader.pm (mainly from Gavin), which finds
where the libraries are, the Perl Dynaloader module doing the actual
dlopening.

If ctexi2any.exe is used, they should be loaded thanks to libtool, I
guess.  But I do not know if we really tested that setup.

>  (Strangely, ctexi2any.exe,
> which I presumed will load them, is not installed.) Are the DLLs
> loaded by explicit dlopen calls, which use their full absolute file
> names?

Something like that, yes.  The libtool .la files are used on some
platforms to find the file names to dlopen.  If the .la files are not
found, the module is dlopened anyway, and it works in platforms that
have rpath or the like, possibly with libtool help and find libraries
without a need to preload through dlopen.

>  Or are they supposed to be found by the system's library
> search, about which I explained above?

I would not have expected, as the libraries should not be in the
system's library search paths, they should be in a 'private' directory,
as we would like to avoid having the Texinfo libraries being used like
public libraries.

>  Same question about the DLLs
> in lib/texinfo/, although in that case we already know this works from
> the experience of the previous Texinfo releases, as long as the Perl
> code which handles that was not modified in some way that broke it.

Indeed, and this mechanism to load the libraires is what I try to
explain above.

> Another question related to "make install" is why are the *.dll.a
> files installed in lib/texi2any/ ?  These are the so-called "import
> libraries", which are needed on Windows to link applications against
> shared libraries.  But there's no feature in Texinfo that needs to
> allow other applications to be linked against the DLLs and XS
> extensions produced by the build, is there?

These are possibly unneeded.  But I think that they are installed by
libtool, as we do not install them ourselves.  But maybe they are needed
for the C implementation of texi2any?

>  The same goes to the *.la
> files -- they are only needed for linking against the libraries (and
> that is not Windows-specific); so why are they installed?

As I said above, it is probably needed to find the locations of the
libtexinfo* libraries and to load them by Texinfo::XSLoader.

-- 
Pat

  • Re: ... Gavin Smith
    • ... Eli Zaretskii
      • ... Gavin Smith
        • ... Eli Zaretskii
  • Re: ... Gavin Smith
    • ... pertusus
      • ... Gavin Smith
    • ... pertusus
      • ... Gavin Smith
        • ... Eli Zaretskii
        • ... pertusus
        • ... Eli Zaretskii
        • ... pertusus
        • ... Gavin Smith
        • ... Gavin Smith
        • ... Eli Zaretskii
        • ... Gavin Smith
        • ... Eli Zaretskii
        • ... pertusus
        • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
        • ... Eli Zaretskii

Reply via email to