Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 931130 - sys-kernel/gentoo-sources-6.8.9: clang: error: clang frontend command failed with exit code 139 (clang-18.1.4)
Summary: sys-kernel/gentoo-sources-6.8.9: clang: error: clang frontend command failed ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords: REGRESSION
: 932304 936642 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-03 11:46 UTC by ernsteiswuerfel
Modified: 2024-07-28 22:51 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel .config (gentoo-sources-6.8.9) (config_689_fx8370,130.57 KB, text/plain)
2024-05-03 11:46 UTC, ernsteiswuerfel
Details
ip6_input-4bedd9.sh (ip6_input-4bedd9.sh,9.29 KB, text/plain)
2024-05-03 11:49 UTC, ernsteiswuerfel
Details
emerge --info (file_931130.txt,7.67 KB, text/plain)
2024-05-03 12:07 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2024-05-03 11:46:56 UTC
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
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-03 11:48:27 UTC
There's an upstream bug for this somewhere already (with a bunch of dupes)...
Comment 2 ernsteiswuerfel archtester 2024-05-03 11:49:13 UTC
Created attachment 892204 [details]
ip6_input-4bedd9.sh
Comment 3 ernsteiswuerfel archtester 2024-05-03 12:06:33 UTC
ip6_input-4bedd9.c is too big for uploading, even compressed. It can be downloaded here: https://murena.io/s/dXKPEDoW9Rwik6C
Comment 4 ernsteiswuerfel archtester 2024-05-03 12:07:14 UTC
Created attachment 892205 [details]
emerge --info
Comment 5 ernsteiswuerfel archtester 2024-05-03 12:08:23 UTC
(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.
Comment 6 ernsteiswuerfel archtester 2024-05-03 12:20:14 UTC
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.
Comment 7 ernsteiswuerfel archtester 2024-05-05 11:26:37 UTC
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.
Comment 8 ernsteiswuerfel archtester 2024-05-19 16:21:17 UTC
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.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-20 16:26:22 UTC
*** Bug 932304 has been marked as a duplicate of this bug. ***
Comment 10 Jorge López 2024-05-20 16:58:11 UTC
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).
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-25 21:01:57 UTC
*** Bug 936642 has been marked as a duplicate of this bug. ***
Comment 12 Mike Batterton 2024-07-28 19:30:39 UTC
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.
Comment 13 ernsteiswuerfel archtester 2024-07-28 19:36:33 UTC
Thanks for letting me know! I'll close here as soon as llvm-18.1.8-r2 hits stable.
Comment 14 Jorge López 2024-07-28 22:51:14 UTC
It's was also working in 19.0.0.9999 already, so I guess all 19.x.y ebuilds are working too.