diff options
Diffstat (limited to 'meta/recipes-extended/ltp')
30 files changed, 213 insertions, 1687 deletions
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 new file mode 100644 index 0000000000..cc98079651 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch @@ -0,0 +1,35 @@ +From e87c2ad1e16cdbd62ba71b2ace3270503decaa56 Mon Sep 17 00:00:00 2001 +From: "Mingde (Matthew) Zeng" <matthewzmd@gmail.com> +Date: Wed, 29 Jul 2020 08:47:09 -0400 +Subject: [PATCH] Remove OOM tests from runtest/mm + +Disable OOM tests, as they might cause oeqa ssh connection lost + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Mingde (Matthew) Zeng <matthew.zeng@windriver.com> +[ pvorel: rebased for 20210927 ] +Signed-off-by: Petr Vorel <petr.vorel@gmail.com> +--- + runtest/mm | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/runtest/mm b/runtest/mm +index d859b331c..3c2962f44 100644 +--- a/runtest/mm ++++ b/runtest/mm +@@ -74,12 +74,6 @@ ksm07 ksm07 + + cpuset01 cpuset01 + +-oom01 oom01 +-oom02 oom02 +-oom03 oom03 +-oom04 oom04 +-oom05 oom05 +- + swapping01 swapping01 -i 5 + + thp01 thp01 -I 120 +-- +2.43.0 + diff --git a/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch b/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch deleted file mode 100644 index 7ec66f8147..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ae10245c15a617bd57337981bb42eb36629f9b59 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 8 Feb 2017 15:53:31 +0800 -Subject: [PATCH 01/26] add _GNU_SOURCE to pec_listener.c - -In previous patch 0007-replace-SIGCLD-with-SIGCHLD.patch made by Khem Raj -contains two aspects: - - 1. replace SIGCLD with SIGCHLD - 2. add _GNU_SOURCE to pec_listener.c - -The replace SIGCLD with SIGCHLD have been integrated upstream, so make a -another patch to add _GNU_SOURCE to pec_listener.c comply with Khem Raj's -previous patch. - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Signed-off-by: Dengke Du <dengke.du@windriver.com> -Upstream-Status: Pending - -%% original patch: 0001-add-_GNU_SOURCE-to-pec_listener.c.patch ---- - testcases/kernel/connectors/pec/pec_listener.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c -index d11e4dc..b8b5e0d 100644 ---- a/testcases/kernel/connectors/pec/pec_listener.c -+++ b/testcases/kernel/connectors/pec/pec_listener.c -@@ -20,6 +20,7 @@ - /* */ - /******************************************************************************/ - -+#define _GNU_SOURCE - #include <sys/socket.h> - #include <sys/poll.h> - #include <sys/types.h> --- -2.8.1 - 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 new file mode 100644 index 0000000000..4a50d1ae38 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-scenario_groups-default-remove-connectors.patch @@ -0,0 +1,34 @@ +From 14c710cae38aa96bd8d681e891b6a1d691f99988 Mon Sep 17 00:00:00 2001 +From: Xiangyu Chen <xiangyu.chen@windriver.com> +Date: Thu, 14 Mar 2024 09:47:10 +0800 +Subject: [PATCH] scenario_groups/default: remove connectors + +runtest/connectors was removed in 9b642d89c, thus update scenario_groups/default. + +Fixes: 9b642d89c ("runtest: Merge runtest/connectors to kernel_misc") +Closes: https://github.com/linux-test-project/ltp/pull/1144 + +Upstream-Status: Backport from +[https://github.com/linux-test-project/ltp/commit/14c710ca] + +Reviewed-by: Petr Vorel <pvorel@suse.cz> +Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> +--- + scenario_groups/default | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/scenario_groups/default b/scenario_groups/default +index f17b2061a..ec77d8fb8 100644 +--- a/scenario_groups/default ++++ b/scenario_groups/default +@@ -16,7 +16,6 @@ controllers + filecaps + cap_bounds + fcntl-locktests +-connectors + power_management_tests + hugetlb + commands +-- +2.34.1 + diff --git a/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch b/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch deleted file mode 100644 index 98650205d8..0000000000 --- a/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 867ad5d5d64b9b27ee32148027532db0a00f6433 Mon Sep 17 00:00:00 2001 -From: "Roy.Li" <rongqing.li@windriver.com> -Date: Thu, 7 Jan 2016 17:33:26 +0000 -Subject: [PATCH 02/32] Add knob to control whether numa support should be - checked - -otherwise undeterministic dependency will be generated -during build depending upong numa being staged or not - -Signed-off-by: Roy.Li <rongqing.li@windriver.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending ---- - m4/ltp-numa.m4 | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4 -index 60ae07b..ed7078d 100644 ---- a/m4/ltp-numa.m4 -+++ b/m4/ltp-numa.m4 -@@ -24,7 +24,13 @@ dnl ---------------------------- - dnl - AC_DEFUN([LTP_CHECK_SYSCALL_NUMA], - [dnl --AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[ -+AC_MSG_CHECKING([for numa]) -+AC_ARG_WITH( -+ [numa], -+ AC_HELP_STRING([--without-numa], -+ [without numa support]), -+ [], -+ [AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[ - LTP_SYSCALL_NUMA_HEADERS=yes - AC_CHECK_LIB(numa,numa_alloc_onnode,[have_numa_alloc_onnode="yes"]) - if test "x$have_numa_alloc_onnode" = "xyes"; then -@@ -48,3 +54,5 @@ if test "x$have_mpol_constants" = "xyes"; then - AC_DEFINE(HAVE_MPOL_CONSTANTS,1,[define to 1 if you have all constants required to use mbind tests]) - fi - )]) -+AC_MSG_RESULT([$with_numa]) -+]) --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch b/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch deleted file mode 100644 index 5cf1e05f79..0000000000 --- a/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch +++ /dev/null @@ -1,46 +0,0 @@ -From b193011da301b3d944e8fddcf4817513c31c5b88 Mon Sep 17 00:00:00 2001 -From: Fathi Boudra <fathi.boudra@linaro.org> -Date: Thu, 7 Jan 2016 17:36:19 +0000 -Subject: [PATCH 03/32] Add knob to control tirpc support - -allow to disable tirpc. Helps to disable it at top level for eg. musl it -does not yet work. - -Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending ---- - configure.ac | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/configure.ac b/configure.ac -index cc50397..9e2936b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -98,6 +98,13 @@ if test "x$with_python" = xyes; then - else - AC_SUBST([WITH_PYTHON],["no"]) - fi -+ -+# TI RPC -+AC_ARG_WITH([tirpc], -+ AC_HELP_STRING([--without-tirpc], -+ [without libtirpc support]), -+ [],[with_tirpc=yes], -+) - # END tools knobs - - # Testsuites knobs -@@ -169,7 +176,9 @@ LTP_CHECK_RENAMEAT2 - LTP_CHECK_FALLOCATE - LTP_CHECK_SYSCALL_FCNTL - LTP_CHECK_SYSCALL_PERF_EVENT_OPEN -+if test "x$with_tirpc" = xyes; then - LTP_CHECK_TIRPC -+fi - LTP_CHECK_TEE - LTP_CHECK_SPLICE - LTP_CHECK_VMSPLICE --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch deleted file mode 100644 index cf744639c2..0000000000 --- a/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch +++ /dev/null @@ -1,148 +0,0 @@ -From 53acddddf1b324e06af886ee4639b774e5c8c8bc Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 7 Jan 2016 18:19:03 +0000 -Subject: [PATCH 04/32] build: Add option to select libc implementation - -There are more than glibc for C library implementation available on -linux now a days, uclibc cloaked like glibc but musl e.g. is very -different and does not implement all GNU extentions - -Disable tests specifically not building _yet_ on musl based systems - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending ---- - Makefile | 5 +++++ - testcases/kernel/Makefile | 5 ++++- - testcases/kernel/sched/Makefile | 4 +++- - testcases/kernel/syscalls/Makefile | 5 +++++ - testcases/network/nfsv4/acl/Makefile | 4 ++++ - testcases/network/rpc/basic_tests/Makefile | 5 +++++ - testcases/realtime/func/pi-tests/Makefile | 4 ++++ - testcases/realtime/stress/pi-tests/Makefile | 5 +++++ - 8 files changed, 35 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 297f8e7..906b280 100644 ---- a/Makefile -+++ b/Makefile -@@ -49,6 +49,11 @@ SKIP_IDCHECK ?= 0 - UCLINUX ?= 0 - export UCLINUX - -+# System C library implementation (glibc,uclibc,musl etc.) -+# default to glibc if not set -+LIBC ?= glibc -+export LIBC -+ - # CLEAN_TARGETS: Targets which exist solely in clean. - # COMMON_TARGETS: Targets which exist in all, clean, and install. - # INSTALL_TARGETS: Targets which exist in clean and install (contains -diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile -index 50a12fa..4f1987f 100644 ---- a/testcases/kernel/Makefile -+++ b/testcases/kernel/Makefile -@@ -47,13 +47,16 @@ SUBDIRS += connectors \ - logging \ - mem \ - numa \ -- pty \ - sched \ - security \ - timers \ - tracing \ - module \ - -+ifneq ($(LIBC),musl) -+SUBDIRS += pty -+endif -+ - ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes) - SUBDIRS += power_management - endif -diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile -index 6245ed0..aa4eb7f 100644 ---- a/testcases/kernel/sched/Makefile -+++ b/testcases/kernel/sched/Makefile -@@ -23,5 +23,7 @@ - top_srcdir ?= ../../.. - - include $(top_srcdir)/include/mk/env_pre.mk -- -+ifeq ($(LIBC),musl) -+ FILTER_OUT_DIRS += process_stress -+endif - include $(top_srcdir)/include/mk/generic_trunk_target.mk -diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile -index 8acb395..b749126 100644 ---- a/testcases/kernel/syscalls/Makefile -+++ b/testcases/kernel/syscalls/Makefile -@@ -28,5 +28,10 @@ ifeq ($(UCLINUX),1) - FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \ - mincore mprotect nftw profil remap_file_pages sbrk - endif -+ifeq ($(LIBC),musl) -+FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \ -+ rt_sigsuspend setdomainname sethostname sigsuspend \ -+ ustat -+endif - - include $(top_srcdir)/include/mk/generic_trunk_target.mk -diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile -index 8bc78c2..c36cf50 100644 ---- a/testcases/network/nfsv4/acl/Makefile -+++ b/testcases/network/nfsv4/acl/Makefile -@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk - - LDLIBS += $(ACL_LIBS) - -+ifeq ($(LIBC),musl) -+FILTER_OUT_MAKE_TARGETS := acl1 -+endif -+ - include $(top_srcdir)/include/mk/generic_leaf_target.mk -diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile -index 3160813..9bdf5d0 100644 ---- a/testcases/network/rpc/basic_tests/Makefile -+++ b/testcases/network/rpc/basic_tests/Makefile -@@ -23,4 +23,9 @@ - top_srcdir ?= ../../../.. - - include $(top_srcdir)/include/mk/env_pre.mk -+ -+ifeq ($(LIBC),musl) -+FILTER_OUT_DIRS += rpc01 -+endif -+ - include $(top_srcdir)/include/mk/generic_trunk_target.mk -diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile -index 7a7a57a..5808866 100644 ---- a/testcases/realtime/func/pi-tests/Makefile -+++ b/testcases/realtime/func/pi-tests/Makefile -@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk - include $(abs_srcdir)/../../config.mk - - MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex -+ifeq ($(LIBC),musl) -+FILTER_OUT_MAKE_TARGETS := testpi-5 testpi-6 sbrk_mutex -+endif -+ - - include $(top_srcdir)/include/mk/generic_leaf_target.mk -diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile -index 5edc3b4..aa5987a 100644 ---- a/testcases/realtime/stress/pi-tests/Makefile -+++ b/testcases/realtime/stress/pi-tests/Makefile -@@ -24,4 +24,9 @@ top_srcdir ?= ../../../.. - - include $(top_srcdir)/include/mk/env_pre.mk - include $(abs_srcdir)/../../config.mk -+ -+ifeq ($(LIBC),musl) -+FILTER_OUT_MAKE_TARGETS := testpi-3 -+endif -+ - include $(top_srcdir)/include/mk/generic_leaf_target.mk --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch deleted file mode 100644 index b9390e2c8a..0000000000 --- a/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 6e3058521b50d91d4b0569c4d491c5af5ff798b2 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 7 Jan 2016 18:22:38 +0000 -Subject: [PATCH 05/32] kernel/controllers: Link with libfts explicitly on musl - -musl does not implement fts like glibc and therefore it depends on -external implementation for all fts APIs - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending ---- - testcases/kernel/controllers/Makefile.inc | 3 +++ - testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc -index b106283..ef5fc0c 100644 ---- a/testcases/kernel/controllers/Makefile.inc -+++ b/testcases/kernel/controllers/Makefile.inc -@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB) - CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR) - - LDFLAGS += -L$(abs_builddir)/../$(LIBDIR) -+ifeq ($(LIBC),musl) -+LDLIBS += -lfts -+endif - - INSTALL_TARGETS ?= *.sh - -diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc -index 9e002f4..e0fcb9c 100644 ---- a/testcases/kernel/controllers/cpuset/Makefile.inc -+++ b/testcases/kernel/controllers/cpuset/Makefile.inc -@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET) - LDFLAGS += -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR) - - LDLIBS += -lcpu_set -lcontrollers -lltp -+ifeq ($(LIBC),musl) -+LDLIBS += -lfts -+endif - - INSTALL_TARGETS ?= *.sh - --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch b/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch deleted file mode 100644 index 2f4ca63750..0000000000 --- a/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch +++ /dev/null @@ -1,31 +0,0 @@ -From d1a27570457fb6e1d6bafe81bfa0f3507b137e32 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Thu, 9 Feb 2017 18:20:58 +0800 -Subject: [PATCH] fix __WORDSIZE undeclared when building with musl - -fix __WORDSIZE undeclared when building with musl. - -Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177] - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - include/old/test.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/include/old/test.h b/include/old/test.h -index b36764d83..cc6f1b551 100644 ---- a/include/old/test.h -+++ b/include/old/test.h -@@ -44,6 +44,9 @@ - #include <string.h> - #include <stdlib.h> - #include <stdint.h> -+#ifndef __GLIBC__ -+#include <bits/reg.h> -+#endif - - #include "usctest.h" - --- -2.11.0 - diff --git a/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch deleted file mode 100644 index e325ce4e49..0000000000 --- a/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch +++ /dev/null @@ -1,283 +0,0 @@ -From a3cbee31daae2466bc8dcac36b33a01352693346 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 7 Jan 2016 19:40:08 +0000 -Subject: [PATCH 01/26] Check if __GLIBC_PREREQ is defined before using it - -__GLIBC_PREREQ is specific to glibc so it should be checked if it is -defined or not. - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++- - testcases/kernel/syscalls/getcpu/getcpu01.c | 40 +++++++++++++++++++++- - .../sched_getaffinity/sched_getaffinity01.c | 26 ++++++++++++++ - 3 files changed, 73 insertions(+), 2 deletions(-) - -diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c -index 6072bfa..2b090cb 100644 ---- a/testcases/kernel/syscalls/accept4/accept4_01.c -+++ b/testcases/kernel/syscalls/accept4/accept4_01.c -@@ -64,6 +64,7 @@ static void cleanup(void) - tst_rmdir(); - } - -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if !(__GLIBC_PREREQ(2, 10)) - static int - accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) -@@ -82,7 +83,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) - } - tst_resm(TINFO, "\n"); - #endif -- - #if USE_SOCKETCALL - long args[6]; - -@@ -97,6 +97,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) - #endif - } - #endif -+#endif - - static void - do_test(int lfd, struct sockaddr_in *conn_addr, -@@ -119,9 +120,15 @@ do_test(int lfd, struct sockaddr_in *conn_addr, - die("Connect Error"); - - addrlen = sizeof(struct sockaddr_in); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if !(__GLIBC_PREREQ(2, 10)) - acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen, - closeonexec_flag | nonblock_flag); -+ -+#else -+ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, -+ closeonexec_flag | nonblock_flag); -+#endif - #else - acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, - closeonexec_flag | nonblock_flag); -diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c -index c927512..921b107 100644 ---- a/testcases/kernel/syscalls/getcpu/getcpu01.c -+++ b/testcases/kernel/syscalls/getcpu/getcpu01.c -@@ -62,6 +62,7 @@ - #include <dirent.h> - - #if defined(__i386__) || defined(__x86_64__) -+#if defined(__GLIBC__) - #if __GLIBC_PREREQ(2,6) - #if defined(__x86_64__) - #include <utmpx.h> -@@ -75,10 +76,17 @@ int sys_support = 0; - #else - int sys_support = 0; - #endif -+#else -+int sys_support = 0; -+#endif - -+#if defined(__GLIBC__) - #if !(__GLIBC_PREREQ(2, 7)) - #define CPU_FREE(ptr) free(ptr) - #endif -+#else -+#define CPU_FREE(ptr) free(ptr) -+#endif - - void cleanup(void); - void setup(void); -@@ -164,7 +172,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id, - { - #if defined(__i386__) - return syscall(318, cpu_id, node_id, cache_struct); --#elif __GLIBC_PREREQ(2,6) -+#elif defined(__GLIBC__) -+#if __GLIBC_PREREQ(2,6) -+ *cpu_id = sched_getcpu(); -+#endif -+#else - *cpu_id = sched_getcpu(); - #endif - return 0; -@@ -191,15 +204,20 @@ unsigned int set_cpu_affinity(void) - cpu_set_t *set; - size_t size; - int nrcpus = 1024; -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - realloc: - set = CPU_ALLOC(nrcpus); - #else - set = malloc(sizeof(cpu_set_t)); - #endif -+#else -+ set = malloc(sizeof(cpu_set_t)); -+#endif - if (set == NULL) { - tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno); - } -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - size = CPU_ALLOC_SIZE(nrcpus); - CPU_ZERO_S(size, set); -@@ -207,8 +225,13 @@ realloc: - size = sizeof(cpu_set_t); - CPU_ZERO(set); - #endif -+#else -+ size = sizeof(cpu_set_t); -+ CPU_ZERO(set); -+#endif - if (sched_getaffinity(0, size, set) < 0) { - CPU_FREE(set); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - if (errno == EINVAL && nrcpus < (1024 << 8)) { - nrcpus = nrcpus << 2; -@@ -220,10 +243,17 @@ realloc: - "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); - else - #endif -+#else -+ if (errno == EINVAL) -+ tst_resm(TFAIL, -+ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); -+ else -+#endif - tst_resm(TFAIL, "sched_getaffinity:errno:%d", errno); - tst_exit(); - } - cpu_max = max_cpuid(size, set); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - CPU_ZERO_S(size, set); - CPU_SET_S(cpu_max, size, set); -@@ -231,6 +261,10 @@ realloc: - CPU_ZERO(set); - CPU_SET(cpu_max, set); - #endif -+#else -+ CPU_ZERO(set); -+ CPU_SET(cpu_max, set); -+#endif - if (sched_setaffinity(0, size, set) < 0) { - CPU_FREE(set); - tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno); -@@ -247,11 +281,15 @@ unsigned int max_cpuid(size_t size, cpu_set_t * set) - { - unsigned int index, max = 0; - for (index = 0; index < size * BITS_PER_BYTE; index++) -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - if (CPU_ISSET_S(index, size, set)) - #else - if (CPU_ISSET(index, set)) - #endif -+#else -+ if (CPU_ISSET(index, set)) -+#endif - max = index; - return max; - } -diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -index 9d6a81a..4ed13b2 100644 ---- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -+++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -@@ -66,9 +66,11 @@ do { \ - tst_resm((TEST_RETURN == -1 ? TPASS : TFAIL) | TTERRNO, #t); \ - } while (0) - -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if !(__GLIBC_PREREQ(2, 7)) - #define CPU_FREE(ptr) free(ptr) - #endif -+#endif - - int main(int ac, char **av) - { -@@ -95,14 +97,19 @@ static void do_test(void) - pid_t unused_pid; - unsigned len; - -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - realloc: - mask = CPU_ALLOC(nrcpus); - #else - mask = malloc(sizeof(cpu_set_t)); - #endif -+#else -+ mask = malloc(sizeof(cpu_set_t)); -+#endif - if (mask == NULL) - tst_brkm(TFAIL | TTERRNO, cleanup, "fail to get enough memory"); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - len = CPU_ALLOC_SIZE(nrcpus); - CPU_ZERO_S(len, mask); -@@ -110,10 +117,15 @@ realloc: - len = sizeof(cpu_set_t); - CPU_ZERO(mask); - #endif -+#else -+ len = sizeof(cpu_set_t); -+ CPU_ZERO(mask); -+#endif - /* positive test */ - TEST(sched_getaffinity(0, len, mask)); - if (TEST_RETURN == -1) { - CPU_FREE(mask); -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - if (errno == EINVAL && nrcpus < (1024 << 8)) { - nrcpus = nrcpus << 2; -@@ -125,17 +137,27 @@ realloc: - "newer glibc(>= 2.7)"); - else - #endif -+#else -+ if (errno == EINVAL) -+ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a " -+ "newer glibc(>= 2.7)"); -+ else -+#endif - tst_resm(TFAIL | TTERRNO, "fail to get cpu affinity"); - cleanup(); - } else { - tst_resm(TINFO, "cpusetsize is %d", len); - tst_resm(TINFO, "mask.__bits[0] = %lu ", mask->__bits[0]); - for (i = 0; i < num; i++) { -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - TEST(CPU_ISSET_S(i, len, mask)); - #else - TEST(CPU_ISSET(i, mask)); - #endif -+#else -+ TEST(CPU_ISSET(i, mask)); -+#endif - if (TEST_RETURN != -1) - tst_resm(TPASS, "sched_getaffinity() succeed, " - "this process %d is running " -@@ -143,11 +165,15 @@ realloc: - } - } - -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 7) - CPU_ZERO_S(len, mask); - #else - CPU_ZERO(mask); - #endif -+#else -+ CPU_ZERO(mask); -+#endif - /* negative tests */ - QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1)); - QUICK_TEST(sched_getaffinity(0, 0, mask)); --- -1.9.1 - diff --git a/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch b/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch deleted file mode 100644 index dd7d28319c..0000000000 --- a/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch +++ /dev/null @@ -1,36 +0,0 @@ -From bf5dd2932200e0199a38f3028d3bef2253f32e38 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Thu, 9 Feb 2017 17:17:37 +0800 -Subject: [PATCH] fix redefinition of 'struct msgbuf' error building with musl - -When building with musl the file "sys/msg.h" already contain 'struct msgbuf' - -Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177] - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c -index a757c0d18..e023114d2 100644 ---- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c -+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c -@@ -47,11 +47,13 @@ const char *TCID = "msgrcv08"; - const int TST_TOTAL = 1; - - #if __WORDSIZE == 32 -- -+#ifdef __GLIBC__ - struct msgbuf { - long mtype; /* message type, must be > 0 */ - char mtext[16]; /* message data */ - }; -+#else -+#endif - - static void msr(int msqid) - { --- -2.11.0 - diff --git a/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch b/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch deleted file mode 100644 index b9fce880fa..0000000000 --- a/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 0130f4146ced320aadb01b22e36b13d269a8ebba Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Thu, 7 Jan 2016 19:48:14 +0000 -Subject: [PATCH 10/32] replace __BEGIN_DECLS and __END_DECLS - -They are not portable across libc implementations -therefore replace them with expanded macros - -Include <asm-generic/types.h> to get __s32 definitions -its not a generally available typedef - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/epoll2/include/epoll.h | 8 ++++++-- - utils/sctp/include/netinet/sctp.h | 9 +++++++-- - 2 files changed, 13 insertions(+), 4 deletions(-) - -diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h -index be599c7..8cc5e7e 100644 ---- a/testcases/kernel/syscalls/epoll2/include/epoll.h -+++ b/testcases/kernel/syscalls/epoll2/include/epoll.h -@@ -85,7 +85,9 @@ struct epoll_event - } EPOLL_PACKED; - - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - - /* Creates an epoll instance. Returns an fd for the new instance. - The "size" parameter is a hint specifying the number of file -@@ -114,6 +116,8 @@ extern int epoll_ctl (int __epfd, int __op, int __fd, - extern int epoll_wait (int __epfd, struct epoll_event *__events, - int __maxevents, int __timeout) __THROW; - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* sys/epoll.h */ -diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h -index 51f5bfb..c61aef3 100644 ---- a/utils/sctp/include/netinet/sctp.h -+++ b/utils/sctp/include/netinet/sctp.h -@@ -35,9 +35,12 @@ - - #include <stdint.h> - #include <linux/types.h> -+#include <asm-generic/types.h> - #include <sys/socket.h> - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - - typedef __s32 sctp_assoc_t; - -@@ -862,6 +865,8 @@ int sctp_recvmsg(int s, void *msg, size_t len, struct sockaddr *from, - /* Return the address length for an address family. */ - int sctp_getaddrlen(sa_family_t family); - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* __linux_sctp_h__ */ --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch b/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch deleted file mode 100644 index 25f6ba78ad..0000000000 --- a/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch +++ /dev/null @@ -1,139 +0,0 @@ -From dc1905b6d972f9176b40da270c83d8fb4d1751b5 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 8 Feb 2017 16:12:34 +0800 -Subject: [PATCH 2/5] Rename sigset variable to sigset1 - -sigset API from signal.h is shadowed by this name conflict - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Signed-off-by: Dengke Du <dengke.du@windriver.com> - -Upstream-Status: Pending ---- - testcases/kernel/mem/shmt/shmt04.c | 10 +++++----- - testcases/kernel/mem/shmt/shmt06.c | 10 +++++----- - testcases/kernel/syscalls/sigprocmask/sigprocmask01.c | 10 +++++----- - 3 files changed, 15 insertions(+), 15 deletions(-) - -diff --git a/testcases/kernel/mem/shmt/shmt04.c b/testcases/kernel/mem/shmt/shmt04.c -index b2682da..3f35fad 100644 ---- a/testcases/kernel/mem/shmt/shmt04.c -+++ b/testcases/kernel/mem/shmt/shmt04.c -@@ -56,7 +56,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */ - /**************/ - - key_t key; --sigset_t set; -+sigset_t set1; - - #define SIZE 16*1024 - -@@ -71,9 +71,9 @@ int main(void) - - key = (key_t) getpid(); - -- sigemptyset(&set); -- sigaddset(&set, SIGUSR1); -- sigprocmask(SIG_BLOCK, &set, NULL); -+ sigemptyset(&set1); -+ sigaddset(&set1, SIGUSR1); -+ sigprocmask(SIG_BLOCK, &set1, NULL); - - pid = fork(); - switch (pid) { -@@ -148,7 +148,7 @@ int child(void) - char *cp; - int sig; - -- sigwait(&set, &sig); -+ sigwait(&set1, &sig); - chld_pid = getpid(); - /*--------------------------------------------------------*/ - -diff --git a/testcases/kernel/mem/shmt/shmt06.c b/testcases/kernel/mem/shmt/shmt06.c -index dd69de7..56fb1da 100644 ---- a/testcases/kernel/mem/shmt/shmt06.c -+++ b/testcases/kernel/mem/shmt/shmt06.c -@@ -57,7 +57,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */ - /**************/ - - key_t key; --sigset_t set; -+sigset_t set1; - - int child(); - static int rm_shm(int); -@@ -70,9 +70,9 @@ int main(void) - - key = (key_t) getpid(); - -- sigemptyset(&set); -- sigaddset(&set, SIGUSR1); -- sigprocmask(SIG_BLOCK, &set, NULL); -+ sigemptyset(&set1); -+ sigaddset(&set1, SIGUSR1); -+ sigprocmask(SIG_BLOCK, &set1, NULL); - - pid = fork(); - switch (pid) { -@@ -147,7 +147,7 @@ int child(void) - char *cp; - int sig; - -- sigwait(&set, &sig); -+ sigwait(&set1, &sig); - chld_pid = getpid(); - - if ((shmid = shmget(key, SIZE, 0)) < 0) { -diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c -index 232d25a..06d902f 100644 ---- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c -+++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c -@@ -91,7 +91,7 @@ int TST_TOTAL = 1; - int sig_catch = 0; /* variable to blocked/unblocked signals */ - - struct sigaction sa_new; /* struct to hold signal info */ --sigset_t set; /* signal set to hold signal lists */ -+sigset_t set1; /* signal set to hold signal lists */ - sigset_t sigset2; - - int main(int ac, char **av) -@@ -112,7 +112,7 @@ int main(int ac, char **av) - * so that, signal will not be delivered to - * the test process. - */ -- TEST(sigprocmask(SIG_BLOCK, &set, 0)); -+ TEST(sigprocmask(SIG_BLOCK, &set1, 0)); - - /* Get the process id of test process */ - my_pid = getpid(); -@@ -165,7 +165,7 @@ int main(int ac, char **av) - */ - errno = 0; - if (sigprocmask(SIG_UNBLOCK, -- &set, 0) == -1) { -+ &set1, 0) == -1) { - tst_brkm(TFAIL, cleanup, - "sigprocmask() failed " - "to unblock signal, " -@@ -212,7 +212,7 @@ void setup(void) - * Initialise the signal sets with the list that - * excludes/includes all system-defined signals. - */ -- if (sigemptyset(&set) == -1) { -+ if (sigemptyset(&set1) == -1) { - tst_brkm(TFAIL, cleanup, - "sigemptyset() failed, errno=%d : %s", - errno, strerror(errno)); -@@ -235,7 +235,7 @@ void setup(void) - * Add specified signal (SIGINT) to the signal set - * which excludes system-defined signals. - */ -- if (sigaddset(&set, SIGINT) == -1) { -+ if (sigaddset(&set1, SIGINT) == -1) { - tst_brkm(TFAIL, cleanup, - "sigaddset() failed, errno=%d : %s", - errno, strerror(errno)); --- -2.7.4 - diff --git a/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch b/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch deleted file mode 100644 index a79763d00e..0000000000 --- a/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f42b060e80c9f40627c712d4d56d45221bd7d9fa Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 06:51:20 +0000 -Subject: [PATCH 18/32] guard mallocopt() with __GLIBC__ - -mallocopt is not available on non glibc implementations - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending ---- - utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/utils/benchmark/ebizzy-0.3/ebizzy.c b/utils/benchmark/ebizzy-0.3/ebizzy.c -index 5bb8eff..934d951 100644 ---- a/utils/benchmark/ebizzy-0.3/ebizzy.c -+++ b/utils/benchmark/ebizzy-0.3/ebizzy.c -@@ -215,10 +215,10 @@ static void read_options(int argc, char *argv[]) - "\"never mmap\" option specified\n"); - usage(); - } -- -+#ifdef __GLIBC__ - if (never_mmap) - mallopt(M_MMAP_MAX, 0); -- -+#endif - if (chunk_size < record_size) { - fprintf(stderr, "Chunk size %u smaller than record size %u\n", - chunk_size, record_size); --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch b/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch deleted file mode 100644 index 7060a64b1a..0000000000 --- a/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch +++ /dev/null @@ -1,50 +0,0 @@ -From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 06:57:04 +0000 -Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc - -getdents/getdents64 are implemented in musl and when we define static -functions with same name, it errors out. - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/getdents/getdents.h | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h -index abea655..db63d89 100644 ---- a/testcases/kernel/syscalls/getdents/getdents.h -+++ b/testcases/kernel/syscalls/getdents/getdents.h -@@ -34,12 +34,13 @@ struct linux_dirent { - char d_name[]; - }; - -+#ifdef __GLIBC__ - static inline int - getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size) - { - return ltp_syscall(__NR_getdents, fd, dirp, size); - } -- -+#endif - struct linux_dirent64 { - uint64_t d_ino; - int64_t d_off; -@@ -48,10 +49,11 @@ struct linux_dirent64 { - char d_name[]; - }; - -+#ifdef __GLIBC__ - static inline int - getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size) - { - return ltp_syscall(__NR_getdents64, fd, dirp64, size); - } -- -+#endif - #endif /* GETDENTS_H */ --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch b/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch deleted file mode 100644 index 3e79c9f295..0000000000 --- a/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch +++ /dev/null @@ -1,73 +0,0 @@ -From b216435bb362df10c45f544b78d8c884eaa901fd Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:01:02 +0000 -Subject: [PATCH 21/32] Define _GNU_SOURCE for MREMAP_MAYMOVE definition - -musl guards MREMAP_MAYMOVE with _GNU_SOURCE unlike glibc which uses -__USE_GNU - -Fixes errors like -error: 'MREMAP_MAYMOVE' undeclared (first use in this function) - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/mremap/mremap01.c | 4 +++- - testcases/kernel/syscalls/mremap/mremap02.c | 2 ++ - testcases/kernel/syscalls/mremap/mremap03.c | 2 ++ - 3 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c -index d63d1e4..24ca174 100644 ---- a/testcases/kernel/syscalls/mremap/mremap01.c -+++ b/testcases/kernel/syscalls/mremap/mremap01.c -@@ -76,10 +76,12 @@ - */ - #include <unistd.h> - #include <errno.h> -+#include <fcntl.h> -+#define _GNU_SOURCE - #define __USE_GNU - #include <sys/mman.h> - #undef __USE_GNU --#include <fcntl.h> -+#undef _GNU_SOURCE - - #include "test.h" - -diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c -index 5a51b9a..a530a6b 100644 ---- a/testcases/kernel/syscalls/mremap/mremap02.c -+++ b/testcases/kernel/syscalls/mremap/mremap02.c -@@ -75,9 +75,11 @@ - #include <errno.h> - #include <unistd.h> - #include <fcntl.h> -+#define _GNU_SOURCE - #define __USE_GNU - #include <sys/mman.h> - #undef __USE_GNU -+#undef _GNU_SOURCE - - #include "test.h" - -diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c -index 12e3829..9b39f8b 100644 ---- a/testcases/kernel/syscalls/mremap/mremap03.c -+++ b/testcases/kernel/syscalls/mremap/mremap03.c -@@ -76,9 +76,11 @@ - #include <errno.h> - #include <unistd.h> - #include <fcntl.h> -+#define _GNU_SOURCE - #define __USE_GNU - #include <sys/mman.h> - #undef __USE_GNU -+#undef _GNU_SOURCE - - #include "test.h" - --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch b/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch deleted file mode 100644 index 529f4ed305..0000000000 --- a/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 560347f77236616a635b4a997a0596b8da4d0799 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:08:25 +0000 -Subject: [PATCH 23/32] ptrace: Use int instead of enum __ptrace_request - -__ptrace_request is only available with glibc - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/ptrace/ptrace03.c | 4 ++++ - testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c -index a4028fc..f1880cd 100644 ---- a/testcases/kernel/syscalls/ptrace/ptrace03.c -+++ b/testcases/kernel/syscalls/ptrace/ptrace03.c -@@ -102,7 +102,11 @@ static pid_t unused_pid; - static pid_t zero_pid; - - struct test_case_t { -+#ifdef __GLIBC__ - enum __ptrace_request request; -+#else -+ int request; -+#endif - pid_t *pid; - int exp_errno; - } test_cases[] = { -diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h -index ae538e9..85aa89d 100644 ---- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h -+++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h -@@ -130,7 +130,11 @@ static char *strings[] = { - SPT(KILL) - SPT(SINGLESTEP) - }; -+#ifdef __GLIBC__ - static inline char *strptrace(enum __ptrace_request request) -+#else -+static inline char *strptrace(int request) -+#endif - { - return strings[request]; - } --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch b/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch deleted file mode 100644 index 03aa45df8c..0000000000 --- a/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch +++ /dev/null @@ -1,70 +0,0 @@ -From e01e9862c248dc90a8ec6f2d06f8469d7a50cd8e Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:14:58 +0000 -Subject: [PATCH 24/32] rt_sigaction/rt_sigprocmark: Define _GNU_SOURCE - -Fixes musl build failure e.g. -error: 'SA_NOMASK' undeclared here (not in a function) - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c | 1 + - testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +- - testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c | 1 + - testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c | 1 + - 4 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c -index 5cf89cc..bdcb91a 100644 ---- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c -+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c -@@ -28,6 +28,7 @@ - /* sigset_t type. */ - /******************************************************************************/ - -+#define _GNU_SOURCE - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> -diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c -index a1da743..8a27a0f 100644 ---- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c -+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c -@@ -23,7 +23,7 @@ - /* Description: This tests the rt_sigaction() syscall */ - /* rt_sigaction Expected EFAULT error check */ - /******************************************************************************/ -- -+#define _GNU_SOURCE - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> -diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c -index 175d220..e7627cd 100644 ---- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c -+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c -@@ -24,6 +24,7 @@ - /* rt_sigaction Expected EINVAL error check */ - /******************************************************************************/ - -+#define _GNU_SOURCE - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> -diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c -index 74e5a61..75c57fc 100644 ---- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c -+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c -@@ -39,6 +39,7 @@ - /* sigsetsize should indicate the size of a sigset_t type. */ - /******************************************************************************/ - -+#define _GNU_SOURCE - #include <stdio.h> - #include <signal.h> - #include <errno.h> --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch b/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch deleted file mode 100644 index afcba63e15..0000000000 --- a/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 9d14edfc12eefac900dd54729a88b3ccf91c1c43 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:18:15 +0000 -Subject: [PATCH 25/32] mc_gethost: include sys/types.h - -Fix build on musl -error: unknown type name 'u_char' - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/network/multicast/mc_gethost/mc_gethost.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c -index 5b9a790..c799e2a 100644 ---- a/testcases/network/multicast/mc_gethost/mc_gethost.c -+++ b/testcases/network/multicast/mc_gethost/mc_gethost.c -@@ -6,6 +6,7 @@ - - #include <sys/param.h> - #include <sys/socket.h> -+#include <sys/types.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <arpa/nameser.h> --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch b/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch deleted file mode 100644 index f65fad12d4..0000000000 --- a/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0133a2b29d6f48d8e2bba6a3be581cdfa91311a6 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:21:05 +0000 -Subject: [PATCH 26/32] crash01: Define _GNU_SOURCE - -Fixes musl build errors like -error: 'SA_NOMASK' undeclared (first use in this function) - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - testcases/misc/crash/crash01.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/testcases/misc/crash/crash01.c b/testcases/misc/crash/crash01.c -index 0574521..08a02e7 100644 ---- a/testcases/misc/crash/crash01.c -+++ b/testcases/misc/crash/crash01.c -@@ -49,7 +49,7 @@ stress test at the same time you run other tests, like a multi-user - benchmark. - - */ -- -+#define _GNU_SOURCE - #include <stdio.h> - #include <stdlib.h> - #include <string.h> --- -2.7.0 - diff --git a/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch b/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch deleted file mode 100644 index adf6f27418..0000000000 --- a/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1471012164ba8f26046d4b1ce5531a0d92805ef5 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 8 Feb 2017 16:21:16 +0800 -Subject: [PATCH 4/5] sysconf01: Use _SC_2_C_VERSION conditionally - -_SC_2_C_VERSION is not available on musl - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Signed-off-by: Dengke Du <dengke.du@windriver.com> - -Upstream-Status: Pending ---- - testcases/kernel/syscalls/sysconf/sysconf01.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/testcases/kernel/syscalls/sysconf/sysconf01.c b/testcases/kernel/syscalls/sysconf/sysconf01.c -index 583deef..de93695 100644 ---- a/testcases/kernel/syscalls/sysconf/sysconf01.c -+++ b/testcases/kernel/syscalls/sysconf/sysconf01.c -@@ -103,7 +103,9 @@ int main(void) - test_sysconf(_SC_2_C_BIND); - test_sysconf(_SC_2_C_DEV); - #ifdef _SC_2_C_VERSION -+#ifdef __GLIBC__ - test_sysconf(_SC_2_C_VERSION); -+#endif - #else - tst_resm(TCONF, "_SC_2_C_VERSION not defined"); - #endif --- -2.7.4 - diff --git a/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch b/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch deleted file mode 100644 index c730d46e69..0000000000 --- a/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 94557fb7e1293c61145c959b8c5ffecf4a2b1069 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Jan 2016 07:24:44 +0000 -Subject: [PATCH 28/32] rt_sigaction.h: Use sighandler_t instead of - __sighandler_t - -When _GNU_SOURCE is used then both typedefs are same and using -sighandler_t makes it work on musl too - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - include/lapi/rt_sigaction.h | 2 +- - testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++ - 2 files changed, 4 insertions(+), 1 deletion(-) - -Index: git/include/lapi/rt_sigaction.h -=================================================================== ---- git.orig/include/lapi/rt_sigaction.h -+++ git/include/lapi/rt_sigaction.h -@@ -36,12 +36,12 @@ - #if defined(__mips__) - struct kernel_sigaction { - unsigned int sa_flags; -- __sighandler_t k_sa_handler; -+ sighandler_t k_sa_handler; - sigset_t sa_mask; - }; - #else - struct kernel_sigaction { -- __sighandler_t k_sa_handler; -+ sighandler_t k_sa_handler; - unsigned long sa_flags; - void (*sa_restorer) (void); - sigset_t sa_mask; -Index: git/testcases/kernel/syscalls/rt_sigsuspend/Makefile -=================================================================== ---- git.orig/testcases/kernel/syscalls/rt_sigsuspend/Makefile -+++ git/testcases/kernel/syscalls/rt_sigsuspend/Makefile -@@ -19,4 +19,7 @@ - top_srcdir ?= ../../../.. - - include $(top_srcdir)/include/mk/testcases.mk -+ -+CFLAGS += -D_GNU_SOURCE -+ - include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch b/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch deleted file mode 100644 index efa6d060a0..0000000000 --- a/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 00ba7cdd0608b1507027428f9f87b1cb9747372b Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Thu, 9 Feb 2017 15:54:53 +0800 -Subject: [PATCH] lib: Use PTHREAD_MUTEX_RECURSIVE in place of - PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc - -e.g. musl does not implement the _NP mutex types - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Signed-off-by: Dengke Du <dengke.du@windriver.com> - -Upstream-Status: Pending ---- - lib/tst_res.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/lib/tst_res.c b/lib/tst_res.c -index 61daaeb..435224f 100644 ---- a/lib/tst_res.c -+++ b/lib/tst_res.c -@@ -79,7 +79,11 @@ int TEST_ERRNO; - assert(strlen(buf) > 0); \ - } while (0) - -+#ifdef __GLIBC__ - static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; -+#else -+static pthread_mutex_t tmutex = { PTHREAD_MUTEX_RECURSIVE }; -+#endif - - static void check_env(void); - static void tst_condense(int tnum, int ttype, const char *tmesg); --- -2.7.4 - diff --git a/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch b/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch deleted file mode 100644 index 868e1cf1fa..0000000000 --- a/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 5e3dea669e5b0b769f322d54a3bb9f320b5327da Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Tue, 22 Mar 2016 15:47:14 +0000 -Subject: [PATCH 26/26] shmat1: Cover GNU specific code under __USE_GNU - -on x86, we use uc_mcontext element from sigcontext -which is marked gnu-specific in glibc, this patch -adds this condition around the code - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- -Upstream-Status: Pending - - testcases/kernel/mem/mtest06/shmat1.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/testcases/kernel/mem/mtest06/shmat1.c b/testcases/kernel/mem/mtest06/shmat1.c -index 0d6d7a4..bee69f6 100644 ---- a/testcases/kernel/mem/mtest06/shmat1.c -+++ b/testcases/kernel/mem/mtest06/shmat1.c -@@ -111,7 +111,7 @@ int done_shmat = 0; /* disallow read and writes before shmat */ - static void sig_handler(int signal, /* signal number, set to handle SIGALRM */ - int code, struct ucontext *ut) - { /* contains pointer to sigcontext structure */ --#ifdef __i386__ -+#if defined(__i386__) && defined(__USE_GNU) - unsigned long except; /* exception type. */ - int ret = 0; /* exit code from signal handler. */ - struct sigcontext *scp = /* pointer to sigcontext structure */ -@@ -122,7 +122,7 @@ static void sig_handler(int signal, /* signal number, set to handle SIGALRM - fprintf(stdout, "Test ended, success\n"); - exit(0); - } --#ifdef __i386__ -+#if defined(__i386__) && defined(__USE_GNU) - else { - except = scp->trapno; - fprintf(stderr, "signal caught - [%d] ", signal); --- -1.9.1 - diff --git a/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch b/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch deleted file mode 100644 index c2ef899cc5..0000000000 --- a/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 5a77e2bdc083f4f842a8ba7c2db1a7ac6e5f0664 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 31 May 2017 21:26:05 -0400 -Subject: [PATCH] Add periodic output for long time test. - -This is needed in context of having scripts running ltp tests and -waiting with a timeout for the output of the tests. - -Signed-off-by: Tudor Florea <tudor.florea@enea.com> -Upstream-Status: Pending - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - .../kernel/controllers/memcg/stress/memcg_stress_test.sh | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh -index af1a708..084e628 100755 ---- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh -+++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh -@@ -37,7 +37,8 @@ if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then - exit 0 - fi - --RUN_TIME=$(( 15 * 60 )) -+ONE_MINUTE=60 -+RUN_TIME=15 - - cleanup() - { -@@ -62,7 +63,7 @@ do_mount() - # $1 - Number of cgroups - # $2 - Allocated how much memory in one process? in MB - # $3 - The interval to touch memory in a process --# $4 - How long does this test run ? in second -+# $4 - How long does this test run ? in minutes - run_stress() - { - do_mount; -@@ -81,7 +82,11 @@ run_stress() - eval /bin/kill -s SIGUSR1 \$pid$i 2> /dev/null - done - -- sleep $4 -+ for i in $(seq 0 $(($4-1))) -+ do -+ eval echo "Started $i min ago. Still alive... " -+ sleep $ONE_MINUTE -+ done - - for i in $(seq 0 $(($1-1))) - do --- -2.8.1 - diff --git a/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch deleted file mode 100644 index 71e32a5e51..0000000000 --- a/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f7c602b639db0d118e07d3fa7b6deead0be0c72b Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 8 Feb 2017 16:17:17 +0800 -Subject: [PATCH 3/5] Fix test_proc_kill hanging - -Sometimes the signal is delivered to memcg_process before the framework took -into consideration its pid entered in the tasks. Fixed by delaying the signal -send command. - -Signed-off-by: George Nita <george.nita@enea.com> -Signed-off-by: Dengke Du <dengke.du@windriver.com> - -Upstream-Status: Pending ---- - testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh -index b785fe3..2918cc5 100755 ---- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh -+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh -@@ -283,6 +283,7 @@ test_proc_kill() - pid=$! - TST_CHECKPOINT_WAIT 0 - echo $pid > tasks -+ sleep 1 - - signal_memcg_process $pid $3 - --- -2.7.4 - diff --git a/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch deleted file mode 100644 index 04532be79e..0000000000 --- a/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 672a56be14426eae44864673c6c2afca0ab89d46 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com> -Date: Fri, 13 May 2016 11:11:28 -0500 -Subject: [PATCH] testcases/network/nfsv4/acl/acl1.c: Security fix on string - printf -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes: - -acl1.c: In function 'test_acl_default': -acl1.c:317:2: error: format not a string literal and no format arguments -[-Werror=format-security] - printf(cmd); - -[YOCTO #9548] - -Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> - -Upstream-Status: Pending ---- - testcases/network/nfsv4/acl/acl1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c -index b8b67b4..7c7c506 100644 ---- a/testcases/network/nfsv4/acl/acl1.c -+++ b/testcases/network/nfsv4/acl/acl1.c -@@ -314,7 +314,7 @@ void test_acl_default(char *dir, acl_t acl) - char *cmd = malloc(256); - - strcpy(cmd, "chmod 7777 "); -- printf(cmd); -+ printf(cmd, NULL); - strcat(cmd, dir); - system(cmd); - acl2 = acl_get_file(path, ACL_TYPE_ACCESS); --- -2.1.4 - diff --git a/meta/recipes-extended/ltp/ltp/0037-ltp-fix-format-security-error.patch b/meta/recipes-extended/ltp/ltp/0037-ltp-fix-format-security-error.patch deleted file mode 100644 index 44d699051b..0000000000 --- a/meta/recipes-extended/ltp/ltp/0037-ltp-fix-format-security-error.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8eb3e111ae1b89e5afb249cf984d657f94da2385 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Tue, 17 Oct 2017 05:42:47 -0400 -Subject: [PATCH] ltp: fix format security error - -When enable option: -Werror=format-security, the error like: - - | fcntl36.c: In function 'test_fn': - | fcntl36.c:303:2: error: format not a string literal and no format arguments [-Werror=format-security] - | tst_res(TINFO, msg); - | ^~~~~~~ - | cc1: some warnings being treated as errors - -Upstream-Status: Pending - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - testcases/kernel/syscalls/fcntl/fcntl36.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/fcntl/fcntl36.c b/testcases/kernel/syscalls/fcntl/fcntl36.c -index 6f2eb6b..3246d13 100644 ---- a/testcases/kernel/syscalls/fcntl/fcntl36.c -+++ b/testcases/kernel/syscalls/fcntl/fcntl36.c -@@ -300,7 +300,7 @@ static void test_fn(void *f0(void *), void *f1(void *), - struct param p2[thread_cnt]; - unsigned char buf[write_size]; - -- tst_res(TINFO, msg); -+ tst_res(TINFO, "%s", msg); - - if (tst_fill_file(fname, 1, write_size, thread_cnt + 1)) - tst_brk(TBROK, "Failed to create tst file"); --- -2.8.1 - diff --git a/meta/recipes-extended/ltp/ltp/0038-generate-reproducible-gzip.patch b/meta/recipes-extended/ltp/ltp/0038-generate-reproducible-gzip.patch deleted file mode 100644 index 0153ace8ea..0000000000 --- a/meta/recipes-extended/ltp/ltp/0038-generate-reproducible-gzip.patch +++ /dev/null @@ -1,20 +0,0 @@ -Do not generate timestamps in gzipped file headers. -The timestamps prevent reproducible build. - -Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/233] - -Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> - -diff --git a/testcases/network/generate.sh b/testcases/network/generate.sh -index 00216a6..939f792 100755 ---- a/testcases/network/generate.sh -+++ b/testcases/network/generate.sh -@@ -55,7 +55,7 @@ fi - if [ ! -e "bin.sm" ] ; then - cnt=0 - while [ $cnt -lt 5 ] ; do -- gzip -1 -c ascii.sm >> "bin.sm" -+ gzip -1 -c -n ascii.sm >> "bin.sm" - cnt=$(($cnt + 1)) - done - fi diff --git a/meta/recipes-extended/ltp/ltp_20170929.bb b/meta/recipes-extended/ltp/ltp_20170929.bb deleted file mode 100644 index 8a870b36ac..0000000000 --- a/meta/recipes-extended/ltp/ltp_20170929.bb +++ /dev/null @@ -1,123 +0,0 @@ -SUMMARY = "Linux Test Project" -DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features." -HOMEPAGE = "http://ltp.sourceforge.net" -SECTION = "console/utils" -LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause" -LIC_FILES_CHKSUM = "\ - file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://testcases/kernel/controllers/freezer/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ - file://testcases/kernel/controllers/freezer/run_freezer.sh;beginline=5;endline=17;md5=86a61d2c042d59836ffb353a21456498 \ - file://testcases/kernel/hotplug/memory_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \ - file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \ - file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \ - file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ - file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ - file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ - file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \ -" - -DEPENDS = "attr libaio libcap acl openssl zip-native" -DEPENDS_append_libc-musl = " fts " -EXTRA_OEMAKE_append_libc-musl = " LIBC=musl " -CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" -CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" -SRCREV = "bac930f71b1e6786ebb8a894463503d07681ef6a" - -SRC_URI = "git://github.com/linux-test-project/ltp.git \ - file://0001-add-_GNU_SOURCE-to-pec_listener.c.patch \ - file://0002-Add-knob-to-control-whether-numa-support-should-be-c.patch \ - file://0003-Add-knob-to-control-tirpc-support.patch \ - file://0004-build-Add-option-to-select-libc-implementation.patch \ - file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \ - file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \ - file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ - file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \ - file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \ - file://0011-Rename-sigset-variable-to-sigset1.patch \ - file://0018-guard-mallocopt-with-__GLIBC__.patch \ - file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \ - file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \ - file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \ - file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \ - file://0025-mc_gethost-include-sys-types.h.patch \ - file://0026-crash01-Define-_GNU_SOURCE.patch \ - file://0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch \ - file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \ - file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch \ - file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \ - file://0034-periodic_output.patch \ - file://0035-fix-test_proc_kill-hang.patch \ - file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ - file://0037-ltp-fix-format-security-error.patch \ - file://0038-generate-reproducible-gzip.patch \ - " - -S = "${WORKDIR}/git" - -inherit autotools-brokensep - -TARGET_CC_ARCH += "${LDFLAGS}" - -export prefix = "/opt/ltp" -export exec_prefix = "/opt/ltp" - -PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl," -EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4" -EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite " -# ltp network/rpc test cases ftbfs when libtirpc is found -EXTRA_OECONF += " --without-tirpc " - -do_install(){ - install -d ${D}/opt/ltp/ - oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install - - # fixup not deploy STPfailure_report.pl to avoid confusing about it fails to run - # as it lacks dependency on some perl moudle such as LWP::Simple - # And this script previously works as a tool for analyzing failures from LTP - # runs on the OSDL's Scaleable Test Platform (STP) and it mainly accesses - # http://khack.osdl.org to retrieve ltp test results run on - # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible - rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl - - # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual - cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases -} - -RDEPENDS_${PN} = "\ - acl \ - at \ - attr \ - bash \ - cpio \ - cronie \ - curl \ - e2fsprogs-mke2fs \ - expect \ - gawk \ - gzip \ - iproute2 \ - ldd \ - libaio \ - logrotate \ - perl \ - python-core \ - unzip \ - util-linux \ - which \ -" - -FILES_${PN}-staticdev += "/opt/ltp/lib/libmem.a /opt/ltp/testcases/data/nm01/lib.a" - -FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/*" - -# Avoid generated binaries stripping. Otherwise some of the ltp tests such as ldd01 & nm01 fails -INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -# However, test_arch_stripped is already stripped, so... -INSANE_SKIP_${PN} += "already-stripped" - -# Avoid file dependency scans, as LTP checks for things that may or may not -# exist on the running system. For instance it has specific checks for -# csh and ksh which are not typically part of OpenEmbedded systems (but -# can be added via additional layers.) -SKIP_FILEDEPS_${PN} = '1' diff --git a/meta/recipes-extended/ltp/ltp_20240129.bb b/meta/recipes-extended/ltp/ltp_20240129.bb new file mode 100644 index 0000000000..3e896957d1 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp_20240129.bb @@ -0,0 +1,144 @@ +SUMMARY = "Linux Test Project" +DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features." +HOMEPAGE = "https://linux-test-project.github.io/" +SECTION = "console/utils" +LICENSE = "GPL-2.0-only & GPL-2.0-or-later & LGPL-2.0-or-later & LGPL-2.1-or-later & BSD-2-Clause" +LIC_FILES_CHKSUM = "\ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \ + file://testcases/network/can/filter-tests/COPYING;md5=5b155ea7d7f86eae8e8832955d8b70bc \ +" + +DEPENDS = "attr libaio libcap acl openssl zip-native" +DEPENDS:append:libc-musl = " fts " +EXTRA_OEMAKE:append:libc-musl = " LIBC=musl " +EXTRA_OECONF:append:libc-musl = " LIBS=-lfts " + +# since ltp contains x86-64 assembler which uses the frame-pointer register, +# set -fomit-frame-pointer x86-64 to handle cases where optimisation +# is set to -O0 or frame pointers have been enabled by -fno-omit-frame-pointer +# earlier in CFLAGS, etc. +CFLAGS:append:x86-64 = " -fomit-frame-pointer" +TUNE_CCARGS:remove:x86 = "-mfpmath=sse" +TUNE_CCARGS:remove:x86-64 = "-mfpmath=sse" + +CFLAGS:append:powerpc64 = " -D__SANE_USERSPACE_TYPES__" +CFLAGS:append:mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" +SRCREV = "68737d20556d37364c95776044b1119c0912a36a" + +SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=https \ + file://0001-Remove-OOM-tests-from-runtest-mm.patch \ + file://0001-scenario_groups-default-remove-connectors.patch \ + " + +S = "${WORKDIR}/git" + +inherit autotools-brokensep pkgconfig + +# Version 20220527 added KVM test infrastructure which currently fails to build with gold due to +# SORT_NONE in linker script which isn't supported by gold: +# https://sourceware.org/bugzilla/show_bug.cgi?id=18097 +# https://github.com/linux-test-project/ltp/commit/3fce2064b54843218d085aae326c8f7ecf3a8c41#diff-39268f0855c634ca48c8993fcd2c95b12a65b79e8d9fa5ccd6b0f5a8785c0dd6R36 +LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd', '', d)}" +LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd', '', d)}" + +# After 0002-kvm-use-LD-instead-of-hardcoding-ld.patch +# https://github.com/linux-test-project/ltp/commit/f94e0ef3b7280f886384703ef9019aaf2f2dfebb +# it fails with gold also a bit later when trying to use *-payload.bin +# http://errors.yoctoproject.org/Errors/Details/663094/ +# work around this by forcing .bfd linked in LD when ld-is-gold is in DISTRO_FEATURES +KVM_LD = "${@bb.utils.contains_any('DISTRO_FEATURES', 'ld-is-gold ld-is-lld', '${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}', '${LD}', d)}" + +TARGET_CC_ARCH += "${LDFLAGS}" + +export prefix = "/opt/${PN}" +export exec_prefix = "/opt/${PN}" + +PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl," +EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4" +EXTRA_OECONF = " --with-realtime-testsuite --with-open-posix-testsuite " +# ltp network/rpc test cases ftbfs when libtirpc is found +EXTRA_OECONF += " --without-tirpc " + +do_compile() { + oe_runmake HOSTCC="${CC_FOR_BUILD}" HOST_CFLAGS="${CFLAGS_FOR_BUILD}" HOST_LDFLAGS="${LDFLAGS_FOR_BUILD}" KVM_LD="${KVM_LD}" +} + +do_install(){ + install -d ${D}${prefix}/ + oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install include-install + + # fixup not deploy STPfailure_report.pl to avoid confusing about it fails to run + # as it lacks dependency on some perl moudle such as LWP::Simple + # And this script previously works as a tool for analyzing failures from LTP + # runs on the OSDL's Scaleable Test Platform (STP) and it mainly accesses + # http://khack.osdl.org to retrieve ltp test results run on + # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible + rm -rf ${D}${prefix}/bin/STPfailure_report.pl + + # The controllers memcg_stree test seems to cause us hangs and takes 900s + # (maybe we expect more regular output?), anyhow, skip it + sed -e '/^memcg_stress/d' -i ${D}${prefix}/runtest/controllers +} + +RDEPENDS:${PN} = "\ + attr \ + bash \ + bc \ + coreutils \ + cpio \ + cronie \ + curl \ + e2fsprogs \ + e2fsprogs-mke2fs \ + expect \ + file \ + findutils \ + gawk \ + gdb \ + gzip \ + iproute2 \ + ldd \ + libaio \ + logrotate \ + net-tools \ + perl \ + python3-core \ + procps \ + quota \ + unzip \ + util-linux \ + which \ + tar \ +" + +RRECOMMENDS:${PN} += "kernel-module-loop" + +FILES:${PN} += "${prefix}/* ${prefix}/runtest/* ${prefix}/scenario_groups/* ${prefix}/testcases/bin/* ${prefix}/testcases/bin/*/bin/* ${prefix}/testscripts/* ${prefix}/testcases/open_posix_testsuite/* ${prefix}/testcases/open_posix_testsuite/conformance/* ${prefix}/testcases/open_posix_testsuite/Documentation/* ${prefix}/testcases/open_posix_testsuite/functional/* ${prefix}/testcases/open_posix_testsuite/include/* ${prefix}/testcases/open_posix_testsuite/scripts/* ${prefix}/testcases/open_posix_testsuite/stress/* ${prefix}/testcases/open_posix_testsuite/tools/* ${prefix}/testcases/data/nm01/lib.a ${prefix}/lib/libmem.a" + +# Avoid stripping some generated binaries otherwise some of the ltp tests such as ldd01 & nm01 fail +INHIBIT_PACKAGE_STRIP_FILES = "${prefix}/testcases/bin/nm01 ${prefix}/testcases/bin/ldd01" +INSANE_SKIP:${PN} += "already-stripped staticdev" + +remove_broken_musl_sources() { + [ "${TCLIBC}" = "musl" ] || return 0 + + cd ${S} + echo "WARNING: remove unsupported tests (until they're fixed)" + + # sync with upstream + # https://github.com/linux-test-project/ltp/blob/master/ci/alpine.sh#L33 + rm -rfv \ + testcases/kernel/syscalls/fmtmsg/fmtmsg01.c \ + testcases/kernel/syscalls/getcontext/getcontext01.c \ + testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c \ + testcases/kernel/syscalls/timer_create/timer_create01.c \ + testcases/kernel/syscalls/timer_create/timer_create03.c +} +do_patch[postfuncs] += "remove_broken_musl_sources" + +# Avoid file dependency scans, as LTP checks for things that may or may not +# exist on the running system. For instance it has specific checks for +# csh and ksh which are not typically part of OpenEmbedded systems (but +# can be added via additional layers.) +SKIP_FILEDEPS:${PN} = '1' |