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

Bug 932304

Summary: >=sys-devel/llvm-18.1.5-r1 crashes LLD when compiling Linux kernel with LLVM=1 and selecting -march for any AMD Zen
Product: Gentoo Linux Reporter: Jorge López <jorge>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: RESOLVED DUPLICATE    
Severity: normal CC: jorge, mgorny
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://github.com/llvm/llvm-project/issues/82431
https://github.com/llvm/llvm-project/pull/82881
https://github.com/llvm/llvm-project/pull/85081
Whiteboard:
Package list:
Runtime testing required: ---

Description Jorge López 2024-05-20 14:45:05 UTC
This is an upstream issue, which is already being worked on. Any LLVM>=18 makes LLD crash when building a kernel with LLVM=1 and selecting AMD Zen optimizations. All znver options are affected.

I created a small repo with patches for both 18.1.5-r1 and 18.1.6 which just cherry-pick two commits, after putting those in the Portage patches folder, both versions of LLVM are able to compile the kernel again.

My repo with the patches is at github.com/LtdJorge/llvm-patches. There's more info included in the readme, regarding the issues, PRs and commits, together with instructions to apply the patches for any user that would need them.

The patches apply cleanly on top of the packaged LLVM (I assumed the ebuilds are built from the llvmorg-18.1.5 and llvmorg-18.1.6 tags, as I couldn't determine it from the ebuild file, so I used those as base and cherry-picked the commits on top).

Any Gentoo devs, feel free to take the patches or whatever is needed.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-05-20 16:12:17 UTC
Are these changes marked for backporting to 18.x branch upstream?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-20 16:26:22 UTC

*** This bug has been marked as a duplicate of bug 931130 ***
Comment 3 Jorge López 2024-05-20 16:51:52 UTC
Thanks Sam, I tried to find an already open bug but couldn't find any. I will post my patches on the other bug, in case anyone wants the easier fix.