On Fri, Oct 09, 2026 at 11:11:01AM +0200, [email protected] wrote:
> > > We used not to depend on libperl - this is one of several issues from the
> > > last six months or so which I have planned to revisit.  It was only
> > > required for embedding a Perl interpreter, which wasn't necessary for 
> > > texi2any
> > > in any of the previously released versions of Texinfo.  libperl was not
> > > installed on Debian-derived distributions, for example.
> > 
> > The MinGW builds of Texinfo have all of the XS and texinfo DLLs
> > dependent on the Perl shared library (in my case, its PERL200.DLL).  I
> > don't see how it can be otherwise, since we invoke functions insider
> > libperl.  Or what am I missing?
> 
> On GNU/Linux and Unices, and more generally on platforms where
> -no-undefined is not needed for linking, libperl is not needed when
> linking XS and XS with other C codes at compile/link time, and at
> runtime, the "libperl" that is part of the running interpreter is
> there.  Therefore, on these platforms, if texi2any.pl is used, there is
> no need to link against libperl (but it does not hurt either).

Just to try to explain why invoking "functions inside libperl" does not
mean linking against libperl: these Perl API functions are part of the
Perl interpreter, which is the main program which is running.  They don't
become available as a result of loading a dynamic library: they are present
from the start of program execution.

To be specific, libperl is needed for compiling the XS modules (i.e. the
DLLs) if they call functions that are in the Perl API, because they need
some definition of all symbols used (the same reason why the -no-defined
flag is needed with Libtool).  There might be some more to this story (so
as I write this, I wonder whether the libperl for embedding a Perl interpreter
is or needs to be the same libperl used for referencing symbols in the Perl
interpreter), but hopefully the basic idea is clear.

> On Ms-Windows, for MinGW and Cygwin builds, -no-undefined is needed,
> therefore we have been relying on libperl being present on those
> platforms since adding XS (since 6.1 in 2016).
> 
> When ctexi2any is used, however, Perl is embedded, and there is a need
> to link with libperl on GNU/Linux and Unices too (since 7.3, March 2026).

As I understand, ctexi2any is still not the default implementation
of texi2any.  If it does become the default implementation, we should try
to avoid depending on libperl when a Perl interpreter is not needed (for
example, when a native-code converter is available, as is the case for HTML
and Info).  I am sure there are previous discussions on this so I will try
to avoid adding more noise.

Reply via email to