Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 934149

Summary: sys-devel/binutils-2.42-r1: test failures on arm64
Product: Gentoo Linux Reporter: matoro <matoro_gentoo>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: IN_PROGRESS ---    
Severity: normal CC: arm64, matoro_gentoo
Priority: Normal Keywords: PATCH, TESTFAILURE
Version: unspecified   
Hardware: ARM64   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=931298
https://bugs.gentoo.org/show_bug.cgi?id=934151
https://bugs.gentoo.org/show_bug.cgi?id=647286
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log and emerge --info
build.log and emerge --info
build.log and emerge --info
ld-debuginfo.patch
build.log and emerge --info
ld-debuginfo.patch
build.log and emerge --info

Description matoro archtester 2024-06-12 15:06:10 UTC
Created attachment 895697 [details]
build.log and emerge --info

$ grep -E "^FAIL: " /tmp/build.log
FAIL: DWARF parse during linker error
FAIL: Build warn libbar.so
FAIL: Run warn with versioned libfoo.so

                === ld Summary ===
 
# of expected passes            1878
# of unexpected failures        3
# of expected failures          13
# of untested testcases         1
# of unsupported tests          168
./ld-new 2.42.0
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-12 15:21:27 UTC
Could you grab the ld.log file?
Comment 2 matoro archtester 2024-06-12 20:44:43 UTC
Created attachment 895713 [details]
build.log and emerge --info

Added that file to my standard info collection script, attached has it appended.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-12 21:04:23 UTC
Thanks!

* "DWARF parse during linker error" needs checking, not sure what's happening yet
* "Build warn libbar.so" ... is it expecting to be built with -g and it's just missing for that text? (which is why we get .o in the error, not .c)? If you try build with explicit -g or -ggdb3 or something, does it pass? (iirc configure defaults to -O2 -g which might explain why nobody noticed? not sure?)
* "Run warn with versioned libfoo.so" looks like the same

It's possible all 3 are the same root issue of missing -g, not sure.
Comment 4 matoro archtester 2024-06-12 21:28:07 UTC
Created attachment 895715 [details]
build.log and emerge --info

Yup, that fixes all 3 ld testcases, but subsequently causes gold to start failing on arm64.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-12 21:53:33 UTC
```
[...]

gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:87: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:87: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:95: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:95: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:103: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:103: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:111: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:111: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:121: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:121: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:133: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:133: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:142: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:142: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:154: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:154: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:201: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:201: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:210: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:210: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:212: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test.cc:212: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test_c.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test_c.c:52: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test_c.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test_c.c:52: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
gcctestdir/collect-ld: error: tls_test_c.o: unsupported reloc 549 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test_c.c:62: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_HI12
gcctestdir/collect-ld: error: tls_test_c.o: unsupported reloc 551 in non-static TLSLE mode.
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/gold/testsuite/tls_test_c.c:62: error: unexpected opcode while processing relocation R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:8403: tls_test_shared_nonpic.so] Error 1
make[5]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.42-r1/work/build/gold/testsuite'
```

Jeez. Anyway, let's see...
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-12 21:56:11 UTC
Created attachment 895716 [details, diff]
ld-debuginfo.patch

Please try this blind patch.

I need to check if the first one is okay or not, as I'm a bit suspicoius of it, as dwarf1.c gets built with -g already.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-12 21:57:27 UTC
On second thought, it's almost surely fine because of that configure thing I mentioned.
Comment 8 matoro archtester 2024-06-12 22:26:20 UTC
Created attachment 895717 [details]
build.log and emerge --info

One fail after that patch, plus gold.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-12 23:10:47 UTC
Created attachment 895718 [details, diff]
ld-debuginfo.patch

```
spawn [open ...]
aarch64-unknown-linux-gnu-gcc -B/var/tmp/portage/sys-devel/binutils-2.42-r1/work/build/ld/tmpdir/ld/   -L/usr/aarch64-unknown-linux-gnu/lib64 -L/usr/lib64/binutils/aarch64-unknown-linux-gnu/2.4264 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/aarch64-unknown-linux-gnu/lib -L/usr/lib64/binutils/aarch64-unknown-linux-gnu/2.42 -L/usr/local/lib -L/lib -L/usr/lib -Wl,--hash-style=sysv  -o tmpdir/warn   -L/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/ld/testsuite/ld-elf -Wl,--no-as-needed tmpdir/beginwarn.o tmpdir/libfoov.so tmpdir/main.o 
Executing on host: sh -c {aarch64-unknown-linux-gnu-gcc -B/var/tmp/portage/sys-devel/binutils-2.42-r1/work/build/ld/tmpdir/ld/   -L/usr/aarch64-unknown-linux-gnu/lib64 -L/usr/lib64/binutils/aarch64-unknown-linux-gnu/2.4264 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/aarch64-unknown-linux-gnu/lib -L/usr/lib64/binutils/aarch64-unknown-linux-gnu/2.42 -L/usr/local/lib -L/lib -L/usr/lib -Wl,--hash-style=sysv  -o tmpdir/warn   -L/var/tmp/portage/sys-devel/binutils-2.42-r1/work/binutils-2.42/ld/testsuite/ld-elf -Wl,--no-as-needed tmpdir/beginwarn.o tmpdir/libfoov.so tmpdir/main.o  2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/build/ld/.libs/ld-new: cannot find tmpdir/beginwarn.o: No such file or directory
collect2: error: ld returned 1 exit status
/var/tmp/portage/sys-devel/binutils-2.42-r1/work/build/ld/.libs/ld-new: cannot find tmpdir/beginwarn.o: No such file or directory
collect2: error: ld returned 1 exit status
returned with: </var/tmp/portage/sys-devel/binutils-2.42-r1/work/build/ld/.libs/ld-new: cannot find tmpdir/beginwarn.o: No such file or directory
collect2: error: ld returned 1 exit status>, expected: <^.*beginwarn.c:7:\(.*\): warning: function foo is deprecated\n?$>
FAIL: Run warn with versioned libfoo.so
```

I don't get what it's doing there (why is it missing -g and now failing)?

Does reordering the params help as attached?
Comment 10 matoro archtester 2024-06-13 02:33:43 UTC
Created attachment 895720 [details]
build.log and emerge --info

Nope, still one fail.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-29 10:12:49 UTC
Sent the -g patch upstream at https://inbox.sourceware.org/binutils/20240629101136.3316896-1-sam@gentoo.org/T/#u.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-29 16:30:56 UTC
commit 2c932a9d704ff21cafe606bc09d254e3d48c551b
Author: Andreas K. Hüttel <dilfridge@gentoo.org>
Date:   Sat Jun 29 18:15:43 2024 +0200

    sys-devel/binutils: bump 2.42-r2 to patchset 5, reverts some gentoo-specific stuff

    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

It doesn't have the -g fix though.