gprofng fails to build on i686-linux-gnu, trunk 20220503: libtool: link: x86_64-linux-gnu-gcc -shared -fPIC -DPIC .libs/synctrace.o -Wl,--version-script -W l,../../../gprofng/libcollector/mapfile.intel-Linux -Wl,--no-as-needed -Wl,-lrt -Wl,-ldl -Wl,-z -Wl,re lro -Wl,-soname -Wl,libgp-sync.so -o .libs/libgp-sync.so /usr/bin/ld: .libs/libgp-sync.so: version node not found for symbol pthread_cond_wait@GLIBC_2.2.5 /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status make[6]: *** [Makefile:580: libgp-sync.la] Error 1
Which version of glibc was used?
i686 glibc should reference pthread_cond_wait@@GLIBC_2.3.2, not pthread_cond_wait@GLIBC_2.2.5.
glibc 2.35
It looks like WSIZE(64) is 1 for i686-linux-gnu. Please show the output of # echo __x86_64 | x86_64-linux-gnu-gcc -E - # echo __x86_64 | x86_64-linux-gnu-gcc -m32 -E -
also aarch64-linux-gnu: libtool: link: x86_64-linux-gnu-gcc -shared -fPIC -DPIC .libs/synctrace.o -Wl,--version-script -W l,../../../gprofng/libcollector/mapfile.aarch64-Linux -Wl,--no-as-needed -Wl,-lrt -Wl,-ldl -Wl,-z -Wl, relro -Wl,-soname -Wl,libgp-sync.so -o .libs/libgp-sync.so /usr/bin/ld: .libs/libgp-sync.so: version node not found for symbol pthread_cond_wait@@GLIBC_2.3.2 /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status make[6]: *** [Makefile:580: libgp-sync.la] Error 1
sorry, this is glibc 2.33, not 2.35. $ echo __x86_64 | x86_64-linux-gnu-gcc -E - # 0 "<stdin>" # 0 "<built-in>" # 0 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 0 "<command-line>" 2 # 1 "<stdin>" 1 $ echo __x86_64 | x86_64-linux-gnu-gcc -m32 -E - # 0 "<stdin>" # 0 "<built-in>" # 0 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 0 "<command-line>" 2 # 1 "<stdin>" __x86_64
Were you building x86-64 binutils on i686 Linux?
no, everything on x86_64-linux-gnu so far, the i686 and aarch64 builds are configured for these targets.
gprofng/libcollector/synctrace.c is written for target. But synctrace.o is linked against the host library. It failed to link when host != target.
How do you configure your build ? It looks like there are two bugs here: 1. libgp-sync.so may not link with libc. In run time, libgp-sync.so has to dlopen libc and use dlsym to find pthread_cond_wait. 2. it is probably a bug 29113 - Build error for x86_64-w64-mingw32 host since CLOCK_MONOTONIC does not exist
The build was configured with --target=i686-linux-gnu. Does this means that all binaries will be the 32-bit ? I see that gprofng/libcollector/synctrace.c was built on x86_64 without -m32 option: % file .libs/synctrace.o .libs/synctrace.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped and synctrace.o is linked against the target (32-bit) library.
The master branch has been updated by Vladimir Mezentsev <vmezents@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1653ae5b8440e2182ac86974b99b603bc15aa163 commit 1653ae5b8440e2182ac86974b99b603bc15aa163 Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com> Date: Thu May 5 00:08:19 2022 -0700 gprofng: use $host instead $target By mistake, $target was used instead of $host to configure the gprogng build. gprofng/ChangeLog 2022-04-28 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29113 PR gprofng/29116 * configure.ac: Use $host instead $target. * libcollector/configure.ac: Likewise. * configure: Rebuild. * libcollector/configure: Rebuild.
The master branch has been updated by Vladimir Mezentsev <vmezents@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1bb1f55d648e9c32bbead00afc95761646a6d050 commit 1bb1f55d648e9c32bbead00afc95761646a6d050 Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com> Date: Wed Jul 6 13:52:57 2022 -0700 gprofng: adjust GPROFNG_VARIANT GPROFNG_VARIANT depends on compiler options, not on $(host). gprofng/ChangeLog 2022-07-06 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29116 * libcollector/configure.ac: Adjust GPROFNG_VARIANT. * libcollector/configure: Rebuild.
Update status as resolved/fixed.