aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-10-10 11:12:08 -0700
committerKhem Raj <raj.khem@gmail.com>2023-10-10 11:52:58 -0700
commit6e0da8642ac8e6d277ee82ab91ce1248663fc58d (patch)
treefacf20a0dbcc49ba85d69265cbdf3da6880b172c /meta-oe/recipes-kernel
parente65836d919e32e471192c47d39150298e97e141b (diff)
downloadmeta-openembedded-6e0da8642ac8e6d277ee82ab91ce1248663fc58d.tar.gz
kernel-selftest: Use clang options when clang is available
Enable bpf only with clang Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel')
-rw-r--r--meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb16
1 files changed, 8 insertions, 8 deletions
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
index 2e5680d775..291a83aaad 100644
--- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
+++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
@@ -18,7 +18,9 @@ SRC_URI += "file://run-ptest \
# we will append other kernel selftest in the future
# bpf was added in 4.10 with: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d
# if you have older kernel than that you need to remove it from PACKAGECONFIG
-PACKAGECONFIG ??= "firmware bpf"
+PACKAGECONFIG ??= "firmware"
+# bpf needs working clang compiler anyway
+PACKAGECONFIG:append:toolchain-clang:x86-64 = " bpf"
PACKAGECONFIG:remove:x86 = "bpf"
PACKAGECONFIG:remove:arm = "bpf vm"
# host ptrace.h is used to compile BPF target but mips ptrace.h is needed
@@ -54,17 +56,15 @@ EXTRA_OEMAKE = '\
CC="${CC}" \
AR="${AR}" \
LD="${LD}" \
- LLVM=1 \
- CONFIG_CC_IS_GCC= \
- CONFIG_CC_IS_CLANG=y \
- CONFIG_CC_IMPLICIT_FALLTHROUGH= \
CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \
- HOSTCC="clang -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ ${BUILD_CFLAGS} ${BUILD_LDFLAGS} -Wno-error=unused-command-line-argument" \
- HOSTLD="clang ${BUILD_LDFLAGS} -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" \
DESTDIR="${D}" \
- MACHINE="${ARCH}" \
V=1 \
'
+EXTRA_OEMAKE:append:toolchain-clang = "\
+ LLVM=1 CONFIG_CC_IS_GCC= CONFIG_CC_IS_CLANG=y CONFIG_CC_IMPLICIT_FALLTHROUGH= \
+ HOSTCC="clang -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ ${BUILD_CFLAGS} ${BUILD_LDFLAGS} -Wno-error=unused-command-line-argument" \
+ HOSTLD="clang ${BUILD_LDFLAGS} -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" \
+"
KERNEL_SELFTEST_SRC ?= "Makefile \
include \