Bug 25327 - FAIL: Run pr20276
Summary: FAIL: Run pr20276
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.34
: P2 normal
Target Milestone: ---
Assignee: Nick Clifton
URL:
Keywords:
: 25285 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-30 23:19 UTC by John David Anglin
Modified: 2020-01-08 21:00 UTC (History)
2 users (show)

See Also:
Host: hppa-unknown-linux-gnu
Target: hppa-unknown-linux-gnu
Build: hppa-unknown-linux-gnu
Last reconfirmed:


Attachments
Proposed patch (311 bytes, patch)
2020-01-03 11:33 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2019-12-30 23:19:11 UTC
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
Comment 1 Nick Clifton 2020-01-03 11:33:47 UTC
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
Comment 2 dave.anglin 2020-01-04 20:56:56 UTC
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
Comment 3 dave.anglin 2020-01-04 23:21:52 UTC
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
Comment 4 Nick Clifton 2020-01-06 10:14:25 UTC
(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
Comment 5 dave.anglin 2020-01-06 13:05:21 UTC
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
Comment 6 Sourceware Commits 2020-01-06 16:25:36 UTC
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.
Comment 7 Nick Clifton 2020-01-06 16:28:11 UTC
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
Comment 8 Andrew Pinski 2020-01-08 21:00:28 UTC
*** Bug 25285 has been marked as a duplicate of this bug. ***