diff mbox series

[RFC] elf: Fix link error missing Unwind_Backtrace symbol

Message ID 20220108070009.3104695-1-shorne@gmail.com
State Dropped
Headers show
Series [RFC] elf: Fix link error missing Unwind_Backtrace symbol | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Stafford Horne Jan. 8, 2022, 7 a.m. UTC
---
For some reason build many is failing with missing Unwind_Backtrace symbol
when linking tst-unwind-ctor-lib.so.

    or1k-glibc-linux-gnu-gcc   -shared -static-libgcc  -Wl,-dynamic-linker=/lib/ld-linux-or1k.so.1 -Wl,-z,defs -B/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/csu/  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both  -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/math -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/dlfcn -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nss -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nis -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/rt -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/resolv -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/mathvec -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/crypt -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nptl -Wl,-rpath-link=/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/math:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/dlfcn:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nss:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nis:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/rt:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/resolv:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/mathvec:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/crypt:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nptl -o /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.so -T /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/shlib.lds /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/csu/abi-note.o /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.os  -Wl,--start-group /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/libc.so /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/libc_nonshared.a -Wl,--as-needed /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/ld.so -Wl,--no-as-needed -Wl,--end-group
    /home/shorne/work/gnu-toolchain/build-many/install/compilers/or1k-linux-gnu/lib/gcc/or1k-glibc-linux-gnu/12.0.0/../../../../or1k-glibc-linux-gnu/bin/ld: /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.os: in function `do_unwind':
    /home/shorne/work/gnu-toolchain/glibc/elf/tst-unwind-ctor-lib.c:36: undefined reference to `_Unwind_Backtrace'

Adding the -lgcc_s fixes this.  I am not sure why this is just showing up now,
I just re-bootstrapped my build-many compilers and this error started showing
up.  I notice its not happending on the test results mailing list.  Perhaps
someone has an idea?

This patch fixes it and the check phase passes.

 elf/Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

H.J. Lu Jan. 8, 2022, 8:20 p.m. UTC | #1
On Fri, Jan 7, 2022 at 11:00 PM Stafford Horne via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> ---
> For some reason build many is failing with missing Unwind_Backtrace symbol
> when linking tst-unwind-ctor-lib.so.
>
>     or1k-glibc-linux-gnu-gcc   -shared -static-libgcc  -Wl,-dynamic-linker=/lib/ld-linux-or1k.so.1 -Wl,-z,defs -B/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/csu/  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both  -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/math -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/dlfcn -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nss -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nis -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/rt -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/resolv -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/mathvec -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/crypt -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nptl -Wl,-rpath-link=/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/math:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/dlfcn:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nss:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nis:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/rt:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/resolv:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/mathvec:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/crypt:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nptl -o /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.so -T /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/shlib.lds /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/csu/abi-note.o /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.os  -Wl,--start-group /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/libc.so /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/libc_nonshared.a -Wl,--as-needed /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/ld.so -Wl,--no-as-needed -Wl,--end-group
>     /home/shorne/work/gnu-toolchain/build-many/install/compilers/or1k-linux-gnu/lib/gcc/or1k-glibc-linux-gnu/12.0.0/../../../../or1k-glibc-linux-gnu/bin/ld: /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.os: in function `do_unwind':
>     /home/shorne/work/gnu-toolchain/glibc/elf/tst-unwind-ctor-lib.c:36: undefined reference to `_Unwind_Backtrace'

It is a bug in your GCC:

$ gcc -shared -static-libgcc
-Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -Wl,-z,defs
-B/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/csu/
 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/math
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/dlfcn
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nss
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nis
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/rt
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/resolv
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/mathvec
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/support
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/crypt
-L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nptl
-Wl,-rpath-link=/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/math:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/dlfcn:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nss:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nis:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/rt:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/resolv:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/mathvec:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/support:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/crypt:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nptl
-o /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/tst-unwind-ctor-lib.so
 /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/csu/abi-note.o
/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/tst-unwind-ctor-lib.os
 -Wl,--start-group
