Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#70871 - [binutils] testsuite improvements

Attached to Project: Arch Linux
Opened by Toolybird (Toolybird) - Friday, 14 May 2021, 23:39 GMT
Last edited by freswa (frederik) - Thursday, 10 February 2022, 19:01 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
freswa (frederik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


The binutils testsuite can be made to pass (including gold) with just a few tweaks. There are multiple issues:

- PKGBUILD is missing checkdep on dejagnu (obviously due to the "manual" method of Arch toolchain bootstrap as documented here[1]). Fix this in the interest of correctness.

- the linker testsuites (both ld and gold) are sensitive to `-fno-plt'. Filter this out. NOTE *just for the running of the testuite - not when building the binaries to be installed*

- 3 ld tests need `-g'. Add this appropriately.

- 1 gold test needs `dc'. Add bc to checkdeps.

- gold testsuite is sensitive to Arch GCC default of `--enable-default-pie'. Negate this by adding `-no-pie' to FLAGS where appropriate. Note that -fpie also turns on PIC. Also add `-fno-PIC' where needed. Again, these tweaks are applied only to testsuite!

- glibc-2.33 caused some bogus failures in ld tests wrt CPU ISA levels. Fixed upstream in binutils-2_36-branch. Add patch.

- gcc-11 now defaults to DWARF 5 debugging format. gold support for DWARF 5 is missing in binutils-2.36. Fixed in upstream binutils git mainline. Add patch.

I've attached a diff with all of the above included (tested with gcc-11 toolchain in testing). Also included are some minor tweaks which are hopefully not controversial but feel free to drop:

- elfutils is a split package in Arch these days. The actual hard dep is on libelf. elfutils is needed for debuginfod which could be considered optional (but is needed in the testsuite). Reflect this in tweaks to deps.

- `make configure-host' is a relic from the dark ages and is redundant. Once upon a time it was utilised to get cleaner log output for parallel make jobs. This is easily solved these days by calling `make -O'. Fix.

Hopefully all of the above helps to improve confidence in the Arch toolchain.

This task depends upon

Closed by  freswa (frederik)
Thursday, 10 February 2022, 19:01 GMT
Reason for closing:  Implemented
Additional comments about closing:  r436887
Comment by Allan McRae (Allan) - Saturday, 15 May 2021, 04:57 GMT
Thanks - we have started a full review of the toolchain packages, including documentation, and had noticed a few of these too. Will go through your changes in detail!
Comment by Allan McRae (Allan) - Sunday, 16 May 2021, 00:26 GMT
While I remember, libiberty should move from gcc to binutils. And we can re-enable "--enable-shared" now.
Comment by Toolybird (Toolybird) - Sunday, 16 May 2021, 01:44 GMT
> libiberty should move from gcc to binutils

That's certainly an option. You may have seen my latest comment in the upstream bug report[1].

Your suggestion would nicely work around the bug.

libiberty is weird. It would be wonderful if the gcc and binutils versions stayed in perfect sync (I have seen some mumblings about git submodules...)


Comment by Allan McRae (Allan) - Sunday, 16 May 2021, 02:00 GMT
Even if the versions stayed in sync, the release schedules of the two are not... I remember that being the reason of moving libiberty from binutils to gcc many years ago.

Best to move it to binutils again and align with the other major distros.
Comment by Toolybird (Toolybird) - Sunday, 18 July 2021, 22:05 GMT
Updated for binutils-2.37

- remove patches already applied upstream
- Arch has split elfutils even further -> debuginfod now a separate pkg
- re-enable `--enable-shared'
- improved comments for testsuite
- (optional) add proper configure switches for if/when using a git checkout

1 new test failure has appeared but upstream are aware of it.
Comment by Allan McRae (Allan) - Monday, 20 December 2021, 12:25 GMT
If you reduce the testsuite flags to even more minimal, binutils can be build with LTO enabled:

make -k -O CFLAGS_FOR_TARGET="-O2 -g" \
CXXFLAGS="-O2 -no-pie -fno-PIC" \
CFLAGS="-O2 -no-pie" \
check || true

Still the 1 test suite failure.