Bug 2055458

Summary: systemd/package-notes should use -T instead of -dT
Product: [Fedora] Fedora Reporter: Fangrui Song <i>
Component: package-notesAssignee: Zbigniew Jędrzejewski-Szmek <zbyszek>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: fedoraproject, filbranden, flepied, lnykryn, luca.boccassi, msekleta, ryncsn, ssahani, s, systemd-maint, yuwatana, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: package-notes-0.5-4.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-03 16:21:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2099999    
Bug Blocks: 1956946    

Description Fangrui Song 2022-02-17 02:36:01 UTC
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.

Comment 1 Luca Boccassi 2022-02-17 10:52:04 UTC
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.

Comment 2 Zbigniew Jędrzejewski-Szmek 2022-03-17 20:45:51 UTC
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.

Comment 3 Zbigniew Jędrzejewski-Szmek 2022-08-09 09:30:07 UTC
This will become moot if #2099999 is accepted.

Comment 4 Ben Cotton 2022-08-09 13:41:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.