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

Bug 928381

Summary: sys-apps/systemd-255.4 fails to link with lld-18
Product: Gentoo Linux Reporter: Chris Pritchard <chris>
Component: Current packagesAssignee: Gentoo systemd Team <systemd>
Status: UNCONFIRMED ---    
Severity: normal CC: amit.ugol, chris
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/systemd/systemd/issues/31637
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 731004    
Attachments: fix-lld-18.patch
build.log

Description Chris Pritchard 2024-04-01 11:52:38 UTC
This is due to upstream bug: https://github.com/systemd/systemd/issues/31637.

Package fails to link when using lld-18 as linker with the following error:

[675/1798] /var/tmp/portage/sys-apps/systemd-255.4/work/systemd-stable-255.4/tools/elf2efi.py --version-major=255 --version-minor=0 --efi-major=1 --efi-minor=1 --subsystem=10 --minimum-sections=15 --copy-section
s=.sbat,.sdmagic,.osrel src/boot/efi/linuxx64.elf.stub src/boot/efi/linuxx64.efi.stub                                                                                                                              
FAILED: src/boot/efi/linuxx64.efi.stub                                                                                                                                                                             
/var/tmp/portage/sys-apps/systemd-255.4/work/systemd-stable-255.4/tools/elf2efi.py --version-major=255 --version-minor=0 --efi-major=1 --efi-minor=1 --subsystem=10 --minimum-sections=15 --copy-sections=.sbat,.sd
magic,.osrel src/boot/efi/linuxx64.elf.stub src/boot/efi/linuxx64.efi.stub                  
Traceback (most recent call last):                                                                                                                                                                                 
  File "/var/tmp/portage/sys-apps/systemd-255.4/work/systemd-stable-255.4/tools/elf2efi.py", line 699, in <module>                                                                                                 
    main()                                                                                                                                                                                                         
  File "/var/tmp/portage/sys-apps/systemd-255.4/work/systemd-stable-255.4/tools/elf2efi.py", line 695, in main                                                                                                     
    elf2efi(parser.parse_args())                                                                                                                                                                                   
  File "/var/tmp/portage/sys-apps/systemd-255.4/work/systemd-stable-255.4/tools/elf2efi.py", line 600, in elf2efi                                                                                                  
    sections = convert_sections(elf, opt)                                                                                                                                                                          
               ^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                          
  File "/var/tmp/portage/sys-apps/systemd-255.4/work/systemd-stable-255.4/tools/elf2efi.py", line 330, in convert_sections                                                                                         
    raise RuntimeError("Overlapping PE sections.")
Comment 1 Chris Pritchard 2024-04-01 11:54:02 UTC
Created attachment 889208 [details, diff]
fix-lld-18.patch

Patch backported to systemd-255.4 from the upstream bug report (https://github.com/systemd/systemd/commit/6d03e5523cc26a4f4cecf277788ae62bba44f88e)
Comment 2 Chris Pritchard 2024-04-01 13:05:56 UTC
Created attachment 889209 [details]
build.log
Comment 3 Amit Ugol 2024-04-02 18:03:09 UTC
had same issue, attached fix works on both
23.0 (gcc)/desktop/systemd
23.0 llvm/systemd
LGTM