Subject: Re: linking problems
To: Emmanuel Dreyfus <>
From: Nick Hudson <>
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/
> --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/' for
> module XML::Xerces:
> /usr/local/src/xml-xerces/perl/blib/arch/auto/XML/Xerces/
> Undefined PLT symbol "__eh_alloc" (reloc type = 21, symnum = 667) at
> /usr/pkg/lib/perl5/5.6.0/powerpc-netbsd/ 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...