diff options
| author | Khem Raj <raj.khem@gmail.com> | 2023-10-10 11:12:08 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-10-10 11:52:58 -0700 |
| commit | 6e0da8642ac8e6d277ee82ab91ce1248663fc58d (patch) | |
| tree | facf20a0dbcc49ba85d69265cbdf3da6880b172c | |
| parent | e65836d919e32e471192c47d39150298e97e141b (diff) | |
| download | meta-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>
| -rw-r--r-- | meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | 16 |
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 \ | |||
| 18 | # we will append other kernel selftest in the future | 18 | # we will append other kernel selftest in the future |
| 19 | # bpf was added in 4.10 with: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d | 19 | # bpf was added in 4.10 with: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d |
| 20 | # if you have older kernel than that you need to remove it from PACKAGECONFIG | 20 | # if you have older kernel than that you need to remove it from PACKAGECONFIG |
| 21 | PACKAGECONFIG ??= "firmware bpf" | 21 | PACKAGECONFIG ??= "firmware" |
| 22 | # bpf needs working clang compiler anyway | ||
| 23 | PACKAGECONFIG:append:toolchain-clang:x86-64 = " bpf" | ||
| 22 | PACKAGECONFIG:remove:x86 = "bpf" | 24 | PACKAGECONFIG:remove:x86 = "bpf" |
| 23 | PACKAGECONFIG:remove:arm = "bpf vm" | 25 | PACKAGECONFIG:remove:arm = "bpf vm" |
| 24 | # host ptrace.h is used to compile BPF target but mips ptrace.h is needed | 26 | # host ptrace.h is used to compile BPF target but mips ptrace.h is needed |
| @@ -54,17 +56,15 @@ EXTRA_OEMAKE = '\ | |||
| 54 | CC="${CC}" \ | 56 | CC="${CC}" \ |
| 55 | AR="${AR}" \ | 57 | AR="${AR}" \ |
| 56 | LD="${LD}" \ | 58 | LD="${LD}" \ |
| 57 | LLVM=1 \ | ||
| 58 | CONFIG_CC_IS_GCC= \ | ||
| 59 | CONFIG_CC_IS_CLANG=y \ | ||
| 60 | CONFIG_CC_IMPLICIT_FALLTHROUGH= \ | ||
| 61 | CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \ | 59 | CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \ |
| 62 | HOSTCC="clang -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ ${BUILD_CFLAGS} ${BUILD_LDFLAGS} -Wno-error=unused-command-line-argument" \ | ||
| 63 | HOSTLD="clang ${BUILD_LDFLAGS} -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" \ | ||
| 64 | DESTDIR="${D}" \ | 60 | DESTDIR="${D}" \ |
| 65 | MACHINE="${ARCH}" \ | ||
| 66 | V=1 \ | 61 | V=1 \ |
| 67 | ' | 62 | ' |
| 63 | EXTRA_OEMAKE:append:toolchain-clang = "\ | ||
| 64 | LLVM=1 CONFIG_CC_IS_GCC= CONFIG_CC_IS_CLANG=y CONFIG_CC_IMPLICIT_FALLTHROUGH= \ | ||
| 65 | HOSTCC="clang -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ ${BUILD_CFLAGS} ${BUILD_LDFLAGS} -Wno-error=unused-command-line-argument" \ | ||
| 66 | HOSTLD="clang ${BUILD_LDFLAGS} -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" \ | ||
| 67 | " | ||
| 68 | 68 | ||
| 69 | KERNEL_SELFTEST_SRC ?= "Makefile \ | 69 | KERNEL_SELFTEST_SRC ?= "Makefile \ |
| 70 | include \ | 70 | include \ |
