Bug 30002 - pr26391-5, pr26391-6 ld test failures on sparc64-unknown-linux-gnu since 496afd17055aeb7d8f45e01715c475664f2b73bd
Summary: pr26391-5, pr26391-6 ld test failures on sparc64-unknown-linux-gnu since 496a...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.41
: P2 normal
Target Milestone: 2.41
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-14 17:01 UTC by Sam James
Modified: 2023-08-07 10:07 UTC (History)
3 users (show)

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


Attachments
ld.log.xz (139.73 KB, application/x-xz)
2023-01-14 17:02 UTC, Sam James
Details
Try this. (561 bytes, patch)
2023-01-16 22:08 UTC, H.J. Lu
Details | Diff
Try this one (577 bytes, patch)
2023-01-16 23:23 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James 2023-01-14 17:01:05 UTC
Noticed on our new gentoo-sparc builder for builder.sourceware.org: https://builder.sourceware.org/buildbot/#/builders/228/builds/2/steps/5/logs/ld_sum.

From ld.sum:
```
FAIL: Run pr26391-5
FAIL: Run pr26391-6
```

Overall, the results are pretty good:
```
		=== ld Summary ===
# of expected passes		1596
# of unexpected failures	2
# of expected failures		26
# of untested testcases		1
# of unsupported tests		157
./ld-new 2.40.50.20230114
```

