Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: link problems



On Wed, Oct 09, 2013 at 09:00:15PM +0100, David Laight wrote:
> On Sun, Oct 06, 2013 at 10:40:24AM +0200, Thomas Klausner wrote:
> > On Sun, Oct 06, 2013 at 05:28:03AM +0200, Joerg Sonnenberger wrote:
> > > On Sat, Oct 05, 2013 at 07:30:14PM +0200, Rhialto wrote:
> > > > On Fri 04 Oct 2013 at 18:51:26 +0000, Christos Zoulas wrote:
> > > > > Does adding: --no-copy-dt-needed-entries to the link line fix the 
> > > > > problem
> > > > > for you? Perhaps we should consider making this the default again...
> > > > > 
> > > > > http://sourceware.org/ml/binutils/2011-08/msg00131.html
> > > > 
> > > > I think the new way is cleaner. It is better to have dependencies
> > > > explictly stated.
> > > 
> > > No, it is broken. It has been discussed before.
> > 
> > Can you please summarize the arguments, or include concrete links to
> > the "before"?
> 
> 1) I have library containing a lot of functions and I decide to split it
>    into several parts. The user callable functions end up separated but
>    I don't want to make the split (or the presence of the other libraries)
>    visible to users.
>    It might be that the install copies/symlinks the library optimised
>    for the current cpu.
> 
> 2) I write a library with an alternate implementation of one of the functions
>    in a standard library with a DT_NEEDED entry for the renamed standard
>    library.
>    Having moved all the files I still want to be able to compile programs.
> 
> Note that since the run-time linker makes all the symbols available
> you can't have multiple copies of the same library loaded anyway.
> 
> The really oughgt to have added a new variant of DT_NEEDED that indicated
> that the symbols should not be made visible.

Thanks for the explanation.

So how do we proceed?
How should we fix pkgsrc packages that don't currently build, like:

mail/akonadi:
Linking CXX executable ../bin/akonadi_agent_launcher
ld: /scratch/mail/akonadi/work/.buildlink/qt4/lib/libQtCore.so: undefined 
reference to symbol 'pthread_cancel'
ld: note: 'pthread_cancel' is defined in DSO /usr/lib/libpthread.so.1 so try 
adding it to the linker command line
/usr/lib/libpthread.so.1: could not read symbols: Invalid operation

audio/lame:
/bin/sh ../libtool --tag=CC   --mode=link gcc  -Wall -pipe -O2 -I/usr/include   
   -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib  -static  -o lame lame_main.o 
main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o 
../libmp3lame/libmp3lame.la -lcurses   -lm
libtool: link: gcc -Wall -pipe -O2 -Wl,-R/usr/pkg/lib -o lame lame_main.o 
main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o  
../libmp3lame/.libs/libmp3lame.a -L/scratch/audio/lame/work/.buildlink/lib 
-lcurses -lm
ld: console.o: undefined reference to symbol 'tgetstr'
ld: note: 'tgetstr' is defined in DSO /usr/lib/libterminfo.so.1 so try adding 
it to the linker command line
/usr/lib/libterminfo.so.1: could not read symbols: Invalid operation

sysutils/strigi:
ld: CMakeFiles/index2dump.dir/indexdump.cpp.o: undefined reference to symbol 
'_ZN6lucene4util14atomic_threads16atomic_decrementEPj'
ld: note: '_ZN6lucene4util14atomic_threads16atomic_decrementEPj' is defined in 
DSO /usr/pkg/lib/libclucene-shared.so.1 so try adding it to the linker command 
line
/usr/pkg/lib/libclucene-shared.so.1: could not read symbols: Invalid operation

 Thomas


Home | Main Index | Thread Index | Old Index