/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/libc.so
/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/libc_nonshared.a
-Wl,--as-needed
/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/ld.so
-Wl,--no-as-needed -Wl,--end-group
-Wl,--trace-symbol,_Unwind_Backtrace
ld: /usr/lib/gcc/x86_64-redhat-linux/11/libgcc_eh.a(unwind-dw2.o):
definition of _Unwind_Backtrace
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> Adding the -lgcc_s fixes this.  I am not sure why this is just showing up now,
> I just re-bootstrapped my build-many compilers and this error started showing
> up.  I notice its not happending on the test results mailing list.  Perhaps
> someone has an idea?
>
> This patch fixes it and the check phase passes.
>
>  elf/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/elf/Makefile b/elf/Makefile
> index b86d116be9..5bf9a3eb64 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -2011,6 +2011,7 @@ $(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so
>  $(objpfx)tst-big-note-lib.so: $(objpfx)tst-big-note-lib.o
>         $(LINK.o) -shared -o $@ $(LDFLAGS.so) $<
>
> +LDLIBS-tst-unwind-ctor-lib.so = -lgcc_s
>  $(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so
>
>  CFLAGS-tst-unwind-main.c += -funwind-tables -DUSE_PTHREADS=0
> --
> 2.31.1
>
Stafford Horne Jan. 9, 2022, 12:49 a.m. UTC | #2
On Sat, Jan 08, 2022 at 12:20:59PM -0800, H.J. Lu wrote:
> On Fri, Jan 7, 2022 at 11:00 PM Stafford Horne via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
> >
> > ---
> > For some reason build many is failing with missing Unwind_Backtrace symbol
> > when linking tst-unwind-ctor-lib.so.
> >
> >     or1k-glibc-linux-gnu-gcc   -shared -static-libgcc  -Wl,-dynamic-linker=/lib/ld-linux-or1k.so.1 -Wl,-z,defs -B/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/csu/  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both  -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/math -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/dlfcn -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nss -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nis -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/rt -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/resolv -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/mathvec -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/crypt -L/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nptl -Wl,-rpath-link=/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/math:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/dlfcn:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nss:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nis:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/rt:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/resolv:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/mathvec:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/crypt:/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/nptl -o /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.so -T /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/shlib.lds /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/csu/abi-note.o /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.os  -Wl,--start-group /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/libc.so /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/libc_nonshared.a -Wl,--as-needed /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/ld.so -Wl,--no-as-needed -Wl,--end-group
> >     /home/shorne/work/gnu-toolchain/build-many/install/compilers/or1k-linux-gnu/lib/gcc/or1k-glibc-linux-gnu/12.0.0/../../../../or1k-glibc-linux-gnu/bin/ld: /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/elf/tst-unwind-ctor-lib.os: in function `do_unwind':
> >     /home/shorne/work/gnu-toolchain/glibc/elf/tst-unwind-ctor-lib.c:36: undefined reference to `_Unwind_Backtrace'
> 
> It is a bug in your GCC:
> 
> $ gcc -shared -static-libgcc
> -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -Wl,-z,defs
> -B/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/csu/
>  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/math
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/dlfcn
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nss
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nis
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/rt
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/resolv
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/mathvec
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/support
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/crypt
> -L/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nptl
> -Wl,-rpath-link=/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/math:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/dlfcn:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nss:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nis:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/rt:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/resolv:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/mathvec:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/support:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/crypt:/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/nptl
> -o /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/tst-unwind-ctor-lib.so
>  /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/csu/abi-note.o
> /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/tst-unwind-ctor-lib.os
>  -Wl,--start-group
> /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/libc.so
> /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/libc_nonshared.a
> -Wl,--as-needed
> /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/ld.so
> -Wl,--no-as-needed -Wl,--end-group
> -Wl,--trace-symbol,_Unwind_Backtrace
> ld: /usr/lib/gcc/x86_64-redhat-linux/11/libgcc_eh.a(unwind-dw2.o):
> definition of _Unwind_Backtrace
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Thanks for confirming, I traced it down I had this in my environment.

  LD=/home/shorne/work/openrisc/br-reproduce/ca3281294392da1a5ea84dbb9cc4c5bfea0c4ccf/buildroot/output/build/host-binutils-custom/ld/ld-new

That then caused this during gcc config.

    checking whether the gcc linker (/home/shorne/work/openrisc/br-reproduce/ca3281294392da1a5ea84dbb9cc4c5bfea0c4ccf/buildroot/output/build/host-binutils-custom/ld/ld-new -m elf_x86_64) supports shared libraries... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... unsupported
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... no
    checking whether to build shared libraries... no
    checking whether to build static libraries... yes

The config disabled shared libs and disabled the lgcc_eh spec in gcc/gcc.c.  It
was tricky to trace it.  I should probably use a clean/container environment for
my builds.

-Stafford

> > Adding the -lgcc_s fixes this.  I am not sure why this is just showing up now,
> > I just re-bootstrapped my build-many compilers and this error started showing
> > up.  I notice its not happending on the test results mailing list.  Perhaps
> > someone has an idea?
> >
> > This patch fixes it and the check phase passes.
> >
> >  elf/Makefile | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/elf/Makefile b/elf/Makefile
> > index b86d116be9..5bf9a3eb64 100644
> > --- a/elf/Makefile
> > +++ b/elf/Makefile
> > @@ -2011,6 +2011,7 @@ $(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so
> >  $(objpfx)tst-big-note-lib.so: $(objpfx)tst-big-note-lib.o
> >         $(LINK.o) -shared -o $@ $(LDFLAGS.so) $<
> >
> > +LDLIBS-tst-unwind-ctor-lib.so = -lgcc_s
> >  $(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so
> >
> >  CFLAGS-tst-unwind-main.c += -funwind-tables -DUSE_PTHREADS=0
> > --
> > 2.31.1
> >
> 
> 
> -- 
> H.J.
diff mbox series

Patch

diff --git a/elf/Makefile b/elf/Makefile
index b86d116be9..5bf9a3eb64 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -2011,6 +2011,7 @@  $(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so
 $(objpfx)tst-big-note-lib.so: $(objpfx)tst-big-note-lib.o
 	$(LINK.o) -shared -o $@ $(LDFLAGS.so) $<
 
+LDLIBS-tst-unwind-ctor-lib.so = -lgcc_s
 $(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so
 
 CFLAGS-tst-unwind-main.c += -funwind-tables -DUSE_PTHREADS=0