Subject: Re: linking problems
To: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
From: Nick Hudson <skrll@netbsd.org>
List: tech-userlevel
Date: 03/24/2001 18:10:54
Emmanuel Dreyfus wrote:
> 
> Hi!
> 
> I'm trying ot port Xerces-Perl to NetBSD, and I have problem with
> linking.
> 
> It builds a shared object, like this:
> LD_RUN_PATH="/usr/pkg/lib" gcc -o blib/arch/auto/XML/Xerces/Xerces.so
> --whole-archive -shared  -L/usr/pkg/lib Xerces.o    -L/usr/pkg/lib
> -L/usr/pkg/lib -lncurses -lncurses++ -lmenu -lform -lpanel -lxerces-c1_3
> -lpthread
> 
> The problem occurs at run time ,qhen I do a make test:
> PERL_DL_NONLAZY=1 /usr/pkg/bin/perl -Iblib/arch -Iblib/lib
> -I/usr/pkg/lib/perl5/5.6.0/powerpc-netbsd -I/usr/pkg/lib/perl5/5.6.0 -e
> 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
> t/*.t
> t/DOMCreate.........Can't load 'blib/arch/auto/XML/Xerces/Xerces.so' for
> module XML::Xerces:
> /usr/local/src/xml-xerces/perl/blib/arch/auto/XML/Xerces/Xerces.so:
> Undefined PLT symbol "__eh_alloc" (reloc type = 21, symnum = 667) at
> /usr/pkg/lib/perl5/5.6.0/powerpc-netbsd/DynaLoader.pm line 200.
> 
> __eh_alloc is defined in libgcc.a. If I link with libgcc.a, I will end
> up with a error 10, non supported PLT relocation, because libgcc.a is
> not PIC code.

I *think* that you can solve this by adding --export-dynamic to the
binary link phase. I had problems like this with KDE2 that magically
disappered and I never really looked into why...

Nick
-- 
aka skrll@netbsd.org, skrll@excite.co.uk