Skip to contentSkip to conversation

cml1: Set proper LD while during kernel menuconfig

PATCH In review [email protected] 2 participants 3 messages Nov 16, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cml1: Set proper LD while during kernel menuconfig

With 'ld-is-gold' and linux kernel 5.4 or later, menuconfig task for kernel recipes will fail with:

$ bitbake -c menuconfig virtual/kernel
...
scripts/kconfig/mconf  Kconfig
scripts/Kconfig.include:43:  gold linker 'x86_64-poky-linux-ld' not supported
/OE/build/tmp/work-shared/qemux86-64/kernel-source/scripts/kconfig/Makefile:29:
 recipe for target 'menuconfig' failed
make[2]: *** [menuconfig] Error 1
/OE/build/tmp/work-shared/qemux86-64/kernel-source/Makefile:606:
 recipe for target 'menuconfig' failed
make[1]: *** [menuconfig] Error 2
/OE/build/tmp/work-shared/qemux86-64/kernel-source/Makefile:185:
 recipe for target '__sub-make' failed
make: *** [__sub-make] Error 2
Command failed.

This is because that the KERNEL_LD variable already set in kernel-arch.bbclass isn't used by do_menuconfig function of cml1.bbclass.

To fix this issue specify LD variable while calling the kernel menuconfig command.

---
 meta/classes/cml1.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/cml1.bbclass +1 -1
