https://sourceware.org/bugzilla/show_bug.cgi?id=34524
Bug ID: 34524
Summary: ld bootstrap tests fail with binutils 2.47 - possible
-lpthread is missing
Product: binutils
Version: 2.47
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: martyausmainz at gmx dot de
Target Milestone: ---
I'm trying to build and test binutils on an Linuxfromscratch system. binutils
is building, but during the tests, all ld bootstrap relating are failing:
./ld/ld.log:FAIL: bootstrap
./ld/ld.log:FAIL: bootstrap with strip
./ld/ld.log:FAIL: bootstrap with -Wl,--traditional-format
./ld/ld.log:FAIL: bootstrap with -Wl,--no-keep-memory
./ld/ld.log:FAIL: bootstrap with -Wl,--relax
./ld/ld.log:FAIL: bootstrap with -Wl,--max-cache-size=-1
./ld/ld.log:FAIL: bootstrap with -Wl,-z,nosectionheader
I checked the ld.log, looks like the tests are doing something with libzstd and
this requires -lpthread from my point of view:
FAIL: bootstrap
/home/ebtcheck/t/binutils-2.47/build/ld/ld-new -m elf_x86_64 -o
tmpdir/ld-partial.o -r ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o
ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o
ldfile.o ldcref.o eelf_x86_64.o eelf_i386.o eelf32_x86_64.o ldelf.o ldelfgen.o
ldbuildid.o
Executing on host: sh -c {/home/ebtcheck/t/binutils-2.47/build/ld/ld-new -m
elf_x86_64 -o tmpdir/ld-partial.o -r ldgram.o ldlex-wrapper.o lexsup.o
ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o
ldmisc.o ldfile.o ldcref.o eelf_x86_64.o eelf_i386.o eelf32_x86_64.o ldelf.o
ldelfgen.o ldbuildid.o 2>&1} /dev/null ld.tmp (timeout = 300)
spawn [open ...]
Executing on build: grep -q "HAVE_ZSTD 1" config.h (timeout = 300)
spawn -ignore SIGHUP grep -q HAVE_ZSTD 1 config.h
Executing on build: grep -q "HAVE_JANSSON 1" config.h (timeout = 300)
spawn -ignore SIGHUP grep -q HAVE_JANSSON 1 config.h
gcc -B/home/ebtcheck/t/binutils-2.47/build/ld/tmpdir/ld/
-L/usr/x86_64-pc-linux-gnu/lib64 -L/usr/lib -L/usr/x86_64-pc-linux-gnu/lib
-o tmpdir/ld1 -g -O2 tmpdir/ld-partial.o ../libctf/.libs/libctf.a -lz
../bfd/.libs/libbfd.a ../libiberty/libiberty.a ../libsframe/.libs/libsframe.a
-lz -lzstd -ldl
Executing on host: sh -c {gcc
-B/home/ebtcheck/t/binutils-2.47/build/ld/tmpdir/ld/
-L/usr/x86_64-pc-linux-gnu/lib64 -L/usr/lib -L/usr/x86_64-pc-linux-gnu/lib
-o tmpdir/ld1 -g -O2 tmpdir/ld-partial.o ../libctf/.libs/libctf.a -lz
../bfd/.libs/libbfd.a ../libiberty/libiberty.a ../libsframe/.libs/libsframe.a
-lz -lzstd -ldl 2>&1} /dev/null ld.tmp (timeout = 300)
spawn [open ...]
/home/ebtcheck/t/binutils-2.47/build/ld/.libs/ld-new: warning: libpthread.so.0,
needed by /usr/lib/libzstd.so, not found (try using -rpath or -rpath-link)
/home/ebtcheck/t/binutils-2.47/build/ld/.libs/ld-new: /usr/lib/libzstd.so:
undefined reference to `pthread_create@GLIBC_2.2.5'
/home/ebtcheck/t/binutils-2.47/build/ld/.libs/ld-new: /usr/lib/libzstd.so:
undefined reference to `pthread_join@GLIBC_2.2.5'
collect2: error: ld returned 1 exit status
/home/ebtcheck/t/binutils-2.47/build/ld/.libs/ld-new: warning: libpthread.so.0,
needed by /usr/lib/libzstd.so, not found (try using -rpath or -rpath-link)
/home/ebtcheck/t/binutils-2.47/build/ld/.libs/ld-new: /usr/lib/libzstd.so:
undefined reference to `pthread_create@GLIBC_2.2.5'
/home/ebtcheck/t/binutils-2.47/build/ld/.libs/ld-new: /usr/lib/libzstd.so:
undefined reference to `pthread_join@GLIBC_2.2.5'
collect2: error: ld returned 1 exit status
I searched around, but sadly my knowledge is limited, so I don't know in which
Makefile/etc to manually add the -lpthread parameter.
I used this configure command:
../configure --prefix=/usr \
--sysconfdir=/etc \
--enable-ld=default \
--enable-plugins \
--enable-shared \
--disable-werror \
--enable-64-bit-bfd \
--enable-new-dtags \
--with-system-zlib \
--with-lib-path=/usr/lib \
--enable-default-hash-style=gnu
gcc --version: gcc (GCC) 13.3.0
I'm not really sure if this a bug or just my system is too strange.
Many thanks for having a look
Martin
--
You are receiving this mail because:
You are on the CC list for the bug.