diff options
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest')
-rw-r--r-- | external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb index 181e97ca..3687c267 100644 --- a/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb @@ -18,11 +18,16 @@ 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 ??= "bpf vm" +PACKAGECONFIG ??= "bpf firmware vm" PACKAGECONFIG_remove_x86 = "bpf" PACKAGECONFIG_remove_arm = "bpf" +# host ptrace.h is used to compile BPF target but mips ptrace.h is needed +# progs/loop1.c:21:9: error: incomplete definition of type 'struct user_pt_regs' +# m = PT_REGS_RC(ctx); +PACKAGECONFIG_remove_qemumips = "bpf" PACKAGECONFIG[bpf] = ",,elfutils libcap libcap-ng rsync-native," +PACKAGECONFIG[firmware] = ",,libcap, bash" PACKAGECONFIG[vm] = ",,libcap,libgcc bash" do_patch[depends] += "virtual/kernel:do_shared_workdir" @@ -32,13 +37,15 @@ inherit linux-kernel-base kernel-arch ptest S = "${WORKDIR}/${BP}" TEST_LIST = "\ - ${@bb.utils.filter('PACKAGECONFIG', 'bpf vm', d)} \ + ${@bb.utils.filter('PACKAGECONFIG', 'bpf firmware vm', d)} \ + rtc \ " EXTRA_OEMAKE = '\ CROSS_COMPILE=${TARGET_PREFIX} \ ARCH=${ARCH} \ CC="${CC}" \ + CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS}" \ AR="${AR}" \ LD="${LD}" \ DESTDIR="${D}" \ @@ -52,20 +59,14 @@ KERNEL_SELFTEST_SRC ?= "Makefile \ LICENSES \ " -python __anonymous () { - import re - - var = d.getVar('TARGET_CC_ARCH') - pattern = '_FORTIFY_SOURCE=[^0]' - - if re.search(pattern, var): - d.appendVar('TARGET_CC_ARCH', " -O") -} - do_compile() { - bbwarn "clang >= 6.0 with bpf support is needed with kernel 4.18+ so \ -either install it and add it to HOSTTOOLS, or add \ -clang-native from meta-clang to dependency" + if [ ${@bb.utils.contains('PACKAGECONFIG', 'bpf', 'True', 'False', d)} = 'True' ]; then + if [ ${@bb.utils.contains('DEPENDS', 'clang-native', 'True', 'False', d)} = 'False' ]; then + bbwarn "clang >= 6.0 with bpf support is needed with kernel 4.18+ so +either install it and add it to HOSTTOOLS, or add clang-native from meta-clang to dependency" + fi + fi + for i in ${TEST_LIST} do oe_runmake -C ${S}/tools/testing/selftests/${i} @@ -121,3 +122,11 @@ FILES_${PN} += "/usr/kernel-selftest" RDEPENDS_${PN} += "python3" # tools/testing/selftests/vm/Makefile doesn't respect LDFLAGS and tools/testing/selftests/Makefile explicitly overrides to empty INSANE_SKIP_${PN} += "ldflags" + +SECURITY_CFLAGS = "" +COMPATIBLE_HOST_libc-musl = 'null' + +# It has native clang/llvm dependency, poky distro is reluctant to include them as deps +# this helps with world builds on AB +EXCLUDE_FROM_WORLD = "1" + |