index d319d66ab2..02cd058fc5 100644
@@ -48,7 +48,7 @@ python do_menuconfig() {
     # ensure that environment variables are overwritten with this tasks 'd' values
     d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
 
-    oe_terminal("sh -c \"make %s; if [ \\$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+    oe_terminal("sh -c \"make LD=${KERNEL_LD} %s; if [ \\$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
                 d.getVar('PN') + ' Configuration', d)
 
     # FIXME this check can be removed when the minimum bitbake version has been bumped
Signature · 1 line
2.29.2
#1 lore raw
Quoted 36 lines · Wonmin Jung

With 'ld-is-gold' and linux kernel 5.4 or later, menuconfig task for kernel recipes will fail with:

$ bitbake -c menuconfig virtual/kernel
...
scripts/kconfig/mconf  Kconfig
scripts/Kconfig.include:43:  gold linker 'x86_64-poky-linux-ld' not supported
/OE/build/tmp/work-shared/qemux86-64/kernel-source/scripts/kconfig/Makefile:29:
 recipe for target 'menuconfig' failed
make[2]: *** [menuconfig] Error 1
/OE/build/tmp/work-shared/qemux86-64/kernel-source/Makefile:606:
 recipe for target 'menuconfig' failed
make[1]: *** [menuconfig] Error 2
/OE/build/tmp/work-shared/qemux86-64/kernel-source/Makefile:185:
 recipe for target '__sub-make' failed
make: *** [__sub-make] Error 2
Command failed.

This is because that the KERNEL_LD variable already set in kernel-arch.bbclass isn't used by do_menuconfig function of cml1.bbclass.

To fix this issue specify LD variable while calling the kernel menuconfig command.

---
 meta/classes/cml1.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/cml1.bbclass +0 -0
index d319d66ab2..02cd058fc5 100644

meta/classes/cml1.bbclass python do_menuconfig() { · line 51

Quoted 5 lines
meta/classes/cml1.bbclass +1 -1
@@ -48,7 +48,7 @@ python do_menuconfig() {
     # ensure that environment variables are overwritten with this tasks 'd' values
     d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
 
-    oe_terminal("sh -c \"make %s; if [ \\$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+    oe_terminal("sh -c \"make LD=${KERNEL_LD} %s; if [ \\$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),

I don't think this is the right place to be setting this, since cml1 is not only for the kernel. I think a better place to set this would be in kernel.bbclass, alongside the existing HOSTLDFLAGS setting through KCONFIG_CONFIG_COMMAND.
(https://git.openembedded.org/openembedded-core/tree/meta/classes/kernel.bbclass#n589)

Regards,
Nathan

Quoted 9 lines
meta/classes/cml1.bbclass +0 -1
                 d.getVar('PN') + ' Configuration', d)
 
     # FIXME this check can be removed when the minimum bitbake version has been bumped
--

2.29.2

#2 lore raw

Good point. I'll submit another patch after build test.

2020년 11월 16일 (월) 오후 7:33, Nathan Rossi <[email protected]>님이 작성:

Quoted 74 lines · Wonmin Jung
Quoted 8 lines

With 'ld-is-gold' and linux kernel 5.4 or later, menuconfig task for kernel recipes will fail with:

$ bitbake -c menuconfig virtual/kernel
...
scripts/kconfig/mconf  Kconfig
scripts/Kconfig.include:43:  gold linker 'x86_64-poky-linux-ld' not

supported

Quoted 1 line

/OE/build/tmp/work-shared/qemux86-64/kernel-source/scripts/kconfig/Makefile:29:

Quoted 27 lines

recipe for target 'menuconfig' failed
make[2]: *** [menuconfig] Error 1 /OE/build/tmp/work-shared/qemux86-64/kernel-source/Makefile:606:
recipe for target 'menuconfig' failed
make[1]: *** [menuconfig] Error 2 /OE/build/tmp/work-shared/qemux86-64/kernel-source/Makefile:185:
recipe for target '__sub-make' failed
make: *** [__sub-make] Error 2
Command failed.

This is because that the KERNEL_LD variable already set in kernel-arch.bbclass isn't used by do_menuconfig function of cml1.bbclass.

To fix this issue specify LD variable while calling the kernel menuconfig command.

---
 meta/classes/cml1.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/cml1.bbclass +0 -0
index d319d66ab2..02cd058fc5 100644

meta/classes/cml1.bbclass python do_menuconfig() { · line 48

Quoted 1 line
meta/classes/cml1.bbclass +0 -0
@@ -48,7 +48,7 @@ python do_menuconfig() {
     # ensure that environment variables are overwritten with this tasks

'd' values

meta/classes/cml1.bbclass python do_menuconfig() { · line 49

Quoted 1 line
meta/classes/cml1.bbclass +0 -0
     d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH

PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")

meta/classes/cml1.bbclass python do_menuconfig() { · line 50

Quoted 2 lines
meta/classes/cml1.bbclass +0 -1
-    oe_terminal("sh -c \"make %s; if [ \\$? -ne 0 ]; then echo 'Command

failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),

meta/classes/cml1.bbclass python do_menuconfig() { · line 50

Quoted 1 line
meta/classes/cml1.bbclass +1 -0
+    oe_terminal("sh -c \"make LD=${KERNEL_LD} %s; if [ \\$? -ne 0 ];

then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),

I don't think this is the right place to be setting this, since cml1 is not only for the kernel. I think a better place to set this would be in kernel.bbclass, alongside the existing HOSTLDFLAGS setting through KCONFIG_CONFIG_COMMAND.
(
https://git.openembedded.org/openembedded-core/tree/meta/classes/kernel.bbclass#n589
)

Regards,
Nathan

meta/classes/cml1.bbclass python do_menuconfig() {

Quoted 3 lines
meta/classes/cml1.bbclass +0 -0
                 d.getVar('PN') + ' Configuration', d)
 
     # FIXME this check can be removed when the minimum bitbake version

has been bumped

Quoted 6 lines
meta/classes/cml1.bbclass +0 -1
--

2.29.2

Signature · 10 lines
*Wonmin Jung*
Senior Research Engineer
Software Platform R&D Lab.
CTO Division
LG Electronics Inc.

C/P: 82-10-2793-5301
E-mail: [email protected], [email protected]
Skype, Google Hangout: [email protected]
<http://www.drjung.net>