diff options
author | Khem Raj <raj.khem@gmail.com> | 2018-09-12 10:11:13 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-09-14 19:01:41 -0700 |
commit | 6e9c34d6a1285e487dcfeb804b1a4b4b853f0c63 (patch) | |
tree | 04fa49f26faf8a0cc4ec3115cf2de86808e82cfb /meta-oe/recipes-kernel/kernel-selftest | |
parent | e6d2fc45e500b18851562a1f31c0cfc41f42cad6 (diff) | |
download | meta-openembedded-6e9c34d6a1285e487dcfeb804b1a4b4b853f0c63.tar.gz |
kernel-selftest: Fix build on musl
* (Depends upon a linux-libc-headers patch proposed to oe-core)
* Delete unused patch
* Mark Clang 6.0 as minimum required version
* Do not hardcode python3 interpreter path
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Hongzhi.Song <hongzhi.song@windriver.com>
Cc: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel/kernel-selftest')
3 files changed, 5 insertions, 54 deletions
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb index 2a53419c2..78413280b 100644 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | |||
@@ -9,7 +9,6 @@ DEPENDS = "rsync-native" | |||
9 | # for musl libc | 9 | # for musl libc |
10 | SRC_URI_append_libc-musl = "\ | 10 | SRC_URI_append_libc-musl = "\ |
11 | file://userfaultfd.patch \ | 11 | file://userfaultfd.patch \ |
12 | file://0001-bpf-test_progs.c-add-support-for-musllibc.patch \ | ||
13 | " | 12 | " |
14 | SRC_URI += "file://run-ptest \ | 13 | SRC_URI += "file://run-ptest \ |
15 | file://COPYING \ | 14 | file://COPYING \ |
@@ -62,7 +61,7 @@ python __anonymous () { | |||
62 | } | 61 | } |
63 | 62 | ||
64 | do_compile() { | 63 | do_compile() { |
65 | bbwarn "clang with bpf support is needed with kernel 4.18+ so \ | 64 | bbwarn "clang >= 6.0 with bpf support is needed with kernel 4.18+ so \ |
66 | either install it and add it to HOSTTOOLS, or add \ | 65 | either install it and add it to HOSTTOOLS, or add \ |
67 | clang-native from meta-clang to dependency" | 66 | clang-native from meta-clang to dependency" |
68 | for i in ${TEST_LIST} | 67 | for i in ${TEST_LIST} |
@@ -76,7 +75,9 @@ do_install() { | |||
76 | do | 75 | do |
77 | oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/usr/kernel-selftest/${i} install | 76 | oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/usr/kernel-selftest/${i} install |
78 | done | 77 | done |
79 | 78 | if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then | |
79 | sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py | ||
80 | fi | ||
80 | chown root:root -R ${D}/usr/kernel-selftest | 81 | chown root:root -R ${D}/usr/kernel-selftest |
81 | } | 82 | } |
82 | 83 | ||
@@ -115,5 +116,6 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" | |||
115 | INHIBIT_PACKAGE_DEBUG_SPLIT="1" | 116 | INHIBIT_PACKAGE_DEBUG_SPLIT="1" |
116 | FILES_${PN} += "/usr/kernel-selftest" | 117 | FILES_${PN} += "/usr/kernel-selftest" |
117 | 118 | ||
119 | RDEPENDS_${PN} += "python3" | ||
118 | # tools/testing/selftests/vm/Makefile doesn't respect LDFLAGS and tools/testing/selftests/Makefile explicitly overrides to empty | 120 | # tools/testing/selftests/vm/Makefile doesn't respect LDFLAGS and tools/testing/selftests/Makefile explicitly overrides to empty |
119 | INSANE_SKIP_${PN} += "ldflags" | 121 | INSANE_SKIP_${PN} += "ldflags" |
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-bpf-test_progs.c-add-support-for-musllibc.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-bpf-test_progs.c-add-support-for-musllibc.patch deleted file mode 100644 index 5f2542681..000000000 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-bpf-test_progs.c-add-support-for-musllibc.patch +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | From a2e6b8fde28b743b69990a4e16c296e099631ed4 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Hongzhi.Song" <hongzhi.song@windriver.com> | ||
3 | Date: Mon, 23 Jul 2018 00:56:19 -0700 | ||
4 | Subject: [PATCH] bpf: test_progs.c add support for musllibc | ||
5 | |||
6 | Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
7 | --- | ||
8 | tools/testing/selftests/bpf/test_progs.c | 1 + | ||
9 | 1 file changed, 1 insertion(+) | ||
10 | |||
11 | diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c | ||
12 | index 11ee25c..21b27b7 100644 | ||
13 | --- a/tools/testing/selftests/bpf/test_progs.c | ||
14 | +++ b/tools/testing/selftests/bpf/test_progs.c | ||
15 | @@ -4,6 +4,7 @@ | ||
16 | * modify it under the terms of version 2 of the GNU General Public | ||
17 | * License as published by the Free Software Foundation. | ||
18 | */ | ||
19 | +#define __always_inline __inline __attribute__ ((__always_inline__)) | ||
20 | #include <stdio.h> | ||
21 | #include <unistd.h> | ||
22 | #include <errno.h> | ||
23 | -- | ||
24 | 2.11.0 | ||
25 | |||
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-swap.h-micro-define-to-support-musl-libc.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-swap.h-micro-define-to-support-musl-libc.patch deleted file mode 100644 index e2245fc4c..000000000 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-swap.h-micro-define-to-support-musl-libc.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | From c21dfb0dfdfec281479e267ad7fe9a8d4ba15a70 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Hongzhi.Song" <hongzhi.song@windriver.com> | ||
3 | Date: Tue, 17 Jul 2018 23:47:48 -0700 | ||
4 | Subject: [PATCH] add micro define to support musl libc | ||
5 | |||
6 | Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
7 | --- | ||
8 | recipe-sysroot/usr/include/linux/swab.h | 2 ++ | ||
9 | 1 file changed, 2 insertions(+) | ||
10 | |||
11 | diff --git a/recipe-sysroot/usr/include/linux/swab.h b/recipe-sysroot/usr/include/linux/swab.h | ||
12 | index afb7eb7..33efa10 100644 | ||
13 | --- a/recipe-sysroot/usr/include/linux/swab.h | ||
14 | +++ b/recipe-sysroot/usr/include/linux/swab.h | ||
15 | @@ -6,6 +6,8 @@ | ||
16 | |||
17 | #include <asm/swab.h> | ||
18 | |||
19 | +#define __always_inline __inline __attribute__ ((__always_inline__)) | ||
20 | + | ||
21 | /* | ||
22 | * casts are necessary for constants, because we never know how for sure | ||
23 | * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way. | ||
24 | -- | ||
25 | 2.11.0 | ||
26 | |||