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.
Are these changes marked for backporting to 18.x branch upstream?
*** This bug has been marked as a duplicate of bug 931130 ***
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.