[OE-core] [PATCHv2] kernel.bbclass: set LD in KERNEL_CONFIG_COMMAND to fix 5.4+ builds when gold is enabled
Martin Jansa
martin.jansa at gmail.com
Mon Feb 3 18:11:50 UTC 2020
* with 5.4 kernel the do_configure fails when gold is enabled (with ld-is-gold in DISTRO_FEATURES)
* bfd is already being set in KERNEL_LD:
kernel-arch.bbclass:KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
but KERNEL_LD is currently respected only by do_compile and do_compile_kernel modules
and new kernel which contains a check for gold in Kbuild:
https://lore.kernel.org/lkml/alpine.DEB.2.21.1907161434260.1767@nanos.tec.linutronix.de/
more details:
https://lore.kernel.org/r/CAMe9rOqMqkQ0LNpm25yE_Yt0FKp05WmHOrwc0aRDb53miFKM+w@mail.gmail.com
will fail during the configuration even when gold wouldn't be used to
build it in the end, add LD setting to KERNEL_CONFIG_COMMAND to prevent
premature error when configuring
scripts/kconfig/conf --olddefconfig Kconfig
scripts/Kconfig.include:39: gold linker 'x86_64-oe-linux-ld' not supported
make[2]: *** [/OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/scripts/kconfig/Makefile:73: olddefconfig] Error 1
Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
v2 just without --in-reply-to to original thread "kernel-yocto: v5.4 LTS kernel (rev2)",
because patchtest tries to apply it with linux-yocto changes from that thread and reports
failure that it cannot be applied in master
meta/classes/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 750988f4e5..15219c596f 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -508,7 +508,7 @@ sysroot_stage_all () {
:
}
-KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} olddefconfig || oe_runmake -C ${S} O=${B} CC="${KERNEL_CC}" oldnoconfig"
+KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} CC="${KERNEL_CC}" LD="${KERNEL_LD}" O=${B} olddefconfig || oe_runmake -C ${S} O=${B} CC="${KERNEL_CC}" LD="${KERNEL_LD}" oldnoconfig"
python check_oldest_kernel() {
oldest_kernel = d.getVar('OLDEST_KERNEL')
--
2.20.1
More information about the Openembedded-core
mailing list