summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/ltp')
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch32
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch9
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-cve-2015-3290-Disable-AVX-for-x86_64.patch42
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-kernel-kvm-don-t-hardcode-objcopy.patch69
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-scenario_groups-default-remove-connectors.patch34
-rw-r--r--meta/recipes-extended/ltp/ltp_20250130.bb (renamed from meta/recipes-extended/ltp/ltp_20240129.bb)25
6 files changed, 160 insertions, 51 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch b/meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch
new file mode 100644
index 0000000000..ade6a52b63
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch
@@ -0,0 +1,32 @@
1From 2d384f268791ecd5ff0f26c8137dd4de0a1c4566 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 10 Jun 2024 22:52:56 -0700
4Subject: [PATCH] Add __clear_cache declaration for clang
5
6__clear_cache was enabled on RISCV recently with 7352ba02390116f1cd6a9b583860ba28aa0a1b7a
7however it fails to compile with clang19 on RISCV
8With this error
9
10 hugemmap15.c:51:2: error: call to undeclared function '__clear_cache'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
11 51 | __clear_cache(p, p + COPY_SIZE);
12 | ^
13
14Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2024-June/038762.html]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16Cc: Hui Min Mina Chou <minachou@andestech.com>
17---
18 testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c | 1 +
19 1 file changed, 1 insertion(+)
20
21diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c
22index a84ba6476..856e22ff3 100644
23--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c
24+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c
25@@ -21,6 +21,7 @@
26
27 #if defined(__clang__)
28 #pragma clang optimize off
29+ void __clear_cache(void *start, void *end);
30 #endif
31
32 #define _GNU_SOURCE
diff --git a/meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch b/meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch
index cc98079651..5b6c780bec 100644
--- a/meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch
+++ b/meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch
@@ -1,4 +1,4 @@
1From e87c2ad1e16cdbd62ba71b2ace3270503decaa56 Mon Sep 17 00:00:00 2001 1From 768159aa53257d247645a12518778f50b8fdf578 Mon Sep 17 00:00:00 2001
2From: "Mingde (Matthew) Zeng" <matthewzmd@gmail.com> 2From: "Mingde (Matthew) Zeng" <matthewzmd@gmail.com>
3Date: Wed, 29 Jul 2020 08:47:09 -0400 3Date: Wed, 29 Jul 2020 08:47:09 -0400
4Subject: [PATCH] Remove OOM tests from runtest/mm 4Subject: [PATCH] Remove OOM tests from runtest/mm
@@ -14,10 +14,10 @@ Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
14 1 file changed, 6 deletions(-) 14 1 file changed, 6 deletions(-)
15 15
16diff --git a/runtest/mm b/runtest/mm 16diff --git a/runtest/mm b/runtest/mm
17index d859b331c..3c2962f44 100644 17index 6a8cd0b9d..8ce3f4416 100644
18--- a/runtest/mm 18--- a/runtest/mm
19+++ b/runtest/mm 19+++ b/runtest/mm
20@@ -74,12 +74,6 @@ ksm07 ksm07 20@@ -76,12 +76,6 @@ ksm07 ksm07
21 21
22 cpuset01 cpuset01 22 cpuset01 cpuset01
23 23
@@ -30,6 +30,3 @@ index d859b331c..3c2962f44 100644
30 swapping01 swapping01 -i 5 30 swapping01 swapping01 -i 5
31 31
32 thp01 thp01 -I 120 32 thp01 thp01 -I 120
33--
342.43.0
35
diff --git a/meta/recipes-extended/ltp/ltp/0001-cve-2015-3290-Disable-AVX-for-x86_64.patch b/meta/recipes-extended/ltp/ltp/0001-cve-2015-3290-Disable-AVX-for-x86_64.patch
new file mode 100644
index 0000000000..c6fae88eb9
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-cve-2015-3290-Disable-AVX-for-x86_64.patch
@@ -0,0 +1,42 @@
1From 28d823a63ee29f5d72c2aba781a06a7e2651cadc Mon Sep 17 00:00:00 2001
2From: Siddhesh Poyarekar <siddhesh@gotplt.org>
3Date: Mon, 7 Apr 2025 06:24:47 -0400
4Subject: [PATCH] cve-2015-3290: Disable AVX for x86_64
5
6When the input compiler enables AVX, stack realignment requirements
7causes gcc to fail to omit %rbp use, due to which the test fails to
8clobber %rbp in inline asm. Disable AVX to build the test on x86_64 so
9that the test continues working.
10
11Link: https://lore.kernel.org/ltp/20250407102448.2605506-2-siddhesh@gotplt.org/
12
13Upstream-Status: Backport [https://github.com/linux-test-project/ltp/commit/28d823a63ee29f5d72c2aba781a06a7e2651cadc]
14
15Reviewed-by: Martin Doucha <mdoucha@suse.cz>
16Reviewed-by: Petr Vorel <pvorel@suse.cz>
17Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
18
19---
20 testcases/cve/Makefile | 6 ++++++
21 1 file changed, 6 insertions(+)
22
23diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
24index 01b9b9ccb..98c38e908 100644
25--- a/testcases/cve/Makefile
26+++ b/testcases/cve/Makefile
27@@ -22,6 +22,12 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
28 meltdown: CFLAGS += -msse2
29 endif
30
31+# The test needs to clobber %rbp, which requires frame pointer omission. Also
32+# for x86_64, disable AVX since that could sometimes require a stack
33+# realignment, which gets in the way of frame pointer omission.
34 cve-2015-3290: CFLAGS += -pthread -fomit-frame-pointer
35+ifeq ($(HOST_CPU),x86_64)
36+cve-2015-3290: CFLAGS += -mno-avx
37+endif
38
39 include $(top_srcdir)/include/mk/generic_leaf_target.mk
40--
412.37.3
42
diff --git a/meta/recipes-extended/ltp/ltp/0001-kernel-kvm-don-t-hardcode-objcopy.patch b/meta/recipes-extended/ltp/ltp/0001-kernel-kvm-don-t-hardcode-objcopy.patch
new file mode 100644
index 0000000000..256c8eaa34
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-kernel-kvm-don-t-hardcode-objcopy.patch
@@ -0,0 +1,69 @@
1From 0a42a8ee0ae8c6f1e603c1836b7c9c7fab0ca3a8 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Thu, 27 Feb 2025 12:38:50 +0000
4Subject: [PATCH] kernel/kvm: don't hardcode objcopy
5
6testcases/kernel/kvm uses objcopy to contruct a payload binary, but in
7cross builds the host objcopy may not know how to handle target
8binaries:
9
10 CC testcases/kernel/kvm/lib_host.o
11 objcopy: Unable to recognise the format of the input file `kvm_svm03-payload.elf'
12 make[3]: *** [ltp/testcases/kernel/kvm/Makefile:67: kvm_svm03-payload.o] Error 1
13
14This is trivially fixed by searching for an objcopy tool (so
15host-prefixed in cross builds) and using that instead.
16
17Upstream-Status: Backport [a3942c0a5f9b4463e8320e80cd8522a2e008bfd2]
18Signed-off-by: Ross Burton <ross.burton@arm.com>
19---
20 configure.ac | 1 +
21 include/mk/config.mk.in | 1 +
22 testcases/kernel/kvm/Makefile | 4 ++--
23 3 files changed, 4 insertions(+), 2 deletions(-)
24
25diff --git a/configure.ac b/configure.ac
26index 344b2ae2c..0f2b6f332 100644
27--- a/configure.ac
28+++ b/configure.ac
29@@ -30,6 +30,7 @@ AC_PROG_RANLIB
30 AC_DEFUN([AC_PROG_STRIP], [AC_CHECK_TOOL(STRIP, strip, :)])
31 AC_PROG_STRIP
32 AC_PROG_YACC
33+AC_CHECK_TOOL([OBJCOPY], [objcopy], [:])
34
35 m4_ifndef([PKG_CHECK_EXISTS],
36 [m4_fatal([must install pkg-config or pkgconfig and pkg.m4 macro (usual dependency), see INSTALL])])
37diff --git a/include/mk/config.mk.in b/include/mk/config.mk.in
38index 2b7c8a071..4c3da304f 100644
39--- a/include/mk/config.mk.in
40+++ b/include/mk/config.mk.in
41@@ -11,6 +11,7 @@ AR := @AR@
42 CC := @CC@
43 LEX := @LEX@
44 RANLIB := @RANLIB@
45+OBJCOPY := @OBJCOPY@
46 STRIP := @STRIP@
47 YACC := @YACC@
48
49diff --git a/testcases/kernel/kvm/Makefile b/testcases/kernel/kvm/Makefile
50index 07bdd9705..e93528a33 100644
51--- a/testcases/kernel/kvm/Makefile
52+++ b/testcases/kernel/kvm/Makefile
53@@ -60,11 +60,11 @@ include $(top_srcdir)/include/mk/generic_leaf_target.mk
54 %-payload.o: %.c lib_guest.o $(ARCH_OBJ)
55 ifdef VERBOSE
56 $(CC) $(GUEST_CPPFLAGS) $(GUEST_CFLAGS) $(GUEST_LDFLAGS) -o $*-payload.elf $^ $(GUEST_LDLIBS)
57- objcopy -O binary -j .init.boot -j .text -j .data -j .init -j .preinit_array -j .init_array --gap-fill=0 $*-payload.elf $*-payload.bin
58+ $(OBJCOPY) -O binary -j .init.boot -j .text -j .data -j .init -j .preinit_array -j .init_array --gap-fill=0 $*-payload.elf $*-payload.bin
59 $(KVM_LD) -z noexecstack -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin
60 else
61 @$(CC) $(GUEST_CPPFLAGS) $(GUEST_CFLAGS) $(GUEST_LDFLAGS) -o $*-payload.elf $^ $(GUEST_LDLIBS)
62- @objcopy -O binary -j .init.boot -j .text -j .data -j .init -j .preinit_array -j .init_array --gap-fill=0 $*-payload.elf $*-payload.bin
63+ @$(OBJCOPY) -O binary -j .init.boot -j .text -j .data -j .init -j .preinit_array -j .init_array --gap-fill=0 $*-payload.elf $*-payload.bin
64 @$(KVM_LD) -z noexecstack -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin
65 @echo KVM_CC $(target_rel_dir)$@
66 endif
67--
682.43.0
69
diff --git a/meta/recipes-extended/ltp/ltp/0001-scenario_groups-default-remove-connectors.patch b/meta/recipes-extended/ltp/ltp/0001-scenario_groups-default-remove-connectors.patch
deleted file mode 100644
index 4a50d1ae38..0000000000
--- a/meta/recipes-extended/ltp/ltp/0001-scenario_groups-default-remove-connectors.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 14c710cae38aa96bd8d681e891b6a1d691f99988 Mon Sep 17 00:00:00 2001
2From: Xiangyu Chen <xiangyu.chen@windriver.com>
3Date: Thu, 14 Mar 2024 09:47:10 +0800
4Subject: [PATCH] scenario_groups/default: remove connectors
5
6runtest/connectors was removed in 9b642d89c, thus update scenario_groups/default.
7
8Fixes: 9b642d89c ("runtest: Merge runtest/connectors to kernel_misc")
9Closes: https://github.com/linux-test-project/ltp/pull/1144
10
11Upstream-Status: Backport from
12[https://github.com/linux-test-project/ltp/commit/14c710ca]
13
14Reviewed-by: Petr Vorel <pvorel@suse.cz>
15Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
16---
17 scenario_groups/default | 1 -
18 1 file changed, 1 deletion(-)
19
20diff --git a/scenario_groups/default b/scenario_groups/default
21index f17b2061a..ec77d8fb8 100644
22--- a/scenario_groups/default
23+++ b/scenario_groups/default
24@@ -16,7 +16,6 @@ controllers
25 filecaps
26 cap_bounds
27 fcntl-locktests
28-connectors
29 power_management_tests
30 hugetlb
31 commands
32--
332.34.1
34
diff --git a/meta/recipes-extended/ltp/ltp_20240129.bb b/meta/recipes-extended/ltp/ltp_20250130.bb
index 3e896957d1..fc643c2ab9 100644
--- a/meta/recipes-extended/ltp/ltp_20240129.bb
+++ b/meta/recipes-extended/ltp/ltp_20250130.bb
@@ -24,30 +24,29 @@ TUNE_CCARGS:remove:x86-64 = "-mfpmath=sse"
24 24
25CFLAGS:append:powerpc64 = " -D__SANE_USERSPACE_TYPES__" 25CFLAGS:append:powerpc64 = " -D__SANE_USERSPACE_TYPES__"
26CFLAGS:append:mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" 26CFLAGS:append:mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
27SRCREV = "68737d20556d37364c95776044b1119c0912a36a" 27SRCREV = "a7c31dff7edc089a32e990765e12952cc4d7666a"
28 28
29SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=https \ 29SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=https \
30 file://0001-Remove-OOM-tests-from-runtest-mm.patch \ 30 file://0001-Remove-OOM-tests-from-runtest-mm.patch \
31 file://0001-scenario_groups-default-remove-connectors.patch \ 31 file://0001-Add-__clear_cache-declaration-for-clang.patch \
32 file://0001-kernel-kvm-don-t-hardcode-objcopy.patch \
33 file://0001-cve-2015-3290-Disable-AVX-for-x86_64.patch \
32 " 34 "
33 35
34S = "${WORKDIR}/git"
35
36inherit autotools-brokensep pkgconfig 36inherit autotools-brokensep pkgconfig
37 37
38# Version 20220527 added KVM test infrastructure which currently fails to build with gold due to 38# Version 20220527 added KVM test infrastructure which currently fails to build with lld due to
39# SORT_NONE in linker script which isn't supported by gold: 39# SORT_NONE in linker script which isn't supported by gold:
40# https://sourceware.org/bugzilla/show_bug.cgi?id=18097 40# https://sourceware.org/bugzilla/show_bug.cgi?id=18097
41# https://github.com/linux-test-project/ltp/commit/3fce2064b54843218d085aae326c8f7ecf3a8c41#diff-39268f0855c634ca48c8993fcd2c95b12a65b79e8d9fa5ccd6b0f5a8785c0dd6R36 41# https://github.com/linux-test-project/ltp/commit/3fce2064b54843218d085aae326c8f7ecf3a8c41#diff-39268f0855c634ca48c8993fcd2c95b12a65b79e8d9fa5ccd6b0f5a8785c0dd6R36
42LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd', '', d)}" 42LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-fuse-ld=bfd', '', d)}"
43LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}"
44 43
45# After 0002-kvm-use-LD-instead-of-hardcoding-ld.patch 44# After 0002-kvm-use-LD-instead-of-hardcoding-ld.patch
46# https://github.com/linux-test-project/ltp/commit/f94e0ef3b7280f886384703ef9019aaf2f2dfebb 45# https://github.com/linux-test-project/ltp/commit/f94e0ef3b7280f886384703ef9019aaf2f2dfebb
47# it fails with gold also a bit later when trying to use *-payload.bin 46# it fails with lld also a bit later when trying to use *-payload.bin
48# http://errors.yoctoproject.org/Errors/Details/663094/ 47# http://errors.yoctoproject.org/Errors/Details/663094/
49# work around this by forcing .bfd linked in LD when ld-is-gold is in DISTRO_FEATURES 48# work around this by forcing .bfd linked in LD when ld-is-lld is in DISTRO_FEATURES
50KVM_LD = "${@bb.utils.contains_any('DISTRO_FEATURES', 'ld-is-gold ld-is-lld', '${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', '${LD}', d)}" 49KVM_LD = "${@bb.utils.contains_any('DISTRO_FEATURES', 'ld-is-lld', '${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', '${LD}', d)}"
51 50
52TARGET_CC_ARCH += "${LDFLAGS}" 51TARGET_CC_ARCH += "${LDFLAGS}"
53 52
@@ -98,6 +97,7 @@ RDEPENDS:${PN} = "\
98 gdb \ 97 gdb \
99 gzip \ 98 gzip \
100 iproute2 \ 99 iproute2 \
100 ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'iputils-ping6', '', d)} \
101 ldd \ 101 ldd \
102 libaio \ 102 libaio \
103 logrotate \ 103 logrotate \
@@ -120,6 +120,8 @@ FILES:${PN} += "${prefix}/* ${prefix}/runtest/* ${prefix}/scenario_groups/* ${pr
120INHIBIT_PACKAGE_STRIP_FILES = "${prefix}/testcases/bin/nm01 ${prefix}/testcases/bin/ldd01" 120INHIBIT_PACKAGE_STRIP_FILES = "${prefix}/testcases/bin/nm01 ${prefix}/testcases/bin/ldd01"
121INSANE_SKIP:${PN} += "already-stripped staticdev" 121INSANE_SKIP:${PN} += "already-stripped staticdev"
122 122
123CACHED_CONFIGUREVARS:libc-musl = "ac_cv_type_struct_mnt_id_req=no ac_cv_type_struct_statmount=no"
124
123remove_broken_musl_sources() { 125remove_broken_musl_sources() {
124 [ "${TCLIBC}" = "musl" ] || return 0 126 [ "${TCLIBC}" = "musl" ] || return 0
125 127
@@ -133,7 +135,8 @@ remove_broken_musl_sources() {
133 testcases/kernel/syscalls/getcontext/getcontext01.c \ 135 testcases/kernel/syscalls/getcontext/getcontext01.c \
134 testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c \ 136 testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c \
135 testcases/kernel/syscalls/timer_create/timer_create01.c \ 137 testcases/kernel/syscalls/timer_create/timer_create01.c \
136 testcases/kernel/syscalls/timer_create/timer_create03.c 138 testcases/kernel/syscalls/timer_create/timer_create03.c \
139 testcases/kernel/syscalls/statmount/statmount02.c
137} 140}
138do_patch[postfuncs] += "remove_broken_musl_sources" 141do_patch[postfuncs] += "remove_broken_musl_sources"
139 142