The following tests are failing to build: === libstdc++ tests === Running libstdc++:libstdc++-prettyprinters/prettyprinters.exp ... UNRESOLVED: libstdc++-prettyprinters/debug.cc compilation failed to produce executable UNRESOLVED: libstdc++-prettyprinters/debug_cxx11.cc compilation failed to produce executable Possible culprit, according to the post-commit CI is: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c0419c024bf922128131671e40de0aed736e38ed CI logs: https://git-us.linaro.org/toolchain/ci/interesting-commits.git/plain/binutils/sha1/c0419c024bf922128131671e40de0aed736e38ed/tcwg_gnu_native_check_gcc/master-aarch64/details.txt https://ci.linaro.org/job/tcwg_gnu_native_check_gcc--master-aarch64-build/1047/artifact/artifacts
-> ccing hj
Note also the jenkins does not keep around the .log files from the testsuite is it is not very useful info except something failed ...
I can't reproduce it on Linux/x86-64. If it still fails with master branch, please find a testcase which can be reproduced on Linux/x86-64.
(In reply to Andrew Pinski from comment #2) > Note also the jenkins does not keep around the .log files from the testsuite > is it is not very useful info except something failed ... Yes it does: https://ci.linaro.org/job/tcwg_gnu_native_check_gcc--master-aarch64-build/1047/artifact/artifacts/00-sumfiles/ I agree it's very convoluted to find, though. (In reply to H.J. Lu from comment #3) > I can't reproduce it on Linux/x86-64. If it still fails with master branch, > please find a testcase which can be reproduced on Linux/x86-64. AFAIK, this is only broken in aarch64-linux.
Oh note it is with -flto .
It looks like the link against libstdc++v3.so is not happening ...
(In reply to Carlos Eduardo Seo from comment #4) > (In reply to H.J. Lu from comment #3) > > I can't reproduce it on Linux/x86-64. If it still fails with master branch, > > please find a testcase which can be reproduced on Linux/x86-64. > > AFAIK, this is only broken in aarch64-linux. Does it still fail with the current master branch?
(In reply to H.J. Lu from comment #7) > (In reply to Carlos Eduardo Seo from comment #4) > > (In reply to H.J. Lu from comment #3) > > > I can't reproduce it on Linux/x86-64. If it still fails with master branch, > > > please find a testcase which can be reproduced on Linux/x86-64. > > > > AFAIK, this is only broken in aarch64-linux. > > Does it still fail with the current master branch? Yesterday, when I opened the bug, yes.
(In reply to Carlos Eduardo Seo from comment #8) > (In reply to H.J. Lu from comment #7) > > (In reply to Carlos Eduardo Seo from comment #4) > > > (In reply to H.J. Lu from comment #3) > > > > I can't reproduce it on Linux/x86-64. If it still fails with master branch, > > > > please find a testcase which can be reproduced on Linux/x86-64. > > > > > > AFAIK, this is only broken in aarch64-linux. > > > > Does it still fail with the current master branch? > > Yesterday, when I opened the bug, yes. If you can provide ALL linker inputs which can be used to reproduce the issue on Linux/x86-64 with a cross linker, I will take a look.
I had a build where this might have happened on amd64. I will look but I can't promise to spend hours on it. I'll include the files if I can repro.
I can reproduce it.
Created attachment 15469 [details] A testcase [hjl@gnu-cfl-3 31644]$ make gcc -B./ -g -flto -c -o x.o x.c gcc -B./ -g -c -o foo.o foo.c ar -rv libfoo.a foo.o ar: creating libfoo.a a - foo.o gcc -B./ -g -fPIC -c -o bar.o bar.c gcc -B./ -shared -o libbar.so bar.o gcc -B./ -o x x.o libfoo.a libbar.so -Wl,-R,. ./ld: libfoo.a(foo.o): in function `foo': /export/home/hjl/bugs/binutils/31644/foo.c:6:(.text+0x5): undefined reference to `bar' collect2: error: ld returned 1 exit status make: *** [Makefile:15: x] Error 1 rm foo.o [hjl@gnu-cfl-3 31644]$ gcc -c x.c [hjl@gnu-cfl-3 31644]$ make gcc -B./ -o x x.o libfoo.a libbar.so -Wl,-R,. ./x [hjl@gnu-cfl-3 31644]$
A patch is posted at https://sourceware.org/pipermail/binutils/2024-April/133632.html
The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c2fbf57864a2da2ceda81706a54d125ef3fce0a7 commit c2fbf57864a2da2ceda81706a54d125ef3fce0a7 Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Apr 16 15:48:21 2024 -0700 elf: Skip the archive if the symbol isn't referenced Also skip the archive if the symbol isn't referenced by a regular object. bfd/ PR ld/31644 * elflink.c (elf_link_add_archive_symbols): Also skip the archive if the symbol isn't referenced by a regular object. ld/ PR ld/31644 * testsuite/ld-plugin/lto.exp: Run PR ld/31644 tests. * testsuite/ld-plugin/pr31644a.c: New test. * testsuite/ld-plugin/pr31644b.c: Likewise. * testsuite/ld-plugin/pr31644c.c: Likewise.
Fixed.