Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] gentoo-kernel 6.13.9 failing to compile w/ clang
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
alecStewart1
Apprentice
Apprentice


Joined: 03 Jul 2022
Posts: 257

PostPosted: Sat Apr 05, 2025 11:38 pm    Post subject: [SOLVED] gentoo-kernel 6.13.9 failing to compile w/ clang Reply with quote

Attempting to back to compiling the dist-kernel, run into this error on my bootstrap clang environment with gentoo-kernel 6.13.9

Code:

# cmd_gen_symversions_c fs/bcachefs/super-io.o
  if llvm-nm fs/bcachefs/super-io.o 2>/dev/null | grep -q ' __export_symbol_'; then clang -E -D__GENKSYMS__ -Wp,-MMD,fs/bcachefs/.super-io.o.d -nostdinc -I/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/arch/x86/include -I./arch/x86/include/generated -I/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/include -I./include -I/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/include/uapi -I./include/generated/uapi -include /var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/include/linux/compiler-version.h -include /var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/include/linux/kconfig.h -include /var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/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=/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/= -Werror -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=branch -fno-jump-tables -m64 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mstack-alignment=8 -mskip-rax-setup -mtune=generic -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 -fpatchable-function-entry=11,11 -fno-delete-null-pointer-checks -O2 -fstack-protector-strong -fomit-frame-pointer -ftrivial-auto-var-init=zero -fno-stack-clash-protection -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-format-overflow-non-kprintf -Wno-format-truncation-non-kprintf -Wvla -Wno-pointer-sign -Wcast-function-type -Wimplicit-fallthrough -Werror=date-time -Werror=incompatible-pointer-types -Wenum-conversion -Wextra -Wunused -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-format-overflow -Wno-override-init -Wno-pointer-to-enum-cast -Wno-tautological-constant-out-of-range-compare -Wno-unaligned-access -Wno-enum-compare-conditional -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-enum-enum-conversion -Wno-sign-compare -Wno-unused-parameter -g -DRANDSTRUCT -frandomize-layout-seed-file=./scripts/basic/randstruct.seed -Wno-psabi  -fsanitize=array-bounds -fsanitize=local-bounds -fsanitize-trap=undefined   -I/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/fs/bcachefs -Ifs/bcachefs  -DMODULE  -DKBUILD_BASENAME='"super_io"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs /var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/fs/bcachefs/super-io.c | ./scripts/genksyms/genksyms    >> fs/bcachefs/.super-io.o.cmd; fi
# LD [M]  fs/bcachefs/bcachefs.o
  ld.lld -m elf_x86_64 -z noexecstack   -r -o fs/bcachefs/bcachefs.o @fs/bcachefs/bcachefs.mod  ; ./tools/objtool/objtool --hacks=jump_label --hacks=noinstr --hacks=skylake --ibt --cfi --orc --retpoline --rethunk --sls --static-call --uaccess  --link  --module fs/bcachefs/bcachefs.o
# cmd_gen_objtooldep fs/bcachefs/bcachefs.o
   { echo ; echo 'fs/bcachefs/bcachefs.o: $(wildcard ./tools/objtool/objtool)' ; } >> fs/bcachefs/.bcachefs.o.cmd
# cmd_gen_order fs/bcachefs/modules.order
  {   echo fs/bcachefs/bcachefs.o;   echo fs/bcachefs/mean_and_variance_test.o; :; } > fs/bcachefs/modules.order
# cmd_gen_order fs/modules.order
  {   cat fs/notify/modules.order;   cat fs/crypto/modules.order;   cat fs/verity/modules.order;   cat fs/nfs_common/modules.order;   cat fs/iomap/modules.order;   cat fs/quota/modules.order;   cat fs/proc/modules.order;   cat fs/kernfs/modules.order;   cat fs/sysfs/modules.order;   cat fs/configfs/modules.order;   cat fs/devpts/modules.order;   cat fs/ext4/modules.order;   cat fs/jbd2/modules.order;   cat fs/ramfs/modules.order;   cat fs/hugetlbfs/modules.order;   cat fs/exportfs/modules.order;   cat fs/nls/modules.order;   cat fs/unicode/modules.order;   cat fs/autofs/modules.order;   cat fs/xfs/modules.order;   cat fs/hostfs/modules.order;   cat fs/debugfs/modules.order;   cat fs/btrfs/modules.order;   cat fs/pstore/modules.order;   cat fs/efivarfs/modules.order;   cat fs/dlm/modules.order;   cat fs/netfs/modules.order;   cat fs/squashfs/modules.order;   cat fs/coda/modules.order;   cat fs/minix/modules.order;   cat fs/fat/modules.order;   cat fs/exfat/modules.order;   cat fs/isofs/modules.order;   cat fs/hfsplus/modules.order;   cat fs/hfs/modules.order;   cat fs/ecryptfs/modules.order;   cat fs/nfs/modules.order;  cat fs/nfsd/modules.order;   cat fs/lockd/modules.order;   cat fs/sysv/modules.order;   cat fs/smb/modules.order;   cat fs/ntfs3/modules.order;   cat fs/ufs/modules.order;   cat fs/jffs2/modules.order;   cat fs/ubifs/modules.order;   cat fs/affs/modules.order;   cat fs/romfs/modules.order;   cat fs/fuse/modules.order;   cat fs/overlayfs/modules.order;   cat fs/orangefs/modules.order;   cat fs/udf/modules.order;   cat fs/jfs/modules.order;   cat fs/9p/modules.order;   cat fs/afs/modules.order;   cat fs/nilfs2/modules.order;   cat fs/befs/modules.order;   cat fs/cachefiles/modules.order;   cat fs/ocfs2/modules.order;   cat fs/gfs2/modules.order;   cat fs/f2fs/modules.order;   cat fs/bcachefs/modules.order;   cat fs/ceph/modules.order;   cat fs/erofs/modules.order;   cat fs/zonefs/modules.order; :; } > fs/modules.order
