[arch-general] Linking issue, glibc weirdness?
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? Regards, Philipp
On Fri, Dec 09, 2011 at 08:25:51PM +0100, Philipp wrote:
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
I just compiled and linked jmeter on an up-to-date system using the upstream (which is me) Makefile and it works OK. Why are you changing the linker options ? Ciao, -- FA Vor uns liegt ein weites Tal, die Sonne scheint - ein Glitzerstrahl.
Excerpts from Fons Adriaensen's message of 2011-12-09 22:01:09 +0100:
On Fri, Dec 09, 2011 at 08:25:51PM +0100, Philipp wrote:
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
I just compiled and linked jmeter on an up-to-date system using the upstream (which is me) Makefile and it works OK.
Why are you changing the linker options ?
Ciao,
I'm not knowingly changing the linking options. Can you try it using the PKGBUILD? (Download tarball, extract, cd to the directory, type makepkg) https://aur.archlinux.org/packages.php?ID=25711 Regards, Philipp
On Fri, Dec 09, 2011 at 10:23:53PM +0100, Philipp Überbacher wrote:
Can you try it using the PKGBUILD? (Download tarball, extract, cd to the directory, type makepkg) https://aur.archlinux.org/packages.php?ID=25711
==> Starting build()... /home/fons/build/jmeters/PKGBUILD: line 19: DSO.patch: No such file or directory DSO.patch is present, so either it's in the wrong place or it is looked for in the wrong place. The patch adds -lpthread, which (at least here) doesn't seem to be necessary (libclthreads will pull it in). Ciao, -- FA Vor uns liegt ein weites Tal, die Sonne scheint - ein Glitzerstrahl.
Excerpts from Fons Adriaensen's message of 2011-12-09 23:29:39 +0100:
On Fri, Dec 09, 2011 at 10:23:53PM +0100, Philipp Überbacher wrote:
Can you try it using the PKGBUILD? (Download tarball, extract, cd to the directory, type makepkg) https://aur.archlinux.org/packages.php?ID=25711
==> Starting build()... /home/fons/build/jmeters/PKGBUILD: line 19: DSO.patch: No such file or directory
DSO.patch is present, so either it's in the wrong place or it is looked for in the wrong place.
The patch adds -lpthread, which (at least here) doesn't seem to be necessary (libclthreads will pull it in).
Ciao,
Looked in the wrong place, fixed. The problem is that it's necessary to specify -lpthread now and in future. It will likely hit you too once the mirror you use syncs and you update. Not sure which package is responsible, I guess glibc. Seems like a number of your programs need patching. Done so far: jmeter, aeolous, ambdec Those are all trivial patches, adding pthread or dl. Regards, Philipp
On Fri, Dec 09, 2011 at 11:55:18PM +0100, Philipp Überbacher wrote:
Looked in the wrong place, fixed. The problem is that it's necessary to specify -lpthread now and in future. It will likely hit you too once the mirror you use syncs and you update. Not sure which package is responsible, I guess glibc.
It could be one of: core/glibc 2.14.1-2 (base) [installed: 2.14.1-1] core/gcc 4.6.2-3 (base-devel) [installed: 4.6.2-1] core/binutils 2.22-2 (base-devel) [installed: 2.21.1-2] In all cases probably a quite recent change, last update here was last week, next one planned for monday.
Seems like a number of your programs need patching. Done so far: jmeter, aeolous, ambdec Those are all trivial patches, adding pthread or dl.
Will take care of it here. Ciao, -- FA Vor uns liegt ein weites Tal, die Sonne scheint - ein Glitzerstrahl.
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?
Regards, Philipp
sounds like you don't have a fully up to date toolchain -- Ionuț
Excerpts from Ionut Biru's message of 2011-12-09 22:29:48 +0100:
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?
Regards, Philipp
sounds like you don't have a fully up to date toolchain
Ok, I hoped that it was just something like this. pacman -Syu gets me no new packages, so I'll wait at least until tomorrow and hope it will work then. It's somewhat weird when stuff doesn't hit the repos in sync (Same with gcc yesterday, got a circular dependency error for a while, resolved itself). Downloading the jmeters tarball, extracting it and just typing 'make' leads to the same result, so it's definitely unrelated to makepkg. However, I already have mysql 5.5.19-1 installed, which is the second most recent updates and just 5 hours old, so how can my toolchain be out of date? Regards, Philipp
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?
Regards, Philipp
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
Allan
Excerpts from Allan McRae's message of 2011-12-09 23:04:54 +0100:
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?
Regards, Philipp
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
Allan
Thanks, adding -lpthread helped in this case. I'm not looking forward to patching possibly all the other programs I maintain. Regards, Philipp
On 10/12/11 08:12, Philipp Überbacher wrote:
Excerpts from Allan McRae's message of 2011-12-09 23:04:54 +0100:
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?
Regards, Philipp
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
Allan
Thanks, adding -lpthread helped in this case. I'm not looking forward to patching possibly all the other programs I maintain.
FYI, I rebuilt the entire [core] and only one package needed fixed for this. So this does not appear that widespread. Allan
Excerpts from Allan McRae's message of 2011-12-09 23:32:26 +0100:
On 10/12/11 08:12, Philipp Überbacher wrote:
Excerpts from Allan McRae's message of 2011-12-09 23:04:54 +0100:
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?
Regards, Philipp
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
Allan
Thanks, adding -lpthread helped in this case. I'm not looking forward to patching possibly all the other programs I maintain.
FYI, I rebuilt the entire [core] and only one package needed fixed for this. So this does not appear that widespread.
Allan
Guess it depends.. I only maintain 70 packages in AUR, already found/patched 3, about 65 more to look at ... Anyway, not much I can do about it. Regards, Philipp
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 $ nm /lib/libpthread.so.0 |g mutex.try -:0000000000009f40 T __pthread_mutex_trylock -:0000000000009f40 T pthread_mutex_trylock Philipp, what's the output of these commands at your place? clemens
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
On 10/12/11 08:36, clemens fischer wrote:
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-)
Nope.... Read the first change with binutils-2.22: http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/ld/NEWS?rev=1.121&content-type=text/plain&cvsroot=src&only_with_tag=binutils-binutils-2_22 Then read the link to the Fedora wiki I gave above. Allan
participants (6)
-
Allan McRae
-
clemens fischer
-
Fons Adriaensen
-
Ionut Biru
-
Philipp
-
Philipp Überbacher