Created attachment 892203 [details] kernel .config (gentoo-sources-6.8.9) gentoo-sources-6.8.8 build fine with clang-18.1.4 + lld-18.1.4 but gentoo-sources-6.8.9 fails building with: [...] /usr/src/linux-6.8.9-gentoo # LLVM=1 LLVM_IAS=1 make CALL scripts/checksyscalls.sh DESCEND objtool INSTALL libsubcmd_headers CC net/ipv6/ip6_input.o PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: clang -Wp,-MMD,net/ipv6/.ip6_input.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ --target=x86_64-linux-gnu -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -Werror=option-ignored -Werror=unused-command-line-argument -fmacro-prefix-map=./= -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mstack-alignment=8 -mskip-rax-setup -march=bdver2 -mno-tbm -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mretpoline-external-thunk -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -mharden-sls=all -fno-delete-null-pointer-checks -Os -fstack-protector -fomit-frame-pointer -ftrivial-auto-var-init=pattern -fno-stack-clash-protection -fzero-call-used-regs=used-gpr -fsanitize=kcfi -falign-functions=16 -fstrict-flex-arrays=3 -fno-strict-overflow -fno-stack-check -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=2048 -Wno-gnu -Wno-unused-but-set-variable -Wno-unused-const-variable -Wvla -Wno-pointer-sign -Wcast-function-type -Wimplicit-fallthrough -Werror=date-time -Werror=incompatible-pointer-types -Wenum-conversion -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-format-overflow -Wno-format-truncation -Wno-override-init -Wno-pointer-to-enum-cast -Wno-tautological-constant-out-of-range-compare -Wno-unaligned-access -Wno-cast-function-type-strict -Wno-enum-compare-conditional -Wno-enum-enum-conversion -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-sign-compare -DKBUILD_MODFILE=\"net/ipv6/ipv6\" -DKBUILD_BASENAME=\"ip6_input\" -DKBUILD_MODNAME=\"ipv6\" -D__KBUILD_MODNAME=kmod_ipv6 -c -o net/ipv6/ip6_input.o net/ipv6/ip6_input.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'net/ipv6/ip6_input.c'. 4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@ip6_rcv_core' clang: error: clang frontend command failed with exit code 139 (use -v to see invocation) clang version 18.1.4+libcxx Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/18/bin Configuration file: /etc/clang/clang.cfg clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/ip6_input-4bedd9.c clang: note: diagnostic msg: /tmp/ip6_input-4bedd9.sh clang: note: diagnostic msg: ******************** make[4]: *** [scripts/Makefile.build:243: net/ipv6/ip6_input.o] Error 1 make[3]: *** [scripts/Makefile.build:481: net/ipv6] Error 2 make[2]: *** [scripts/Makefile.build:481: net] Error 2 make[1]: *** [/usr/src/linux-6.8.9-gentoo/Makefile:1921: .] Error 2 make: *** [Makefile:240: __sub-make] Error 2
There's an upstream bug for this somewhere already (with a bunch of dupes)...
Created attachment 892204 [details] ip6_input-4bedd9.sh
ip6_input-4bedd9.c is too big for uploading, even compressed. It can be downloaded here: https://murena.io/s/dXKPEDoW9Rwik6C
Created attachment 892205 [details] emerge --info
(In reply to Sam James from comment #1) > There's an upstream bug for this somewhere already (with a bunch of dupes)... Ah, thanks for the hint! I'll have a look. Interesting thing is I only get this in gentoo-sources-6.8.9, not in upstream 6.8.9 via git.
Seems this is a clang-18 regression (https://github.com/llvm/llvm-project/issues/72026) which affects kernel builds with -march=bdver2. Which hopefully gets fixed by: https://github.com/llvm/llvm-project/pull/85081 (pull request already opened) which hopefully find it's way in upcoming 18.1.5.
Fix is not in 18.1.5 and looks like it affects other (all?) -march=specific_cpu settings. Workaround on my Zen3 machine was to use -march=x86-64-v3 instead of -march=znver3.
Upstream fix is: https://github.com/llvm/llvm-project/pull/85081 It's not merged into master yet so it did not find its' way into 18.1.6 either.
*** Bug 932304 has been marked as a duplicate of this bug. ***
I created a set of patches at github.com/LtdJorge/llvm-patches which apply cleanly on top of either 18.1.5-r1 or 18.1.6 and make it possible to build the kernel with LLVM=1 without taking out znver -march. Both are tested to build the kernel (I'm typing this from 6.9.0 built with 18.1.5-r1).
*** Bug 936642 has been marked as a duplicate of this bug. ***
I also have this same problem with gentoo-sources-6.10.1. I can confirm it has not been fixed in 18.1.8 either but I can confirm upgrading to sys-devel/llvm-18.1.8-r2 fixes the issue. With sys-devel/llvm-18.1.8-r1, the kernel fails to build with the above error. With the upgrade, the kernel successfully builds.
Thanks for letting me know! I'll close here as soon as llvm-18.1.8-r2 hits stable.
It's was also working in 19.0.0.9999 already, so I guess all 19.x.y ebuilds are working too.