On 6/6/2017 5:22 PM, Gavin Smith wrote:
On Mon, Jun 05, 2017 at 08:50:48PM +0100, Gavin Smith wrote:
On Mon, Jun 05, 2017 at 12:14:04PM -0700, Li Er wrote:
I tried my build with TEXINFO_XS=debug and it states 'XSParagraph.so loaded',
so I think it's working well.

If there's no shared libperl, XS module simply uses the symbols exported
by the perl binary. I also had a look at debian's perl distribution, it's
using shared libperl but the XS modules are not linked against it. I think
it's the default behavior under Linux. I don't know much about Windows,
however.

Thanks for the explanation.  Maybe the -no-undefined -lperl options
should only be used on Windows (MinGW or Cygwin).

I've committed a change to do this.  I copied the test from the
top-level configure.ac to see if we are on MS-Windows:

host_is_windows=no
case "$host" in
    *-mingw32 | *-mingw64 | *-msdosdjgpp )  host_is_windows=yes ;;
esac
AM_CONDITIONAL([HOST_IS_WINDOWS], [test "x$host_is_windows" = "xyes"])

Please someone say if this is wrong for a system where the -no-undefined
flag is needed (e.g. cygwin).

It's wrong on Cygwin.  Without -no-undefined -lperl I get errors like this:

/bin/sh ./libtool --tag=CC --mode=link gcc -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration -fwrapv -fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DVERSION=\"0\" -DXS_VERSION=\"1\" "-I/usr/lib/perl5/5.24/x86_64-cygwin-threads/CORE" -avoid-version -module -o XSParagraph.la -rpath /usr/lib/texinfo XSParagraph_la-XSParagraph.lo XSParagraph_la-xspara.lo XSParagraph_la-text.lo ./lib/libgnu.la libtool: error: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified

Ken

Reply via email to