diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-02-28 21:30:05 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-03-01 21:29:31 +0000 |
commit | 43a4d45f5145a5b174f5bfa5f2eb9988559d785f (patch) | |
tree | 7a2842911a1aeda2bdeb0f1b1121a07a561c2ac5 /meta/classes-recipe/kernel-yocto.bbclass | |
parent | 6a025980f450004821e8b5a9e78dc20d8d8dd970 (diff) | |
download | poky-43a4d45f5145a5b174f5bfa5f2eb9988559d785f.tar.gz |
kernel: Add kernel specific OBJDUMP
This helps in switching toolchains cleanly for kernel build
between gcc and clang
Currently, some kernels allow building with clang but not all
the distro might use clang as default system compiler but kernel
may demand gcc which is provided via KERNEL_* variables, however
kernel does use OBJCOPY at places during build and it maybe set
to use llvm objcopy when using clang. That should be a deliberate
setting when clang is used for kernel as well, otherwise it should
use binutils provided objcopy
(From OE-Core rev: 17b409f2fd97894e0943d13c2cb0d52abde647e3)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/kernel-yocto.bbclass')
-rw-r--r-- | meta/classes-recipe/kernel-yocto.bbclass | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass index 7de99cff56..108b7e6752 100644 --- a/meta/classes-recipe/kernel-yocto.bbclass +++ b/meta/classes-recipe/kernel-yocto.bbclass | |||
@@ -455,7 +455,7 @@ do_kernel_configme() { | |||
455 | bbfatal_log "Could not find configuration queue (${meta_dir}/config.queue)" | 455 | bbfatal_log "Could not find configuration queue (${meta_dir}/config.queue)" |
456 | fi | 456 | fi |
457 | 457 | ||
458 | CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" CC="${KERNEL_CC}" LD="${KERNEL_LD}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1 | 458 | CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1 |
459 | if [ $? -ne 0 -o ! -f ${B}/.config ]; then | 459 | if [ $? -ne 0 -o ! -f ${B}/.config ]; then |
460 | bberror "Could not generate a .config for ${KMACHINE}-${LINUX_KERNEL_TYPE}" | 460 | bberror "Could not generate a .config for ${KMACHINE}-${LINUX_KERNEL_TYPE}" |
461 | if [ ${KCONF_AUDIT_LEVEL} -gt 1 ]; then | 461 | if [ ${KCONF_AUDIT_LEVEL} -gt 1 ]; then |
@@ -489,6 +489,7 @@ python do_config_analysis() { | |||
489 | env['PATH'] = "%s:%s%s" % (d.getVar('PATH'), s, "/scripts/util/") | 489 | env['PATH'] = "%s:%s%s" % (d.getVar('PATH'), s, "/scripts/util/") |
490 | env['LD'] = d.getVar('KERNEL_LD') | 490 | env['LD'] = d.getVar('KERNEL_LD') |
491 | env['CC'] = d.getVar('KERNEL_CC') | 491 | env['CC'] = d.getVar('KERNEL_CC') |
492 | env['OBJCOPY'] = d.getVar('KERNEL_OBJCOPY') | ||
492 | env['ARCH'] = d.getVar('ARCH') | 493 | env['ARCH'] = d.getVar('ARCH') |
493 | env['srctree'] = s | 494 | env['srctree'] = s |
494 | 495 | ||
@@ -550,6 +551,7 @@ python do_kernel_configcheck() { | |||
550 | env['PATH'] = "%s:%s%s" % (d.getVar('PATH'), s, "/scripts/util/") | 551 | env['PATH'] = "%s:%s%s" % (d.getVar('PATH'), s, "/scripts/util/") |
551 | env['LD'] = d.getVar('KERNEL_LD') | 552 | env['LD'] = d.getVar('KERNEL_LD') |
552 | env['CC'] = d.getVar('KERNEL_CC') | 553 | env['CC'] = d.getVar('KERNEL_CC') |
554 | env['OBJCOPY'] = d.getVar('KERNEL_OBJCOPY') | ||
553 | env['ARCH'] = d.getVar('ARCH') | 555 | env['ARCH'] = d.getVar('ARCH') |
554 | env['srctree'] = s | 556 | env['srctree'] = s |
555 | 557 | ||