No other components had failures, either.
Comment 1 Sam James 2023-01-14 17:02:20 UTC
From ld.log:
```
gcc -B/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-build/ld/tmpdir/ld/   -L/usr/local/sparc64-unknown-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/sparc64-unknown-linux-gnu/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/pr26391-5   -L/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-gdb/ld/testsuite/ld-elf -Wl,-z,unique-symbol tmpdir/dummy.o tmpdir/pr26391-5.o
Executing on host: sh -c {gcc -B/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-build/ld/tmpdir/ld/   -L/usr/local/sparc64-unknown-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/sparc64-unknown-linux-gnu/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/pr26391-5   -L/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-gdb/ld/testsuite/ld-elf -Wl,-z,unique-symbol tmpdir/dummy.o tmpdir/pr26391-5.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
Running: tmpdir/pr26391-5 > tmpdir/pr26391-5.out
child killed: illegal instruction
FAIL: Run pr26391-5
gcc  -B/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-build/ld/tmpdir/ld/ -I/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-lto  -c /home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-gdb/ld/testsuite/ld-elf/dummy.c -o tmpdir/dummy.o
Executing on host: sh -c {gcc  -B/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-build/ld/tmpdir/ld/ -I/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-lto  -c /home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-gdb/ld/testsuite/ld-elf/dummy.c -o tmpdir/dummy.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
gcc -B/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-build/ld/tmpdir/ld/   -L/usr/local/sparc64-unknown-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/sparc64-unknown-linux-gnu/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/pr26391-6   -L/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-gdb/ld/testsuite/ld-elf -Wl,-z,unique-symbol tmpdir/dummy.o tmpdir/pr26391-6.o
Executing on host: sh -c {gcc -B/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-build/ld/tmpdir/ld/   -L/usr/local/sparc64-unknown-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/sparc64-unknown-linux-gnu/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/pr26391-6   -L/home/buildbot-sw/builder/workerdir/binutils-gentoo-sparc/binutils-gdb/ld/testsuite/ld-elf -Wl,-z,unique-symbol tmpdir/dummy.o tmpdir/pr26391-6.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
Running: tmpdir/pr26391-6 > tmpdir/pr26391-6.out
child killed: illegal instruction
FAIL: Run pr26391-6
```
Comment 2 Sam James 2023-01-14 17:02:43 UTC
Created attachment 14597 [details]
ld.log.xz
Comment 3 Mark Wielaard 2023-01-15 17:33:50 UTC
See also https://sourceware.org/bugzilla/show_bug.cgi?id=26391#c10
Comment 4 H.J. Lu 2023-01-16 19:33:31 UTC
(In reply to Mark Wielaard from comment #3)
> See also https://sourceware.org/bugzilla/show_bug.cgi?id=26391#c10

I couldn't reproduce it on GCC compiler farm last time.  The Linux/sparc64
machine on GCC compiler farm was down.  Why does "ld -r -z unique-symbol"
generate incorrect outputs on Linux/sparc64?
Comment 5 Sam James 2023-01-16 19:41:51 UTC
(In reply to H.J. Lu from comment #4)
> I couldn't reproduce it on GCC compiler farm last time.  The Linux/sparc64
> machine on GCC compiler farm was down.

I can give you access to this environment if you email me an SSH key. It's purely for CI and clean otherwise.
Comment 6 H.J. Lu 2023-01-16 19:45:46 UTC
(In reply to Sam James from comment #5)
> (In reply to H.J. Lu from comment #4)
> > I couldn't reproduce it on GCC compiler farm last time.  The Linux/sparc64
> > machine on GCC compiler farm was down.
> 
> I can give you access to this environment if you email me an SSH key. It's
> purely for CI and clean otherwise.

Done.
Comment 7 H.J. Lu 2023-01-16 21:39:50 UTC
The problem is unrelated to -z unique-symbol. I got

$ cc -B/home/hjlu/build/build-sparc64-linux/ld/tmpdir/ld/   -L=/usr/local/sparc64-unknown-linux-gnu/lib64 -L=/usr/local/lib64 -L=/lib64 -L=/usr/lib64 -L=/usr/local/sparc64-unknown-linux-gnu/lib -L=/usr/local/lib -L=/lib -L=/usr/lib  -o tmpdir/pr26391-5g   -L/home/hjlu/git/binutils-gdb/ld/testsuite/ld-elf tmpdir/dummy.o tmpdir/pr26391a.o tmpdir/pr26391b.o tmpdir/pr26391c.o tmpdir/pr26391d.o
$ tmpdir/pr26391-5g
Illegal instruction (core dumped)
$
Comment 8 H.J. Lu 2023-01-16 22:08:01 UTC
Created attachment 14601 [details]
Try this.
Comment 9 Sourceware Commits 2023-01-16 22:22:11 UTC
The try-PR26391 branch has been updated by Mark Wielaard <mark@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=99175c84026b1bfa534f3946150535c39027911d

commit 99175c84026b1bfa534f3946150535c39027911d
Author: Sam James <sam@gentoo.org>
Date:   Mon Jan 16 14:03:02 2023 -0800

    ld: Use run_cc_link_tests for PR ld/26391 tests
    
    Use run_cc_link_tests for PR ld/26391 tests to compile PR ld/26391 tests
    in C.
    
            PR ld/30002
            * testsuite/ld-elf/elf.exp: Use run_cc_link_tests for PR ld/26391
            tests.
Comment 10 Mark Wielaard 2023-01-16 22:39:19 UTC
(In reply to cvs-commit@gcc.gnu.org from comment #9)
> The try-PR26391 branch has been updated by Mark Wielaard
> <mark@sourceware.org>:
> 
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;
> h=99175c84026b1bfa534f3946150535c39027911d
> 
> commit 99175c84026b1bfa534f3946150535c39027911d
> Author: Sam James <sam@gentoo.org>
> Date:   Mon Jan 16 14:03:02 2023 -0800

Sorry, that was me, but a) I mistyped the correct branch name and b) changed the Author to Sam to show which emails the buildbot sents out.

The actual try build with this patch is actually here:
https://builder.sourceware.org/buildbot/#/changes/17250

try builders for binutils are described here:
https://sourceware.org/binutils/wiki/Buildbot
Comment 11 Sam James 2023-01-16 22:41:01 UTC
Thanks H.J., this works!

		=== ld Summary ===
# of expected passes		1598
# of expected failures		26
# of untested testcases		1
# of unsupported tests		157

What was the issue?
Comment 12 Sam James 2023-01-16 22:47:55 UTC
(In reply to Sam James from comment #11)
> Thanks H.J., this works!
> 
> 		=== ld Summary ===
> # of expected passes		1598
> # of expected failures		26
> # of untested testcases		1
> # of unsupported tests		157
> 
> What was the issue?

Interestingly, it causes failures on some buildbots (not sparc), like https://builder.sourceware.org/buildbot/#/builders/113/builds/28.

```
FAIL: Build pr26391-5.o
FAIL: Build pr26391-6.o
PASS: Run pr26391-1
PASS: Run pr26391-2
PASS: Run pr26391-3
PASS: Run pr26391-4
FAIL: Run pr26391-5
FAIL: Run pr26391-6
```

```
gcc  -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/ -I/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-function-sections -c /home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf/pr26391a.c -o tmpdir/pr26391a.o
Executing on host: sh -c {gcc  -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/ -I/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-function-sections -c /home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf/pr26391a.c -o tmpdir/pr26391a.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
gcc  -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/ -I/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-function-sections -c /home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf/pr26391b.c -o tmpdir/pr26391b.o
Executing on host: sh -c {gcc  -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/ -I/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-function-sections -c /home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf/pr26391b.c -o tmpdir/pr26391b.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
gcc  -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/ -I/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-function-sections -c /home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf/pr26391c.c -o tmpdir/pr26391c.o
Executing on host: sh -c {gcc  -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/ -I/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-function-sections -c /home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf/pr26391c.c -o tmpdir/pr26391c.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
gcc  -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/ -I/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-function-sections -c /home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf/pr26391d.c -o tmpdir/pr26391d.o
Executing on host: sh -c {gcc  -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/ -I/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -g -O2   -c -g -O2 -fno-function-sections -c /home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf/pr26391d.c -o tmpdir/pr26391d.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
gcc -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/   -L/usr/local/x86_64-pc-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/x86_64-pc-linux-gnu/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/pr26391-5.o   -L/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -Wl,-z,unique-symbol -r tmpdir/pr26391a.o tmpdir/pr26391b.o tmpdir/pr26391c.o tmpdir/pr26391d.o
Executing on host: sh -c {gcc -B/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/tmpdir/ld/   -L/usr/local/x86_64-pc-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/x86_64-pc-linux-gnu/lib -L/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/pr26391-5.o   -L/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-gdb/ld/testsuite/ld-elf -Wl,-z,unique-symbol -r tmpdir/pr26391a.o tmpdir/pr26391b.o tmpdir/pr26391c.o tmpdir/pr26391d.o 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/.libs/ld-new: cannot find -lgcc_s: No such file or directory
/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/.libs/ld-new: cannot find -lc: No such file or directory
/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/.libs/ld-new: cannot find -lgcc_s: No such file or directory
collect2: error: ld returned 1 exit status
/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/.libs/ld-new: cannot find -lgcc_s: No such file or directory
/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/.libs/ld-new: cannot find -lc: No such file or directory
/home/builder/shared/bb1-2/worker/binutils-try-opensuseleap-x86_64/binutils-build/ld/.libs/ld-new: cannot find -lgcc_s: No such file or directory
collect2: error: ld returned 1 exit status
Unexpected linker warning or error
FAIL: Build pr26391-5.o
```
Comment 13 H.J. Lu 2023-01-16 23:23:28 UTC
Created attachment 14602 [details]
Try this one
Comment 14 Mark Wielaard 2023-01-16 23:35:13 UTC
(In reply to H.J. Lu from comment #13)
> Created attachment 14602 [details]
> Try this one

Note that since the gentoo-sparc builder also does binutils-try builds you can try by pushing to a branch starting with try- under your users name. e.g
push origin <localbranchname>:users/hjl/try-pr30002

More documentation here: https://sourceware.org/binutils/wiki/Buildbot
Comment 15 Sam James 2023-01-17 00:25:58 UTC
(In reply to H.J. Lu from comment #13)
> Created attachment 14602 [details]
> Try this one

This looks to have worked! The failures for binutils-try-debian-i386 / binutils-try-fedora-arm64 / binutils-try-fedora-s390x exist for the non-try variants, so they fail on master too.
Comment 17 Sourceware Commits 2023-04-28 15:40:41 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=64b59b6bb2261fe2fa8310f94b4ed420c162e357

commit 64b59b6bb2261fe2fa8310f94b4ed420c162e357
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jan 16 14:03:02 2023 -0800

    ld: Use run_cc_link_tests for PR ld/26391 tests
    
    Use run_cc_link_tests for PR ld/26391 tests to compile PR ld/26391 tests
    in C.
    
            PR ld/30002
            * testsuite/ld-elf/elf.exp: Use run_cc_link_tests for PR ld/26391
            tests.
Comment 18 Sam James 2023-08-07 10:07:15 UTC
And thus fixed. Thank you!