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

Bug 810940

Summary: genkernel no longer uses kernel_cc
Product: Gentoo Hosted Projects Reporter: Robin Johnson <robbat2>
Component: genkernelAssignee: Gentoo Genkernel Maintainers <genkernel>
Status: RESOLVED NEEDINFO    
Severity: normal CC: gentoo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2021-08-29 17:03:06 UTC
Somewhere in the changes over the last year or maybe longer, the KERNEL_CC option is no longer used to build the kernel.

This bit me when trying to use a different GCC to test an issue, and finding genkernel still used:
COMMAND: nice -n10 make -j10 -l8 ARCH='x86' AS='x86_64-pc-linux-gnu-as' AR='x86_64-pc-linux-gnu-ar' CC='x86_64-pc-linux-gnu-gcc' LD='x86_64-pc-linux-gnu-ld' NM='x86_64-pc-linux-gnu-nm' OBJCOPY='x86_64-pc-linux-gnu-objcopy' OBJDUMP='x86_64-pc-linux-gnu-objdump' READELF='x86_64-pc-linux-gnu-readelf' STRIP='x86_64-pc-linux-gnu-strip' HOSTAR='x86_64-pc-linux-gnu-ar' HOSTCC='x86_64-pc-linux-gnu-gcc' HOSTCXX='x86_64-pc-linux-gnu-g++' HOSTLD='x86_64-pc-linux-gnu-ld'

Despite my attempts at KERNEL_CC in the config file, or --kernel-cc on the commandline.

I'll try to bisect when it started happening later.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2021-08-29 23:28:55 UTC
Are you sure? It's working for me (and it's required for compiling kernel with LLVM/CLANG for example:

