@@ -92,5 +92,8 @@ KERNEL_LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld'
KERNEL_AR:toolchain-clang = "llvm-ar ${HOST_AR_KERNEL_ARCH}"
KERNEL_OBJCOPY:toolchain-clang = "llvm-objcopy ${HOST_OBJCOPY_KERNEL_ARCH}"
KERNEL_STRIP:toolchain-clang = "llvm-strip"
+# The kbuild recipes (kernel, modules, make-mod-scripts) set TOOLCHAIN
+# from KERNEL_TOOLCHAIN; other inheritors like u-boot and barebox only
+# use kernel-arch for the ARCH mapping and must stay on gcc.
KERNEL_TOOLCHAIN ?= "gcc"
-TOOLCHAIN = "${KERNEL_TOOLCHAIN}"
+TOOLCHAIN = "gcc"
@@ -214,6 +214,7 @@ python do_symlink_kernsrc () {
addtask symlink_kernsrc before do_patch do_configure after do_unpack
inherit kernel-arch deploy
+TOOLCHAIN = "${KERNEL_TOOLCHAIN}"
PACKAGES_DYNAMIC += "^${KERNEL_PACKAGE_NAME}-module-.*"
PACKAGES_DYNAMIC += "^${KERNEL_PACKAGE_NAME}-image-.*"
@@ -5,6 +5,7 @@
#
inherit kernel-arch
+TOOLCHAIN = "${KERNEL_TOOLCHAIN}"
# We do the dependency this way because the output is not preserved
# in sstate, so we must force do_compile to run (once).
@@ -4,6 +4,7 @@ LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
inherit kernel-arch linux-kernel-base
+TOOLCHAIN = "${KERNEL_TOOLCHAIN}"
inherit pkgconfig
PACKAGE_ARCH = "${MACHINE_ARCH}"