Description of problem: https://github.com/systemd/package-notes/blob/main/rpm/macros.package-notes-srpm#L52 `%_package_note_flags %[%_package_note_status?"-Wl,%["%_package_note_linker" != "lld"?"-dT":"-T"],%{_package_note_file}":""]` I was asked why lld doesn't support -dT. I think it is related to a GNU ld quirk about the `not found for insert` diagnostic. Reported the issue for upstream GNU ld: https://sourceware.org/bugzilla/show_bug.cgi?id=28902#c1 If the ordering issue is fixed, GNU ld can use -T as well. The distro usage of -dT may break a project using -dT.
Using -dT is required as several hundreds if not more packages using autoconf cause the input flags to be duplicated, so -T by itself will not work. There is nothing wrong with ld.bfd, this is simply necessary for practical reasons due to the reality of what it means to put together a distribution made of tens of thousands of different packages with different configurations, build systems, glue scripts, etc. We hit this problem in both CBL-mariner and another internal Yocto-based distro. It's up to LLVM to be compatible with the default reference implementation (or not, and then simply accept not being used). I recommend CLOSEWONTFIX for this ticket.
Fangrui: I'll wait for the resolution of discussion in https://sourceware.org/bugzilla/show_bug.cgi?id=28902 before doing any changes here. Nick proposed either documenting existing behaviour or changing the code.
This will become moot if #2099999 is accepted.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle. Changing version to 37.