> >>> Started genkernel v4.2.3-git on: 2021-08-30 01:26:43
> * CMD_KERNEL_CONFIG: /proc/config.gz
> * CMD_INSTALL: no
> * CMD_CLEAN: no
> * CMD_MRPROPER: no
> * CMD_KERNEL_CC: blah
> * Gentoo Linux Genkernel; Version 4.2.3-git[0m
> * Using genkernel configuration from '/etc/genkernel.conf' ...
> * Running with options: --kernel-config=/proc/config.gz --no-install --no-clean --no-mrproper --kernel-cc=blah kernel
> * Resolving config file, command line, and arch default settings.
> *   TMPDIR defaulted to "/var/tmp/genkernel".
> *   LOGFILE set in config file to "/var/log/genkernel.log".
> *   KERNEL_DIR defaulted to "/usr/src/linux".
> *   KERNEL_MODULES_PREFIX not set.
> *   KERNEL_SOURCES defaulted to "yes".
> *   INITRAMFS_FILENAME defaulted to "initramfs-%%KV%%.img".
> *   INITRAMFS_SYMLINK_NAME defaulted to "initramfs".
> *   KERNEL_CONFIG_FILENAME defaulted to "kernel-config-%%KV%%".
> *   KERNEL_FILENAME defaulted to "vmlinuz-%%KV%%".
> *   KERNEL_SYMLINK_NAME defaulted to "kernel".
> *   SYSTEMMAP_FILENAME defaulted to "System.map-%%KV%%".
> *   SYSTEMMAP_SYMLINK_NAME defaulted to "System.map".
> *   CHECK_FREE_DISK_SPACE_BOOTDIR not set.
> *   CHECK_FREE_DISK_SPACE_KERNELOUTPUTDIR not set.
> *   COMPRESS_INITRD defaulted to "yes".
> *   COMPRESS_INITRD_TYPE defaulted to "best".
> *   CHOST defaulted to "x86_64-pc-linux-gnu".
> *   MAKEOPTS defaulted to "--jobs 42 --load-average 41.95".
> *   NICE defaulted to "10".
> *   KERNEL_AS defaulted to "as".
> *   KERNEL_AR defaulted to "ar".
> *   KERNEL_CC set on command line to "blah".
> *   KERNEL_CFLAGS not set.
> *   KERNEL_CXX defaulted to "g++".
> *   KERNEL_LD defaulted to "ld".
> *   KERNEL_NM defaulted to "nm".
> *   KERNEL_MAKE defaulted to "make".
> *   KERNEL_OBJCOPY defaulted to "objcopy".
> *   KERNEL_OBJDUMP defaulted to "objdump".
> *   KERNEL_RANLIB defaulted to "ranlib".
> *   KERNEL_READELF defaulted to "readelf".
> *   KERNEL_STRIP defaulted to "strip".
> *   UTILS_AS defaulted to "as".
> *   UTILS_AR defaulted to "ar".
> *   UTILS_CC defaulted to "gcc".
> *   UTILS_CFLAGS defaulted to "-Os -pipe -fomit-frame-pointer".
> *   UTILS_CXX defaulted to "g++".
> *   UTILS_LD defaulted to "ld".
> *   UTILS_NM defaulted to "nm".
> *   UTILS_MAKE defaulted to "make".
> *   UTILS_OBJCOPY defaulted to "objcopy".
> *   UTILS_OBJDUMP defaulted to "objdump".
> *   UTILS_RANLIB defaulted to "ranlib".
> *   UTILS_READELF defaulted to "readelf".
> *   UTILS_STRIP defaulted to "strip".
> *   CROSS_COMPILE not set.
> *   BOOTDIR defaulted to "/boot".
> *   KERNEL_APPEND_LOCALVERSION not set.
> *   KERNEL_LOCALVERSION defaulted to "-%%ARCH%%".
> *   MODPROBEDIR defaulted to "/etc/modprobe.d".
> *   SPLASH defaulted to "no".
> *   CLEAR_CACHEDIR defaulted to "no".
> *   POSTCLEAR defaulted to "no".
> *   MRPROPER set on command line to "no".
> *   MENUCONFIG defaulted to "no".
> *   GCONFIG defaulted to "no".
> *   NCONFIG defaulted to "no".
> *   XCONFIG defaulted to "no".
> *   CLEAN set on command line to "no".
> *   MINKERNPACKAGE not set.
> *   MODULESPACKAGE not set.
> *   MODULEREBUILD defaulted to "yes".
> *   MODULEREBUILD_CMD defaulted to "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild".
> *   KERNCACHE not set.
> *   RAMDISKMODULES defaulted to "yes".
> *   ALLRAMDISKMODULES defaulted to "no".
> *   INITRAMFS_OVERLAY not set.
> *   LINUXRC not set.
> *   MOUNTBOOT defaulted to "yes".
> *   BUILD_STATIC defaulted to "no".
> *   SAVE_CONFIG defaulted to "yes".
> *   SYMLINK set in config file to "yes".
> *   OLDCONFIG defaulted to "yes".
> *   SANDBOX defaulted to "yes".
> *   SSH defaulted to "no".
> *   SSH_AUTHORIZED_KEYS_FILE defaulted to "/etc/dropbear/authorized_keys".
> *   SSH_HOST_KEYS defaulted to "create".
> *   STRACE defaulted to "no".
> *   BCACHE defaulted to "no".
> *   LVM set in config file to "yes".
> *   DMRAID defaulted to "no".
> *   ISCSI defaulted to "no".
> *   HYPERV defaulted to "no".
> *   BOOTFONT defaulted to "none".
> *   BOOTLOADER set in config file to "grub2".
> *   B2SUM defaulted to "no".
> *   BUSYBOX defaulted to "yes".
> *   BUSYBOX_CONFIG not set.
> *   NFS defaulted to "yes".
> *   MICROCODE set in config file to "no".
> *   MICROCODE_INITRAMFS defaulted to "no".
> *   UNIONFS defaulted to "no".
> *   NETBOOT defaulted to "no".
> *   REAL_ROOT not set.
> *   LUKS defaulted to "no".
> *   GPG defaulted to "no".
> *   MDADM defaulted to "no".
> *   MDADM_CONFIG not set.
> *   E2FSPROGS defaulted to "no".
> *   XFSPROGS defaulted to "no".
> *   ZFS defaulted to "no".
> *   BTRFS defaulted to "no".
> *   VIRTIO defaulted to "no".
> *   MULTIPATH defaulted to "no".
> *   FIRMWARE defaulted to "no".
> *   FIRMWARE_DIR defaulted to "/lib/firmware".
> *   FIRMWARE_FILES not set.
> *   FIRMWARE_INSTALL defaulted to "no".
> *   INTEGRATED_INITRAMFS defaulted to "no".
> *   WRAP_INITRD defaulted to "no".
> *   GENZIMAGE defaulted to "no".
> *   KEYMAP defaulted to "yes".
> *   DOKEYMAPAUTO defaulted to "no".
> *   STRIP_TYPE defaulted to "modules".
> *   INSTALL set on command line to "no".
> *   CLEANUP defaulted to "yes".
> *   KERNEL_OUTPUTDIR defaulted to "/usr/src/linux".
> 
> * Read 'x86_64' from 'uname -m' ...
> * ARCH 'x86_64' detected ...
> * CBUILD set to 'x86_64-pc-linux-gnu' ...
> * CHOST set to 'x86_64-pc-linux-gnu' ...
> 
> * Sourcing default modules_load from '/usr/share/genkernel/defaults/modules_load' ...
> * Sourcing arch-specific config.sh from '/usr/share/genkernel/arch/x86_64/config.sh' ...
> * Sourcing arch-specific modules_load from '/usr/share/genkernel/arch/x86_64/modules_load' ...
> * Using '/usr/src/linux/include/config/kernel.release' to extract LOCALVERSION ...
> * KERNEL_ARCH set to 'x86' ...
> 
> * GK_FILENAME_CONFIG set to 'kernel-config-5.13.6-gentoo-x86_64' (was: 'kernel-config-%%KV%%')
> * GK_FILENAME_KERNEL set to 'vmlinuz-5.13.6-gentoo-x86_64' (was: 'vmlinuz-%%KV%%')
> * GK_FILENAME_KERNEL_SYMLINK set to 'kernel' (was: 'kernel')
> * GK_FILENAME_SYSTEMMAP set to 'System.map-5.13.6-gentoo-x86_64' (was: 'System.map-%%KV%%')
> * GK_FILENAME_SYSTEMMAP_SYMLINK set to 'System.map' (was: 'System.map')
> * GK_FILENAME_INITRAMFS set to 'initramfs-5.13.6-gentoo-x86_64.img' (was: 'initramfs-%%KV%%.img')
> * GK_FILENAME_INITRAMFS_SYMLINK set to 'initramfs' (was: 'initramfs')
> * Checking for suitable kernel configuration ...
> 
> * Working with Linux kernel 5.13.6-gentoo-x86_64 for x86_64
> * Using kernel config file '/proc/config.gz' ...
> * 
> * Note: The version above is subject to change (depends on config and status of kernel sources).
> 
> * kernel: >> Initializing ...
> *         >> --no-clean is set; Skipping 'make clean' ...
> *         >> --no-mrproper is set; Skipping 'make mrproper' ...
> *         >> Can keep using already existing '/usr/src/linux/.config' which is identical to --kernel-config file  ...
> *         >> Running 'make oldconfig' ...
> COMMAND: nice -n10 make --jobs 42 --load-average 41.95 ARCH='x86' AS='x86_64-pc-linux-gnu-as' AR='x86_64-pc-linux-gnu-ar' CC='blah' LD='x86_64-pc-linux-gnu-ld' NM='x86_64-pc-linux-gnu-nm' OBJCOPY='x86_64-pc-linux-gnu-objcopy' OBJDUMP='x86_64-pc-linux-gnu-objdump' READELF='x86_64-pc-linux-gnu-readelf' STRIP='x86_64-pc-linux-gnu-strip' HOSTAR='x86_64-pc-linux-gnu-ar' HOSTCC='x86_64-pc-linux-gnu-gcc' HOSTCXX='x86_64-pc-linux-gnu-g++' HOSTLD='x86_64-pc-linux-gnu-ld' oldconfig
> scripts/Kconfig.include:39: compiler 'blah' not found
> make[1]: *** [scripts/kconfig/Makefile:77: oldconfig] Error 1
> make: *** [Makefile:619: oldconfig] Error 2
> 
> * ERROR: config_kernel(): compile_generic() failed to compile the "oldconfig" target!
> * Genkernel was unexpectedly terminated (signal SIGTERM received).
> * Please consult '/var/log/genkernel.log' for more information and any
> * errors that were reported above.
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2021-11-15 15:41:24 UTC
ping