[arch-general] Linking issue, glibc weirdness?

Philipp Überbacher hollunder at lavabit.com
Fri Dec 9 18:22:34 EST 2011


Excerpts from clemens fischer's message of 2011-12-09 23:36:07 +0100:
> Allan McRae wrote:
> 
> > On 10/12/11 07:29, Ionut Biru wrote:
> >
> >> On 12/09/2011 09:25 PM, Philipp wrote:
> >>
> >>> Hi there, I have linking issues with one of the programs I maintain
> >>> in AUR and I don't quite understand the issue. Here's the output:
> >>>
> >>> g++ -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu
> >>> -L/usr/X11R6/lib -o jmeters jmeters.o styles.o mainwin.o jclient.o
> >>> mkimage.o meterwin.o -lsndfile -lclxclient -lclthreads -ljack
> >>> -lpng -lXft -lX11 -lrt /usr/bin/ld: jmeters.o: undefined reference
> >>> to symbol 'pthread_mutex_trylock@@GLIBC_2.2.5' /usr/bin/ld:
> >>> note: 'pthread_mutex_trylock@@GLIBC_2.2.5' is defined in DSO
> >>> /lib/libpthread.so.0 so try adding it to the linker command line
> >>> /lib/libpthread.so.0: could not read symbols: Invalid operation
> >>> collect2: ld returned 1 exit status make: *** [jmeters] Error 1
> >>>
> >>> The program is jmeters
> >>> (https://aur.archlinux.org/packages.php?ID=25711).
> >>>
> >>> It depends on clthreads
> >>> (https://aur.archlinux.org/packages.php?ID=3627) which handles the
> >>> threading stuff.
> >>>
> >>> I wonder where this problem comes from. Needles to say that it
> >>> worked fine in the past. Any ideas?
> >>
> >> sounds like you don't have a fully up to date toolchain
> >
> > Actually, it sounds like he does have a fully up-to-date toolchain:
> > http://fedoraproject.org/wiki/UnderstandingDSOLinkChange
> >
> > The output also gives the fix...
> >>> /usr/bin/ld: note: 'pthread_mutex_trylock@@GLIBC_2.2.5' is defined in
> >>> DSO /lib/libpthread.so.0 so try adding it to the linker command line
> 
> I think you're both wrong  8-)
> 
> The ld(8) output seems to indicate that libpthread is pulled in, but
> points to something else than a fully functioning library.
> 
>   $ ls -l /lib/libpthread*
>   -rwxr-xr-x 1 root root 135326 Dec  2 19:28 /lib/libpthread-2.14.1.so
>   lrwxrwxrwx 1 root root     20 Dec  2 19:28 /lib/libpthread.so.0 -> libpthread-2.14.1.so

$ ls -l /lib/libpthread*
-rwxr-xr-x 1 root root 135326 Dec  2 19:29 /lib/libpthread-2.14.1.so
lrwxrwxrwx 1 root root     20 Dec  2 19:29 /lib/libpthread.so.0 ->
libpthread-2.14.1.so

>   $ nm /lib/libpthread.so.0 |g mutex.try
>   -:0000000000009f40 T __pthread_mutex_trylock
>   -:0000000000009f40 T pthread_mutex_trylock

$ nm /lib/libpthread.so.0 |g mutex.try
-bash: g: command not found

but:
$ nm /lib/libpthread.so.0 | grep -i mutex.try
0000000000009f40 T __pthread_mutex_trylock
0000000000009f40 T pthread_mutex_trylock


I do wonder how I'm supposed to patch programs that aren't developed
anymore and use 8000 line configure scripts... (example: bitmeter
https://aur.archlinux.org/packages.php?ID=19762)

Regards,
Philipp



More information about the arch-general mailing list