Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 911387 - sys-apps/systemd-253.7 overrides -fuse-ld=lld with -fuse-ld=bfd on clang/llvm toolchain system
Summary: sys-apps/systemd-253.7 overrides -fuse-ld=lld with -fuse-ld=bfd on clang/llvm...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-28 10:17 UTC by unhappy-ending
Modified: 2023-07-28 14:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build calling -fuse-ld=bfd on a clang/llvm toolchain system (systemd-fuse-ld-bfd.tar.gz,89.97 KB, application/gzip)
2023-07-28 10:19 UTC, unhappy-ending
Details
emerge --info (systemd-info.txt,8.35 KB, text/plain)
2023-07-28 10:19 UTC, unhappy-ending
Details

Note You need to log in before you can comment on or make changes to this bug.
Description unhappy-ending 2023-07-28 10:17:07 UTC
The build will pass -fuse-ld=bfd during the linking of src/boot/efi/linuxx64.elf.stub. Using the -flto flag during compilation will cause the build to complain about LLVMGold.so not being installed if the plugin doesn't exist since clang+bfd requires the plugin if -flto is invoked. 

If binutils is forcefully removed from the system, and -flto is not invoked, the link obviously fails since bfd linker doesn't exist.

Interestingly, linker arguments like --icf=all, which is invoked 400 times in the build log, doesn't cause a failure so that particular link is also ignoring LDFLAGS. -lgcc is also being linked against which means it's also ignoring compiler-rt and libunwind as the runtime/unwinder to be used.

Reproducible: Always
Comment 1 unhappy-ending 2023-07-28 10:19:12 UTC
Created attachment 866510 [details]
build calling -fuse-ld=bfd on a clang/llvm toolchain system
Comment 2 unhappy-ending 2023-07-28 10:19:30 UTC
Created attachment 866511 [details]
emerge --info
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-28 10:21:01 UTC
I suspect 254 will be fine.
Comment 4 unhappy-ending 2023-07-28 10:31:32 UTC
Just test compiled the release candidate, and it's ok. I feel like a dumbdumb having spent some time on this, lol.
Comment 5 Mike Gilbert gentoo-dev 2023-07-28 14:51:12 UTC
Based on bug 832019, lld doesn't work for the old systemd code anyway.

As Sam said, the changes coming in systemd-254 will fix this.