Subject: Perl shared object linking problem
To: None <tech-pkg@NetBSD.org>
From: Matthias Scheler <tron@zhadum.org.uk>
List: tech-pkg
Date: 07/20/2007 17:09:02
	Hello,

the "xchat-perl" package doesn't currently work under NetBSD, it works
however fine under Mac OS X. XChat reports this error during startup:

AutoLoad failed for: /usr/pkg/lib/xchat/plugins/perl.so
/usr/pkg/lib/xchat/plugins/perl.so: Undefined symbol "boot_DynaLoader" (symnum = 67)

It seems that the perl plugin doesn't get with "DynaLoader.a" properly:

/bin/sh ../../libtool --tag=CC   --mode=link cc  -O2 -march=pentium3 -I/usr/pkg/include -I/usr/include -Wall -g -Wno-pointer-sign -funsigned-char -I/usr/pkg/include -I/usr/include -avoid-version -module  -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -o perl.la -rpath /usr/pkg/lib/xchat/plugins perl.lo -Wl,-E -Wl,-R/usr/pkg/lib/perl5/5.8.0/i386-netbsd-thread-multi/CORE -Wl,-R/usr/pkg/lib -L/usr/pkg/lib /usr/pkg/lib/perl5/5.8.0/i386-netbsd-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/pkg/lib/perl5/5.8.0/i386-netbsd-thread-multi/CORE -lperl -lm -lcrypt -lpthread -lssl -lcrypto -Wl,-R/usr/pkg/lib -Wl,--export-dynamic -L/usr/pkg/lib -lglib-2.0 -lintl   /usr/lib/libintl.so

*** Warning: Trying to link with static lib archive /usr/pkg/lib/perl5/5.8.0/i386-netbsd-thread-multi/auto/DynaLoader/DynaLoader.a.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because the file extensions .a of this argument makes me believe
*** that it is just a static archive that I should not used here.
cc -shared  .libs/perl.o  -Wl,--rpath -Wl,/src/NetBSD-current/pkgsrc/chat/xchat-perl/work.colwyn/.buildlink/lib -Wl,--rpath -Wl,/src/NetBSD-current/pkgsrc/chat/xchat-perl/work.colwyn/.buildlink/lib -L/src/NetBSD-current/pkgsrc/chat/xchat-perl/work.colwyn/.buildlink/lib -L/src/NetBSD-current/pkgsrc/chat/xchat-perl/work.colwyn/.buildlink/lib/perl5/5.8.0/i386-netbsd-thread-multi/CORE -lperl -lm -lcrypt -lpthread -lssl -lcrypto /src/NetBSD-current/pkgsrc/chat/xchat-perl/work.colwyn/.buildlink/lib/libglib-2.0.so -lintl  -march=pentium3 -Wl,-R/usr/pkg/lib -Wl,-E -Wl,-R/usr/pkg/lib/perl5/5.8.0/i386-netbsd-thread-multi/CORE -Wl,--export-dynamic -Wl,-soname -Wl,perl.so -o .libs/perl.so
ar cru .libs/perl.a /usr/pkg/lib/perl5/5.8.0/i386-netbsd-thread-multi/auto/DynaLoader/DynaLoader.a  perl.o /usr/pkg/lib/perl5/5.8.0/i386-netbsd-thread-multi/auto/DynaLoader/DynaLoader.a
ranlib .libs/perl.a
creating perl.la
(cd .libs && rm -f perl.la && ln -s ../perl.la perl.la)
gmake[1]: Leaving directory `/src/NetBSD-current/pkgsrc/chat/xchat-perl/work.colwyn/xchat-2.8.4/plugins/perl'

"pkgsrc" used to have some weird code dealing with "DynLoader.a" but I had
to remove it(*) because broke the build.

Any ideas how to fix this properly?

	Kind regards

(*) http://mail-index.netbsd.org/pkgsrc-changes/2007/04/09/0037.html

-- 
Matthias Scheler                                  http://zhadum.org.uk/