With gcc-10: gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -I/home/dave/gnu/binutils/sr c/ld/testsuite/ld-plugin -g -O2 -c -g -O2 -flto -O2 -c /home/dave/gnu/binutils /src/ld/testsuite/ld-plugin/dummy.c -o tmpdir/dummy.o Executing on host: sh -c {gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -I /home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -g -O2 -c -g -O2 -flto -O2 -c /home/dave/gnu/binutils/src/ld/testsuite/ld-plugin/dummy.c -o tmpdir/dummy.o 2>&1} /dev/null ld.tmp (timeout = 300) spawn [open ...] gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -L=/home/dave/opt/test/hppa -unknown-linux-gnu/lib -L=/home/dave/opt/test/lib -L=/usr/local/lib -L=/lib -L=/ usr/lib -o tmpdir/pr20276 -L/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -O2 -flto tmpdir/pr20276a.o tmpdir/pr20276b.o tmpdir/dummy.o Executing on host: sh -c {gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -L=/home/dave/opt/test/hppa-unknown-linux-gnu/lib -L=/home/dave/opt/test/lib -L=/usr/local/lib -L=/lib -L=/usr/lib -o tmpdir/pr20276 -L/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -O2 -flto tmpdir/pr20276a.o tmpdir/pr20276b.o tmpdir/dummy.o 2>&1} /dev/null ld.tmp (timeout = 300) spawn [open ...] /home/dave/gnu/binutils/objdir/ld/.libs/lt-ld-new: tmpdir/pr20276b.o (symbol from plugin): in function `global_var': (.text+0x0): multiple definition of `global_var'; tmpdir/pr20276a.o:/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin/pr20276a.c:3: first defined here collect2: error: ld returned 1 exit status /home/dave/gnu/binutils/objdir/ld/.libs/lt-ld-new: tmpdir/pr20276b.o (symbol from plugin): in function `global_var': (.text+0x0): multiple definition of `global_var'; tmpdir/pr20276a.o:/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin/pr20276a.c:3: first defined here collect2: error: ld returned 1 exit status FAIL: Run pr20276 gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -I/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -g -O2 -c -g -O2 -flto -O2 -c /home/dave/gnu/binutils/src/ld/testsuite/ld-plugin/dummy.c -o tmpdir/dummy.o Executing on host: sh -c {gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -I/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -g -O2 -c -g -O2 -flto -O2 -c /home/dave/gnu/binutils/src/ld/testsuite/ld-plugin/dummy.c -o tmpdir/dummy.o 2>&1} /dev/null ld.tmp (timeout = 300) spawn [open ...] gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -L=/home/dave/opt/test/hppa-unknown-linux-gnu/lib -L=/home/dave/opt/test/lib -L=/usr/local/lib -L=/lib -L=/usr/lib -o tmpdir/pr20267a -L/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -O2 -flto tmpdir/pr20267a.o tmpdir/libpr20267a.a tmpdir/dummy.o Executing on host: sh -c {gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -L=/home/dave/opt/test/hppa-unknown-linux-gnu/lib -L=/home/dave/opt/test/lib -L=/usr/local/lib -L=/lib -L=/usr/lib -o tmpdir/pr20267a -L/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -O2 -flto tmpdir/pr20267a.o tmpdir/libpr20267a.a tmpdir/dummy.o 2>&1} /dev/null ld.tmp (timeout = 300) spawn [open ...] Running: tmpdir/pr20267a > tmpdir/pr20267a.out child killed: SIGABRT FAIL: Run pr20267a gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -I/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -g -O2 -c -g -O2 -flto -O2 -c /home/dave/gnu/binutils/src/ld/testsuite/ld-plugin/dummy.c -o tmpdir/dummy.o Executing on host: sh -c {gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -I/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -g -O2 -c -g -O2 -flto -O2 -c /home/dave/gnu/binutils/src/ld/testsuite/ld-plugin/dummy.c -o tmpdir/dummy.o 2>&1} /dev/null ld.tmp (timeout = 300) spawn [open ...] gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -L=/home/dave/opt/test/hppa-unknown-linux-gnu/lib -L=/home/dave/opt/test/lib -L=/usr/local/lib -L=/lib -L=/usr/lib -o tmpdir/pr20267b -L/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -O2 -flto tmpdir/pr20267a.o tmpdir/libpr20267b.a tmpdir/dummy.o Executing on host: sh -c {gcc -B/home/dave/gnu/binutils/objdir/ld/tmpdir/ld/ -L=/home/dave/opt/test/hppa-unknown-linux-gnu/lib -L=/home/dave/opt/test/lib -L=/usr/local/lib -L=/lib -L=/usr/lib -o tmpdir/pr20267b -L/home/dave/gnu/binutils/src/ld/testsuite/ld-plugin -O2 -flto tmpdir/pr20267a.o tmpdir/libpr20267b.a tmpdir/dummy.o 2>&1} /dev/null ld.tmp (timeout = 300) spawn [open ...] Running: tmpdir/pr20267b > tmpdir/pr20267b.out child killed: SIGABRT FAIL: Run pr20267b
Created attachment 12163 [details] Proposed patch Hi John, Please could you try out the attached patch and let me know if it works ? Cheers Nick
On 2020-01-03 6:33 a.m., nickc at redhat dot com wrote: > Please could you try out the attached patch and let me know if it works ? Hi Nick, The patch resolves the fail. Happy New Year, Dave
On 2020-01-04 3:56 p.m., dave.anglin at bell dot net wrote: > https://sourceware.org/bugzilla/show_bug.cgi?id=25327 > > --- Comment #2 from dave.anglin at bell dot net --- > On 2020-01-03 6:33 a.m., nickc at redhat dot com wrote: >> Please could you try out the attached patch and let me know if it works ? > Hi Nick, > > The patch resolves the fail. There's something wierd going on. I did a full build and check with patches for ld/25326 and ld/25327 and the following teats failed: FAIL: Run with libfunc1.so comm1.o FAIL: Run pr20267a FAIL: Run pr20267b I then reran the testsuite and these tests didn't fail. In my first check, I just reran testsuite with patches. Dave
(In reply to dave.anglin from comment #3) Hi Dave, > There's something wierd going on. I did a full build and check with patches > for ld/25326 and ld/25327 > and the following teats failed: > > FAIL: Run with libfunc1.so comm1.o > FAIL: Run pr20267a > FAIL: Run pr20267b > > I then reran the testsuite and these tests didn't fail. In my first check, > I just reran testsuite with patches. OK - that is strange. Do you still have the ld.log file for the failing tests ? If so, please can you inspect it and see if the "-fcommon" option added by the patch is present on the command lines used to build pr20267a and pr20267b ? Is it possible that different versions of gcc are being used for the failing and passing versions of the tests ? Uh - not sure how else this could happen... :-( Cheers Nick
On 2020-01-06 5:14 a.m., nickc at redhat dot com wrote: > Is it possible that different versions of gcc are being used for the failing > and passing versions of the tests ? That's it. The fails are with gcc-10 experimental. The tests pass with Debian gcc-9. Dave
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0e1f1593bc441863d0e5dc586ca3dd8945d36782 commit 0e1f1593bc441863d0e5dc586ca3dd8945d36782 Author: Nick Clifton <nickc@redhat.com> Date: Mon Jan 6 16:24:23 2020 +0000 Add -fcommon compiler command line option to linker tests that need common symbols. PR 25327 * testsuite/ld-elf/shared.exp: Add -fcommon option to compiler command line when building libcomm1.o and pr13250 tests. * testsuite/ld-plugin/lto.exp: Likewise for pr20267 tests.
Hi Dave, Right - I have gone ahead and built my own gcc-10 compiler, built a toolchain with it, and then run the linker testsuite. Sure enough I encountered the failures that you have mentioned. So I add some more "-fcommon" options to the linker tests, (possibly too many, but the extras should not hurt), and verified that the results should now be correct. At least for the x86_64-linux-gnu target.... Cheers Nick
*** Bug 25285 has been marked as a duplicate of this bug. ***