From: Harish Sadineni <[email protected]> When building with `TOOLCHAIN = "clang"`, the kernel's configuration check (do_kernel_configcheck) fails with:
kconfiglib.KconfigError: scripts/Kconfig.include:51: Sorry, this assembler is not supported. Fix by setting `CLANG_FLAGS = "-fintegrated-as"` in the environment when `TOOLCHAIN` contains "clang". This variable is used by the kernel build system (via scripts/Kconfig.include) to pass additional flags to clang during config checks, ensuring the assembler test passes. Acked-by: Bruce Ashfield <[email protected]> Signed-off-by: Harish Sadineni <[email protected]> --- meta/classes-recipe/kernel-arch.bbclass | 2 ++ meta/classes-recipe/kernel-yocto.bbclass | 3 +++ 2 files changed, 5 insertions(+) diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index 6ebc0f13ea..c0ff60c0de 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -93,3 +93,5 @@ 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" TOOLCHAIN = "gcc" +TOOLCHAIN:riscv64 = "${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'clang', 'gcc', d)}" + diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass index e7fdeb5d4b..78a4a7ade7 100644 --- a/meta/classes-recipe/kernel-yocto.bbclass +++ b/meta/classes-recipe/kernel-yocto.bbclass @@ -603,6 +603,9 @@ python do_kernel_configcheck() { env['STRIP'] = d.getVar('KERNEL_STRIP') env['ARCH'] = d.getVar('ARCH') env['srctree'] = s + toolchain = d.getVar('TOOLCHAIN') or '' + if 'clang' in toolchain: + env['CLANG_FLAGS'] = " -fintegrated-as" try: configs = subprocess.check_output(['scc', '--configs', '-o', s + '/.kernel-meta'], env=env).decode('utf-8') -- 2.49.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#240495): https://lists.openembedded.org/g/openembedded-core/message/240495 Mute This Topic: https://lists.openembedded.org/mt/120174996/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