make[2]: *** [/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/Makefile:1991: .] Error 2
make[1]: *** [/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/Makefile:251: __sub-make] Error 2
make[1]: Leaving directory '/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/build'
make: *** [Makefile:251: __sub-make] Error 2
 * ERROR: sys-kernel/gentoo-kernel-6.13.9::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-kernel/gentoo-kernel-6.13.9::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-kernel/gentoo-kernel-6.13.9::gentoo'`.
 * The complete build log is located at '/var/log/portage/sys-kernel:gentoo-kernel-6.13.9:20250405-231710.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/temp/environment'.
 * Working directory: '/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13'
 * S: '/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13'


emerge --info

emerge --info '=sys-kernel/gentoo-kernel-6.13.9::gentoo'

/etc/portage/package.env for relevant packages

Code:

sys-devel/mold with-lto-thin with-pic with-z-relro with-z-now icf-safe-rewrite-endbr zero-used-registers

llvm-core/llvm with-lto-thin with-pic with-strip-debug icf-safe zero-used-registers
sys-libs/libcxx with-lto-thin icf-safe
sys-libs/libcxxabi with-lto-thin icf-safe
llvm-runtimes/compiler-rt with-lto-thin icf-safe zero-used-registers
llvm-runtimes/compiler-rt-sanitizers with-lto-thin icf-safe zero-used-registers
llvm-runtimes/libunwind with-lto-thin icf-safe
llvm-core/llvmgold icf-safe
llvm-core/lld with-lto-thin with-strip-debug icf-safe zero-used-registers
llvm-core/clang-common with-lto-thin
llvm-core/clang-runtime with-lto-thin with-pic with-strip-debug icf-safe zero-used-registers
>=llvm-core/clang-19.1.3 with-lto-thin with-strip-debug icf-safe zero-used-registers
<llvm-core/clang-19.1.3 with-lld linker-verbose
llvm-core/lldb with-lld with-lto-thin

sys-kernel/gentoo-kernel-bin kernel-clang with-lto-thin with-strip-all fortify-source-3 icf-safe-rewrite-endbr zero-used-registers
sys-kernel/gentoo-kernel kernel-clang # removed some other env file references to try and diagnose the problem better


/etc/portage/env/kernel-clang

Code:

LLVM=1
LLVM_IAS=1
LTO_CLANG_THIN=1


savedconfig kernel config for 6.13.9


Last edited by alecStewart1 on Fri Apr 11, 2025 3:13 am; edited 1 time in total
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2398

PostPosted: Sun Apr 06, 2025 12:11 am    Post subject: Reply with quote

The actual error isn't in the log. Please provide untruncated build.log.
Back to top
View user's profile Send private message
alecStewart1
Apprentice
Apprentice


Joined: 03 Jul 2022
Posts: 257

PostPosted: Sun Apr 06, 2025 4:56 pm    Post subject: Reply with quote

sam_ wrote:
The actual error isn't in the log. Please provide untruncated build.log.


Ah, dammit. Sorry about that.

Here's a privatebin link with the compressed build.log file attached
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2398

PostPosted: Sun Apr 06, 2025 8:12 pm    Post subject: Reply with quote

Nothing to do with Clang.

Quote:

make[4]: *** No rule to make target '/var/tmp/portage/sys-kernel/gentoo-kernel-6.13.9/temp/kernel_key.pem', needed by 'certs/signing_key.x509'. Stop.
make[4]: *** Waiting for unfinished jobs....
[...]
make[3]: *** [/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/scripts/Makefile.build:442: certs] Error 2
make[3]: *** Waiting for unfinished jobs....
Back to top
View user's profile Send private message
alecStewart1
Apprentice
Apprentice


Joined: 03 Jul 2022
Posts: 257

PostPosted: Fri Apr 11, 2025 3:12 am    Post subject: Reply with quote

sam_ wrote:
Nothing to do with Clang.

Quote:

make[4]: *** No rule to make target '/var/tmp/portage/sys-kernel/gentoo-kernel-6.13.9/temp/kernel_key.pem', needed by 'certs/signing_key.x509'. Stop.
make[4]: *** Waiting for unfinished jobs....
[...]
make[3]: *** [/var/tmp/portage/portage/sys-kernel/gentoo-kernel-6.13.9/work/linux-6.13/scripts/Makefile.build:442: certs] Error 2
make[3]: *** Waiting for unfinished jobs....


Ah, yep. I was able to solve this. Thanks, sam!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum