From a921c2f9dbefde3592bfe65c80ff1ce973aac89b Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 19 Jul 2019 13:13:18 +0800 Subject: ltp: upgrade 20190115 -> 20190517 Drop the following patches since the issues have been fixed upstream: 0001-file01.sh-Fix-in-was-not-recognized.patch 0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch 0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch 0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch 0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch 0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch 0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch 0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch 0026-crash01-Define-_GNU_SOURCE.patch 0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch 0034-periodic_output.patch 0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch define-sigrtmin-and-sigrtmax-for-musl.patch setregid01-security-string-formatting.patch Refresh the following patches: 0004-build-Add-option-to-select-libc-implementation.patch 0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch 0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch 0018-guard-mallocopt-with-__GLIBC__.patch 0020-getdents-define-getdents-getdents64-only-for-glibc.patch 0035-fix-test_proc_kill-hang.patch 0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch 0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch 0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch 0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch 0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch Add patch: 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch (From OE-Core rev: eb59546c83f4c217de6272a8d3b2fa65e3c84e7f) Signed-off-by: Yi Zhao Signed-off-by: Richard Purdie --- ...-Add-option-to-select-libc-implementation.patch | 149 ++++++++++++ ...t-kernel-pick-an-address-when-calling-mma.patch | 49 ---- .../0001-file01.sh-Fix-in-was-not-recognized.patch | 38 --- ...-adjust-a-bit-of-code-to-compatiable-with.patch | 62 ----- ...efine-TST_ABI-32-64-to-detect-target-type.patch | 74 ------ ..._testsuite-mmap24-2-Relax-condition-a-bit.patch | 68 ------ ...n-t-use-hardcoded-index-0-for-SHM_STAT-te.patch | 81 ------- ...trlimit03.c-read-proc-sys-fs-nr_open-for-.patch | 70 ------ ...rollers-Link-with-libfts-explicitly-on-mu.patch | 47 ++++ ...__GLIBC_PREREQ-is-defined-before-using-it.patch | 58 +++++ ...-Add-option-to-select-libc-implementation.patch | 148 ------------ .../ltp/0004-guard-mallocopt-with-__GLIBC__.patch | 34 +++ ...define-getdents-getdents64-only-for-glibc.patch | 50 ++++ ...rollers-Link-with-libfts-explicitly-on-mu.patch | 46 ---- ...06-rt_tgsigqueueinfo-disable-test-on-musl.patch | 35 +++ .../ltp/ltp/0007-Fix-test_proc_kill-hanging.patch | 32 +++ ...RDSIZE-undeclared-when-building-with-musl.patch | 31 --- ...__GLIBC_PREREQ-is-defined-before-using-it.patch | 151 ------------ ...etwork-nfsv4-acl-acl1.c-Security-fix-on-s.patch | 41 ++++ ...ition-of-struct-msgbuf-error-building-wit.patch | 36 --- ..._testsuite-mmap24-2-Relax-condition-a-bit.patch | 68 ++++++ ...n-t-use-hardcoded-index-0-for-SHM_STAT-te.patch | 82 +++++++ .../0011-direct_io-diotest4-drop-MAP_FIXED.patch | 56 +++++ ...-adjust-a-bit-of-code-to-compatiable-with.patch | 64 ++++++ .../ltp/0018-guard-mallocopt-with-__GLIBC__.patch | 33 --- ...define-getdents-getdents64-only-for-glibc.patch | 50 ---- ..._GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch | 73 ------ ...-Use-int-instead-of-enum-__ptrace_request.patch | 50 ---- ...gaction-rt_sigprocmark-Define-_GNU_SOURCE.patch | 70 ------ .../ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch | 31 --- ...n.h-Use-sighandler_t-instead-of-__sighand.patch | 48 ---- .../ltp/ltp/0034-periodic_output.patch | 55 ----- .../ltp/ltp/0035-fix-test_proc_kill-hang.patch | 32 --- ...etwork-nfsv4-acl-acl1.c-Security-fix-on-s.patch | 41 ---- ...s-ar01-Fix-for-test-in-deterministic-mode.patch | 254 --------------------- .../define-sigrtmin-and-sigrtmax-for-musl.patch | 114 --------- .../setregid01-security-string-formatting.patch | 46 ---- meta/recipes-extended/ltp/ltp_20190115.bb | 128 ----------- meta/recipes-extended/ltp/ltp_20190517.bb | 115 ++++++++++ 39 files changed, 831 insertions(+), 1879 deletions(-) create mode 100644 meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-file01.sh-Fix-in-was-not-recognized.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch create mode 100644 meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch create mode 100644 meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch create mode 100644 meta/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch create mode 100644 meta/recipes-extended/ltp/ltp/0005-getdents-define-getdents-getdents64-only-for-glibc.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch create mode 100644 meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch create mode 100644 meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch create mode 100644 meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch create mode 100644 meta/recipes-extended/ltp/ltp/0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch create mode 100644 meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch create mode 100644 meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch create mode 100644 meta/recipes-extended/ltp/ltp/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0034-periodic_output.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch delete mode 100644 meta/recipes-extended/ltp/ltp/define-sigrtmin-and-sigrtmax-for-musl.patch delete mode 100644 meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch delete mode 100644 meta/recipes-extended/ltp/ltp_20190115.bb create mode 100644 meta/recipes-extended/ltp/ltp_20190517.bb (limited to 'meta/recipes-extended/ltp') diff --git a/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch b/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch new file mode 100644 index 0000000000..b5c25c56a5 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch @@ -0,0 +1,149 @@ +From ec282980e6eee96f5b74aba464141f86049263e6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 18:19:03 +0000 +Subject: [PATCH] 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 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + 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 768ca46..e9d679a 100644 +--- a/Makefile ++++ b/Makefile +@@ -41,6 +41,11 @@ vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include + 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 39d79c7..24a57d9 100644 +--- a/testcases/kernel/Makefile ++++ b/testcases/kernel/Makefile +@@ -49,12 +49,15 @@ SUBDIRS += connectors \ + logging \ + mem \ + numa \ +- pty \ + sched \ + security \ + timers \ + tracing \ + ++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 6a57d79..74bb933 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 45a00cf..d1becd0 100644 +--- a/testcases/kernel/syscalls/Makefile ++++ b/testcases/kernel/syscalls/Makefile +@@ -28,6 +28,11 @@ 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 + + ifeq ($(UCLIBC),1) + FILTER_OUT_DIRS += profil +diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile +index 8c55a6b..f7cda62 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 66e9d56..ea8eb8a 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 68616a7..748754b 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 1881f75..266e0b8 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.4 + diff --git a/meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch b/meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch deleted file mode 100644 index 620027bd0d..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 785809201ad7dea2872d493efbfd65bb215710d6 Mon Sep 17 00:00:00 2001 -From: "Hongzhi.Song" -Date: Sun, 30 Jun 2019 21:56:16 -0400 -Subject: [PATCH] diotest4: Let kernel pick an address when calling mmap - -Error: -diotest4 10 TBROK : diotest4.c:368: can't mmap file: Invalid argument -diotest4 11 TBROK : diotest4.c:368: Remaining cases broken - -This is because the specified addr from mmap is invalid. -We should let kernel itself pick an addrress. - -Signed-off-by: Jan Stancek - -Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2019-June/012570.html] - -Signed-off-by: Hongzhi.Song ---- - testcases/kernel/io/direct_io/diotest4.c | 8 ++------ - 1 file changed, 2 insertions(+), 6 deletions(-) - -diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c -index e4616e4..d88c431 100644 ---- a/testcases/kernel/io/direct_io/diotest4.c -+++ b/testcases/kernel/io/direct_io/diotest4.c -@@ -352,18 +352,14 @@ int main(int argc, char *argv[]) - total++; - - /* Test-10: read, write to a mmaped file */ -- shm_base = (char *)(((long)sbrk(0) + (shmsz - 1)) & ~(shmsz - 1)); -- if (shm_base == NULL) { -- tst_brkm(TBROK, cleanup, "sbrk failed: %s", strerror(errno)); -- } - offset = 4096; - count = bufsize; - if ((fd = open(filename, O_DIRECT | O_RDWR)) < 0) { - tst_brkm(TBROK, cleanup, "can't open %s: %s", - filename, strerror(errno)); - } -- shm_base = mmap(shm_base, 0x100000, PROT_READ | PROT_WRITE, -- MAP_SHARED | MAP_FIXED, fd, 0); -+ shm_base = mmap(NULL, 0x100000, PROT_READ | PROT_WRITE, -+ MAP_SHARED, fd, 0); - if (shm_base == (caddr_t) - 1) { - tst_brkm(TBROK, cleanup, "can't mmap file: %s", - strerror(errno)); --- -2.8.1 - diff --git a/meta/recipes-extended/ltp/ltp/0001-file01.sh-Fix-in-was-not-recognized.patch b/meta/recipes-extended/ltp/ltp/0001-file01.sh-Fix-in-was-not-recognized.patch deleted file mode 100644 index 5cd9e082f2..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-file01.sh-Fix-in-was-not-recognized.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 974e9b862e503c50501079e6586f81918e94a849 Mon Sep 17 00:00:00 2001 -From: He Zhe -Date: Fri, 19 Apr 2019 17:57:48 +0800 -Subject: [PATCH] file01.sh: Fix in was not recognized - -Some file has "pie" appending after LSB or MSB, which causes mismatch and the -following error. - -"file01 10 TFAIL: in: was not recognized" -..."ELF 64-bit LSB pie executable"... - -This patches tunes the regulation expression to include those cases. - -Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2019-April/011758.html] - -Signed-off-by: He Zhe ---- - testcases/commands/file/file01.sh | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/testcases/commands/file/file01.sh b/testcases/commands/file/file01.sh -index 0a8119e..55c0433 100755 ---- a/testcases/commands/file/file01.sh -+++ b/testcases/commands/file/file01.sh -@@ -91,7 +91,9 @@ do_test() - 9) file_test in.m4 "M4 macro processor script, ASCII text" \ - "ASCII M4 macro language pre-processor text";; - 10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \ -- "ELF .*-bit $TEST_ARCH shared object, .*";; -+ "ELF .*-bit $TEST_ARCH shared object, .*" \ -+ "ELF .*-bit $TEST_ARCH pie executable, .*" \ -+ "ELF .*-bit $TEST_ARCH pie shared object, .*";; - 11) file_test in.ar "current ar archive";; - 12) file_test in.tar "tar archive";; - 13) file_test in.tar.gz "gzip compressed data, .*";; --- -2.7.4 - diff --git a/meta/recipes-extended/ltp/ltp/0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch b/meta/recipes-extended/ltp/ltp/0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch deleted file mode 100644 index 7b662294f3..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch +++ /dev/null @@ -1,62 +0,0 @@ -From e79652a3839869b1983d65999e5d5dcb50bc9cd7 Mon Sep 17 00:00:00 2001 -From: "Hongzhi.Song" -Date: Mon, 15 Jul 2019 03:39:06 -0400 -Subject: [PATCH] getrlimit03: adjust a bit of code to compatiable with mips32 - -Error info: -getrlimit03.c:104: FAIL: __NR_prlimit64(0) had rlim_cur = -ffffffffffffffff but __NR_getrlimit(0) had rlim_cur = 7fffffff - -According to kernel code: [arch/mips/include/uapi/asm/resource.h] -RLIM_INFINITY is set to 0x7fffffffUL instead of ULONG_MAX on mips32. - - /* - * SuS says limits have to be unsigned. - * Which makes a ton more sense anyway, - * but we keep the old value on MIPS32, - * for compatibility: - */ - #ifndef __mips64 - # define RLIM_INFINITY 0x7fffffffUL - #endif - -Adding conditional statement about mips to fix this. - -Signed-off-by: Jan Stancek -Signed-off-by: Hongzhi.Song - -Upstream-Status: Backport -Signed-off-by: Hongzhi.Song ---- - testcases/kernel/syscalls/getrlimit/getrlimit03.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit03.c b/testcases/kernel/syscalls/getrlimit/getrlimit03.c -index e4d56c4..03bd821 100644 ---- a/testcases/kernel/syscalls/getrlimit/getrlimit03.c -+++ b/testcases/kernel/syscalls/getrlimit/getrlimit03.c -@@ -26,6 +26,7 @@ - - #include "tst_test.h" - #include "lapi/syscalls.h" -+#include "lapi/abisize.h" - - /** - * Linux provides an "old" getrlimit syscall handler that uses signed long, -@@ -61,7 +62,12 @@ struct rlimit_ulong { - unsigned long rlim_cur; - unsigned long rlim_max; - }; --const unsigned long RLIM_INFINITY_UL = ULONG_MAX; -+ -+#if defined(__mips__) && defined(TST_ABI32) -+ const unsigned long RLIM_INFINITY_UL = 0x7fffffffUL; -+#else -+ const unsigned long RLIM_INFINITY_UL = ULONG_MAX; -+#endif - - static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim) - { --- -2.8.1 - diff --git a/meta/recipes-extended/ltp/ltp/0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch b/meta/recipes-extended/ltp/ltp/0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch deleted file mode 100644 index a6129d3b94..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch +++ /dev/null @@ -1,74 +0,0 @@ -From d5293d73b760268a6b200ab7d9323e37700e6a8c Mon Sep 17 00:00:00 2001 -From: Petr Vorel -Date: Thu, 28 Mar 2019 07:11:25 +0100 -Subject: [PATCH] lapi: Define TST_ABI{,32,64} to detect target type - -This is meant to be a replacement of __WORDSIZE definition. - -Motivation was instead of finding, where all libc define -__WORDSIZE, which is usually used for detecting target type -(at least MUSL defines it in different place than other libc) -we define our own constant. - -Suggested-by: Cyril Hrubis -Signed-off-by: Petr Vorel - -Upstream-Status: Backport -Signed-off-by: Hongzhi.Song ---- - include/lapi/abisize.h | 29 +++++++++++++---------------- - 1 file changed, 13 insertions(+), 16 deletions(-) - -diff --git a/include/lapi/abisize.h b/include/lapi/abisize.h -index 897bdfd..9e6622c 100644 ---- a/include/lapi/abisize.h -+++ b/include/lapi/abisize.h -@@ -1,25 +1,22 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later - /* -- * Copyright (c) 2014 Linux Test Project -+ * Copyright (c) 2014-2019 Linux Test Project - * Cyril Hrubis -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License as -- * published by the Free Software Foundation; either version 2 of -- * the License, or (at your option) any later version. -- * -- * This program is distributed in the hope that it would be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write the Free Software Foundation, -- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ * Petr Vorel - */ - - #ifndef ABISIZE_H__ - #define ABISIZE_H__ - -+/* __WORDSIZE replacement */ -+#if defined(__LP64__) || defined(_LP64) -+# define TST_ABI64 -+# define TST_ABI 64 -+#else -+# define TST_ABI32 -+# define TST_ABI 32 -+#endif -+ - /* - * Determines if we have to split up 64 bit arguments or not - * -@@ -29,6 +26,6 @@ - (defined(__mips__) && _MIPS_SIM == _ABIN32) || \ - (defined(__x86_64__) && defined(__ILP32__)) || \ - (defined(__aarch64__) && defined(__ILP32__)) || \ -- __WORDSIZE == 64 -+ defined(TST_ABI64) - - #endif /* ABISIZE_H__ */ --- -2.8.1 - diff --git a/meta/recipes-extended/ltp/ltp/0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch b/meta/recipes-extended/ltp/ltp/0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch deleted file mode 100644 index 84736053bf..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 85c972f730e8efe891a06ea3a2dfb5cbbdfbfbf4 Mon Sep 17 00:00:00 2001 -From: "Hongzhi.Song" -Date: Wed, 10 Oct 2018 22:07:05 -0400 -Subject: [PATCH] open_posix_testsuite/mmap24-2: Relax condition a bit - -Mips will return EINVAL instead of ENOMEM as expected -if the range [addr + len) exceeds TASK_SIZE. - -Linux kernel code: arch/mips/mm/mmap.c -if (flags & MAP_FIXED) { - /* Even MAP_FIXED mappings must reside within TASK_SIZE */ - if (TASK_SIZE - len < addr) - return -EINVAL; - -Relax the condition and accept both ENOMEM and EINVAL -as expected outcome. - -Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2018-October/009624.html] - -Signed-off-by: Hongzhi.Song ---- - .../open_posix_testsuite/conformance/interfaces/mmap/24-2.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c -index de51d43..810e5c8 100644 ---- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c -+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c -@@ -7,7 +7,7 @@ - * source tree. - * - * The mmap() function shall fail if: -- * [ENOMEM] MAP_FIXED was specified, -+ * [ENOMEM or EINVAL] MAP_FIXED was specified, - * and the range [addr,addr+len) exceeds that allowed - * for the address space of a process; or, if MAP_FIXED was not specified and - * there is insufficient room in the address space to effect the mapping. -@@ -15,7 +15,7 @@ - * Test Step: - * 1. Map a shared memory object, with size exceeding the value get from - * rlim_cur of resource RLIMIT_AS, setting MAP_FIXED; -- * 3. Should get ENOMEM. -+ * 3. Should get ENOMEM or EINVAL. - */ - - #include -@@ -92,8 +92,8 @@ int main(void) - (unsigned long)len); - pa = mmap(addr, len, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, fd, - 0); -- if (pa == MAP_FAILED && errno == ENOMEM) { -- printf("Got ENOMEM: %s\nTest PASSED\n", strerror(errno)); -+ if (pa == MAP_FAILED && (errno == ENOMEM || errno == EINVAL)) { -+ printf("Got ENOMEM or EINVAL: %s\nTest PASSED\n", strerror(errno)); - exit(PTS_PASS); - } - -@@ -102,6 +102,6 @@ int main(void) - else - munmap(pa, len); - close(fd); -- printf("Test Fail: Did not get ENOMEM as expected\n"); -+ printf("Test Failed: Did not get ENOMEM or EINVAL as expected\n"); - return PTS_FAIL; - } --- -2.8.1 - diff --git a/meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch b/meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch deleted file mode 100644 index d837f073a9..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch +++ /dev/null @@ -1,81 +0,0 @@ -From db0a43d9388be2c347a8306751bbe6bec086d062 Mon Sep 17 00:00:00 2001 -From: Jan Stancek -Date: Mon, 20 May 2019 20:47:20 +0200 -Subject: [PATCH] shmctl01: don't use hardcoded index == 0 for SHM_STAT test - -Test fails on SHM_STAT testcase: - shmctl01 5 TFAIL : shmctl01.c:173: shmctl01 call failed - errno = 22 : Invalid argument - shmctl(0, SHM_STAT, 0x601060) = -EINVAL - -since following commit: - commit 99db46ea292780cd978d56932d9445b1e8bdafe8 - Author: Manfred Spraul - Date: Tue May 14 15:46:36 2019 -0700 - ipc: do cyclic id allocation for the ipc object. - -Don't rely on index 0 being always available, but instead -use (maximum) index returned by SHM_INFO. - -Signed-off-by: Jan Stancek -Reviewed-by: Petr Vorel -Acked-by: Cyril Hrubis - -Upstream-Status: Backport from v20190517 -[https://lists.linux.it/pipermail/ltp/2019-May/012051.html] - -Signed-off-by: Hongzhi Song ---- - testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 21 ++++++++++++++++++--- - 1 file changed, 18 insertions(+), 3 deletions(-) - -diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c -index 1b46977..52bf23a 100644 ---- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c -+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c -@@ -79,6 +79,7 @@ static void func_info(int ret); - - /* Check routine for SHM_STAT */ - static void func_sstat(int ret); -+static void func_sstat_setup(void); - - /* Check routine for SHM_LOCK */ - static void func_lock(int ret); -@@ -110,7 +111,7 @@ static struct test_case_t { - #endif - {&shm_id_1, IPC_SET, &buf, func_set, set_setup}, - {&shm_id_1, IPC_INFO, (struct shmid_ds *) &info, func_info, NULL}, -- {&shm_index, SHM_STAT, &buf, func_sstat, NULL}, -+ {&shm_index, SHM_STAT, &buf, func_sstat, func_sstat_setup}, - {&shm_id_1, SHM_LOCK, NULL, func_lock, NULL}, - {&shm_id_1, SHM_UNLOCK, NULL, func_unlock, NULL}, - {&shm_id_1, IPC_RMID, NULL, func_rmid, NULL}, -@@ -407,9 +408,23 @@ static void func_info(int ret) - static void func_sstat(int ret) - { - if (ret >= 0) -- tst_resm(TPASS, "get correct shared memory id"); -+ tst_resm(TPASS, "get correct shared memory id for index: %d", -+ shm_index); - else -- tst_resm(TFAIL, "shared memory id is incorrect"); -+ tst_resm(TFAIL, "shared memory id is incorrect, index: %d", -+ shm_index); -+} -+ -+static void func_sstat_setup(void) -+{ -+ struct shm_info tmp; -+ int ret; -+ -+ ret = shmctl(shm_id_1, SHM_INFO, (void *)&tmp); -+ if (ret < 0) -+ tst_resm(TFAIL|TERRNO, "shmctl(SHM_INFO)"); -+ else -+ shm_index = ret; - } - - static void func_lock(int ret) --- -2.8.1 - diff --git a/meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch b/meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch deleted file mode 100644 index 39623c37d8..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch +++ /dev/null @@ -1,70 +0,0 @@ -From db57ddc1497e72947da2b14f471ab521478ef99d Mon Sep 17 00:00:00 2001 -From: Tommi Rantala -Date: Thu, 31 Jan 2019 19:49:00 +0200 -Subject: [PATCH] syscalls/setrlimit03.c: read /proc/sys/fs/nr_open for - RLIMIT_NOFILE limit - -Since kernel v2.6.25 RLIMIT_NOFILE limit is no longer hardcoded to -NR_OPEN, but can be set via /proc/sys/fs/nr_open, see kernel commit -9cfe015aa424b3c003baba3841a60dd9b5ad319b ("get rid of NR_OPEN and -introduce a sysctl_nr_open"). - -nr_open default value is 1024*1024, so setrlimit03 has been passing fine -on new kernels, only "unexpectedly succeeding" if nr_open is set to some -larger value. - -Signed-off-by: Tommi Rantala -Reviewed-by: Cyril Hrubis - -Upstream-Status: Backport [db57ddc1497e ("syscalls/setrlimit03.c: read /proc/sys/fs/nr_open for RLIMIT_NOFILE limit")] - -Signed-off-by: He Zhe ---- - testcases/kernel/syscalls/setrlimit/setrlimit03.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit03.c b/testcases/kernel/syscalls/setrlimit/setrlimit03.c -index 29b52aa..12455fe 100644 ---- a/testcases/kernel/syscalls/setrlimit/setrlimit03.c -+++ b/testcases/kernel/syscalls/setrlimit/setrlimit03.c -@@ -35,7 +35,10 @@ - # define NR_OPEN (1024*1024) - #endif - -+#define NR_OPEN_PATH "/proc/sys/fs/nr_open" -+ - static struct rlimit rlim1, rlim2; -+static unsigned int nr_open = NR_OPEN; - - static struct tcase { - struct rlimit *rlimt; -@@ -51,7 +54,10 @@ static void verify_setrlimit(unsigned int n) - - TEST(setrlimit(RLIMIT_NOFILE, tc->rlimt)); - if (TST_RET != -1) { -- tst_res(TFAIL, "call succeeded unexpectedly"); -+ tst_res(TFAIL, "call succeeded unexpectedly " -+ "(nr_open=%u rlim_cur=%lu rlim_max=%lu)", nr_open, -+ (unsigned long)(tc->rlimt->rlim_cur), -+ (unsigned long)(tc->rlimt->rlim_max)); - return; - } - -@@ -65,10 +71,13 @@ static void verify_setrlimit(unsigned int n) - - static void setup(void) - { -+ if (!access(NR_OPEN_PATH, F_OK)) -+ SAFE_FILE_SCANF(NR_OPEN_PATH, "%u", &nr_open); -+ - SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlim1); - rlim2.rlim_max = rlim1.rlim_cur; - rlim2.rlim_cur = rlim1.rlim_max + 1; -- rlim1.rlim_max = NR_OPEN + 1; -+ rlim1.rlim_max = nr_open + 1; - } - - static struct tst_test test = { --- -2.7.4 - diff --git a/meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch new file mode 100644 index 0000000000..eff9ed0741 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch @@ -0,0 +1,47 @@ +From 81e5bd5442337a4a648a0dbbff47eaac0d351287 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 18:22:38 +0000 +Subject: [PATCH] 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 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + 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 4ca0b5a..1d85e4d 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 db6a843..86dd2a8 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.4 + diff --git a/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch new file mode 100644 index 0000000000..c0f69ecf5f --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch @@ -0,0 +1,58 @@ +From 29ce9fdab3bd34e69d73b5b890795559c06553f7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 19:40:08 +0000 +Subject: [PATCH] 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. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +Signed-off-by: Yi Zhao +--- + testcases/kernel/syscalls/accept4/accept4_01.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c +index dd289cf..76aa969 100644 +--- a/testcases/kernel/syscalls/accept4/accept4_01.c ++++ b/testcases/kernel/syscalls/accept4/accept4_01.c +@@ -38,6 +38,7 @@ + static struct sockaddr_in conn_addr; + static int listening_fd; + ++#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) +@@ -56,6 +57,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) + #endif + } + #endif ++#endif + + static int create_listening_socket(void) + { +@@ -115,6 +117,7 @@ static void verify_accept4(unsigned int nr) + SAFE_CONNECT(connfd, (struct sockaddr *)&conn_addr, sizeof(conn_addr)); + addrlen = sizeof(claddr); + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 10)) + TEST(accept4_01(listening_fd, (struct sockaddr *)&claddr, &addrlen, + tcase->cloexec | tcase->nonblock)); +@@ -122,6 +125,10 @@ static void verify_accept4(unsigned int nr) + TEST(accept4(listening_fd, (struct sockaddr *)&claddr, &addrlen, + tcase->cloexec | tcase->nonblock)); + #endif ++#else ++ TEST(accept4(listening_fd, (struct sockaddr *)&claddr, &addrlen, ++ tcase->cloexec | tcase->nonblock)); ++#endif + if (TST_RET == -1) { + if (TST_ERR == ENOSYS) + tst_brk(TCONF, "syscall __NR_accept4 not supported"); +-- +2.7.4 + 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 3c66c9436f..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 -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 -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 -@@ -49,12 +49,15 @@ SUBDIRS += connectors \ - logging \ - mem \ - numa \ -- pty \ - sched \ - security \ - timers \ - tracing \ - -+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,6 +28,11 @@ 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 - - ifeq ($(UCLIBC),1) - FILTER_OUT_DIRS += profil -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/0004-guard-mallocopt-with-__GLIBC__.patch b/meta/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch new file mode 100644 index 0000000000..5622a64d43 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch @@ -0,0 +1,34 @@ +From d0fc9ca5d3366f9b8907e463222403cd2327be10 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 8 Jan 2016 06:51:20 +0000 +Subject: [PATCH] guard mallocopt() with __GLIBC__ + +mallocopt is not available on non glibc implementations + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + 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.4 + diff --git a/meta/recipes-extended/ltp/ltp/0005-getdents-define-getdents-getdents64-only-for-glibc.patch b/meta/recipes-extended/ltp/ltp/0005-getdents-define-getdents-getdents64-only-for-glibc.patch new file mode 100644 index 0000000000..d1f7b0746b --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0005-getdents-define-getdents-getdents64-only-for-glibc.patch @@ -0,0 +1,50 @@ +From b996b2480fe3a800ffbdc4a0fdc5e8775c575449 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 8 Jan 2016 06:57:04 +0000 +Subject: [PATCH] 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. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + 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 702b0bd..860b22e 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.4 + 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 -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 -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/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch b/meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch new file mode 100644 index 0000000000..804edfa1b4 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch @@ -0,0 +1,35 @@ +From 60054686e2c1a4bedf1d507af97ebbb7ff491e77 Mon Sep 17 00:00:00 2001 +From: Yi Zhao +Date: Thu, 18 Jul 2019 15:23:15 +0800 +Subject: [PATCH] rt_tgsigqueueinfo: disable test on musl + +Fix build error with musl: +rt_tgsigqueueinfo01.c: In function 'sigusr1_handler': +rt_tgsigqueueinfo01.c:42:22: error: 'siginfo_t' {aka 'struct '} has no member named '_sifields'; did you mean '__si_fields'? + 42 | sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr; + | ^~~~~~~~~ + | __si_fields + +Upstream-Status: Pending + +Signed-off-by: Yi Zhao +--- + testcases/kernel/syscalls/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile +index d1becd0..1f3ff34 100644 +--- a/testcases/kernel/syscalls/Makefile ++++ b/testcases/kernel/syscalls/Makefile +@@ -31,7 +31,7 @@ endif + ifeq ($(LIBC),musl) + FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \ + rt_sigsuspend setdomainname sethostname sigsuspend \ +- ustat ++ ustat rt_tgsigqueueinfo + endif + + ifeq ($(UCLIBC),1) +-- +2.7.4 + diff --git a/meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch b/meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch new file mode 100644 index 0000000000..0e7264574f --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch @@ -0,0 +1,32 @@ +From f4fafbdffae3a63c81f65cef98c72dda26283e06 Mon Sep 17 00:00:00 2001 +From: Dengke Du +Date: Wed, 8 Feb 2017 16:17:17 +0800 +Subject: [PATCH] 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. + +Upstream-Status: Pending + +Signed-off-by: George Nita +Signed-off-by: Dengke Du +--- + 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 aadaae4..deea5d6 100755 +--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh ++++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh +@@ -291,6 +291,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/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 6e6dbf398b..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 -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 ---- - 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 -@@ -17,6 +17,9 @@ - #include - #include - #include -+#ifndef __GLIBC__ -+#include -+#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 7311ee2e41..0000000000 --- a/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch +++ /dev/null @@ -1,151 +0,0 @@ -From fc2b47ad979a87bfbd11aeea3f67c26e7fb39e30 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 7 Jan 2016 19:40:08 +0000 -Subject: [PATCH] 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 - -Upstream-Status: Pending ---- - .../kernel/syscalls/accept4/accept4_01.c | 9 ++++++- - .../sched_getaffinity/sched_getaffinity01.c | 26 +++++++++++++++++++ - 2 files changed, 34 insertions(+), 1 deletion(-) - -diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c -index dec4ef93b..c5d74b07f 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/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -index 02f04b909..d906d7e09 100644 ---- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -+++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c -@@ -67,9 +67,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) - { -@@ -96,17 +98,26 @@ 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); -+#else -+ len = sizeof(cpu_set_t); -+ CPU_ZERO(mask); -+#endif - #else - len = sizeof(cpu_set_t); - CPU_ZERO(mask); -@@ -115,11 +126,18 @@ realloc: - 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; - goto realloc; - } -+#else -+ if (errno == EINVAL) -+ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a " -+ "newer glibc(>= 2.7)"); -+ else -+#endif - #else - if (errno == EINVAL) - tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a " -@@ -132,8 +150,12 @@ realloc: - 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 -@@ -144,8 +166,12 @@ 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 --- -2.17.1 - diff --git a/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch new file mode 100644 index 0000000000..b46325eaf3 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch @@ -0,0 +1,41 @@ +From aa7a9185a037ad59012bd46713ac340458e95209 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= +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] + +Upstream-Status: Pending + +Signed-off-by: Aníbal Limón +--- + 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 bdf0180..898b7ca 100644 +--- a/testcases/network/nfsv4/acl/acl1.c ++++ b/testcases/network/nfsv4/acl/acl1.c +@@ -303,7 +303,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.7.4 + 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 -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 ---- - 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/0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch b/meta/recipes-extended/ltp/ltp/0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch new file mode 100644 index 0000000000..d32ac1dd7c --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch @@ -0,0 +1,68 @@ +From a8715a1446305ffd76406f63c7f160c13a5b2e72 Mon Sep 17 00:00:00 2001 +From: "Hongzhi.Song" +Date: Wed, 10 Oct 2018 22:07:05 -0400 +Subject: [PATCH] open_posix_testsuite/mmap24-2: Relax condition a bit + +Mips will return EINVAL instead of ENOMEM as expected +if the range [addr + len) exceeds TASK_SIZE. + +Linux kernel code: arch/mips/mm/mmap.c +if (flags & MAP_FIXED) { + /* Even MAP_FIXED mappings must reside within TASK_SIZE */ + if (TASK_SIZE - len < addr) + return -EINVAL; + +Relax the condition and accept both ENOMEM and EINVAL +as expected outcome. + +Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2018-October/009624.html] + +Signed-off-by: Hongzhi.Song +--- + .../open_posix_testsuite/conformance/interfaces/mmap/24-2.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c +index 9cf83d9..55090a6 100644 +--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c ++++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c +@@ -7,7 +7,7 @@ + * source tree. + * + * The mmap() function shall fail if: +- * [ENOMEM] MAP_FIXED was specified, ++ * [ENOMEM or EINVAL] MAP_FIXED was specified, + * and the range [addr,addr+len) exceeds that allowed + * for the address space of a process; or, if MAP_FIXED was not specified and + * there is insufficient room in the address space to effect the mapping. +@@ -15,7 +15,7 @@ + * Test Step: + * 1. Map a shared memory object, with size exceeding the value get from + * rlim_cur of resource RLIMIT_AS, setting MAP_FIXED; +- * 3. Should get ENOMEM. ++ * 3. Should get ENOMEM or EINVAL. + */ + + #include +@@ -92,8 +92,8 @@ int main(void) + (unsigned long)len); + pa = mmap(addr, len, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, fd, + 0); +- if (pa == MAP_FAILED && errno == ENOMEM) { +- printf("Got ENOMEM: %s\nTest PASSED\n", strerror(errno)); ++ if (pa == MAP_FAILED && (errno == ENOMEM || errno == EINVAL)) { ++ printf("Got ENOMEM or EINVAL: %s\nTest PASSED\n", strerror(errno)); + exit(PTS_PASS); + } + +@@ -102,6 +102,6 @@ int main(void) + else + munmap(pa, len); + close(fd); +- printf("Test Fail: Did not get ENOMEM as expected\n"); ++ printf("Test Failed: Did not get ENOMEM or EINVAL as expected\n"); + return PTS_FAIL; + } +-- +2.7.4 + diff --git a/meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch b/meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch new file mode 100644 index 0000000000..8704e5ffe8 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch @@ -0,0 +1,82 @@ +From 794933b38354a2612cf2c471f11798b306f35315 Mon Sep 17 00:00:00 2001 +From: Jan Stancek +Date: Mon, 20 May 2019 20:47:20 +0200 +Subject: [PATCH] shmctl01: don't use hardcoded index == 0 for SHM_STAT test + +Test fails on SHM_STAT testcase: + shmctl01 5 TFAIL : shmctl01.c:173: shmctl01 call failed + errno = 22 : Invalid argument + shmctl(0, SHM_STAT, 0x601060) = -EINVAL + +since following commit: + commit 99db46ea292780cd978d56932d9445b1e8bdafe8 + Author: Manfred Spraul + Date: Tue May 14 15:46:36 2019 -0700 + ipc: do cyclic id allocation for the ipc object. + +Don't rely on index 0 being always available, but instead +use (maximum) index returned by SHM_INFO. + +Signed-off-by: Jan Stancek +Reviewed-by: Petr Vorel +Acked-by: Cyril Hrubis + +Upstream-Status: Backport +[https://github.com/linux-test-project/ltp/commit/db0a43d9388be2c347a8306751bbe6bec086d062] + +Signed-off-by: Hongzhi Song +Signed-off-by: Yi Zhao +--- + testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) + +diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +index 1b46977..52bf23a 100644 +--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c ++++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +@@ -79,6 +79,7 @@ static void func_info(int ret); + + /* Check routine for SHM_STAT */ + static void func_sstat(int ret); ++static void func_sstat_setup(void); + + /* Check routine for SHM_LOCK */ + static void func_lock(int ret); +@@ -110,7 +111,7 @@ static struct test_case_t { + #endif + {&shm_id_1, IPC_SET, &buf, func_set, set_setup}, + {&shm_id_1, IPC_INFO, (struct shmid_ds *) &info, func_info, NULL}, +- {&shm_index, SHM_STAT, &buf, func_sstat, NULL}, ++ {&shm_index, SHM_STAT, &buf, func_sstat, func_sstat_setup}, + {&shm_id_1, SHM_LOCK, NULL, func_lock, NULL}, + {&shm_id_1, SHM_UNLOCK, NULL, func_unlock, NULL}, + {&shm_id_1, IPC_RMID, NULL, func_rmid, NULL}, +@@ -407,9 +408,23 @@ static void func_info(int ret) + static void func_sstat(int ret) + { + if (ret >= 0) +- tst_resm(TPASS, "get correct shared memory id"); ++ tst_resm(TPASS, "get correct shared memory id for index: %d", ++ shm_index); + else +- tst_resm(TFAIL, "shared memory id is incorrect"); ++ tst_resm(TFAIL, "shared memory id is incorrect, index: %d", ++ shm_index); ++} ++ ++static void func_sstat_setup(void) ++{ ++ struct shm_info tmp; ++ int ret; ++ ++ ret = shmctl(shm_id_1, SHM_INFO, (void *)&tmp); ++ if (ret < 0) ++ tst_resm(TFAIL|TERRNO, "shmctl(SHM_INFO)"); ++ else ++ shm_index = ret; + } + + static void func_lock(int ret) +-- +2.7.4 + diff --git a/meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch b/meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch new file mode 100644 index 0000000000..9cd188f656 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch @@ -0,0 +1,56 @@ +From f210d7e19b721041f31b7f258a169f89dc850303 Mon Sep 17 00:00:00 2001 +From: Jan Stancek +Date: Thu, 4 Jul 2019 16:45:23 +0200 +Subject: [PATCH] direct_io/diotest4: drop MAP_FIXED + +Hongzhi reports that this test is failing on mips64 with 5.1+: + diotest4 10 TBROK : diotest4.c:368: can't mmap file: Invalid argument + diotest4 11 TBROK : diotest4.c:368: Remaining cases broken +I could reproduce it on emulated 5kc-malta, running 5.2.0-rc7. + +Test is trying to map into area immediately following heap as MAP_SHARED, +but it used wrong alignment (fixed by 'lapi/mmap.h: include config.h'). + +Usage of MAP_FIXED seems unnecessary, so drop that too and let the kernel +pick an address. + +Reported-by: Hongzhi.Song +Signed-off-by: Jan Stancek +Acked-by: Cyril Hrubis + +Upstream-Status: Backport +[https://github.com/linux-test-project/ltp/commit/f5444eeeabf252b8884b9465d277b6af853819e3] + +Signed-off-by: Yi Zhao +--- + testcases/kernel/io/direct_io/diotest4.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c +index e4616e4..bf200cd 100644 +--- a/testcases/kernel/io/direct_io/diotest4.c ++++ b/testcases/kernel/io/direct_io/diotest4.c +@@ -352,18 +352,14 @@ int main(int argc, char *argv[]) + total++; + + /* Test-10: read, write to a mmaped file */ +- shm_base = (char *)(((long)sbrk(0) + (shmsz - 1)) & ~(shmsz - 1)); +- if (shm_base == NULL) { +- tst_brkm(TBROK, cleanup, "sbrk failed: %s", strerror(errno)); +- } + offset = 4096; + count = bufsize; + if ((fd = open(filename, O_DIRECT | O_RDWR)) < 0) { + tst_brkm(TBROK, cleanup, "can't open %s: %s", + filename, strerror(errno)); + } +- shm_base = mmap(shm_base, 0x100000, PROT_READ | PROT_WRITE, +- MAP_SHARED | MAP_FIXED, fd, 0); ++ shm_base = mmap(0, 0x100000, PROT_READ | PROT_WRITE, ++ MAP_SHARED, fd, 0); + if (shm_base == (caddr_t) - 1) { + tst_brkm(TBROK, cleanup, "can't mmap file: %s", + strerror(errno)); +-- +2.7.4 + diff --git a/meta/recipes-extended/ltp/ltp/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch b/meta/recipes-extended/ltp/ltp/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch new file mode 100644 index 0000000000..aecbc80e9b --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch @@ -0,0 +1,64 @@ +From 4ac747c1f7ff8e2ec2567d6672822e95a9b56e55 Mon Sep 17 00:00:00 2001 +From: "Hongzhi.Song" +Date: Mon, 15 Jul 2019 03:39:06 -0400 +Subject: [PATCH] getrlimit03: adjust a bit of code to compatiable with mips32 + +Error info: +getrlimit03.c:104: FAIL: __NR_prlimit64(0) had rlim_cur = +ffffffffffffffff but __NR_getrlimit(0) had rlim_cur = 7fffffff + +According to kernel code: [arch/mips/include/uapi/asm/resource.h] +RLIM_INFINITY is set to 0x7fffffffUL instead of ULONG_MAX on mips32. + + /* + * SuS says limits have to be unsigned. + * Which makes a ton more sense anyway, + * but we keep the old value on MIPS32, + * for compatibility: + */ + #ifndef __mips64 + # define RLIM_INFINITY 0x7fffffffUL + #endif + +Adding conditional statement about mips to fix this. + +Signed-off-by: Jan Stancek +Signed-off-by: Hongzhi.Song + +Upstream-Status: Backport +[https://github.com/linux-test-project/ltp/commit/7a3bca63cd7f059d490b6274f0fdf3247be93fde] + +Signed-off-by: Hongzhi.Song +--- + testcases/kernel/syscalls/getrlimit/getrlimit03.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit03.c b/testcases/kernel/syscalls/getrlimit/getrlimit03.c +index e4d56c4..319bc49 100644 +--- a/testcases/kernel/syscalls/getrlimit/getrlimit03.c ++++ b/testcases/kernel/syscalls/getrlimit/getrlimit03.c +@@ -26,6 +26,7 @@ + + #include "tst_test.h" + #include "lapi/syscalls.h" ++#include "lapi/abisize.h" + + /** + * Linux provides an "old" getrlimit syscall handler that uses signed long, +@@ -61,7 +62,12 @@ struct rlimit_ulong { + unsigned long rlim_cur; + unsigned long rlim_max; + }; +-const unsigned long RLIM_INFINITY_UL = ULONG_MAX; ++ ++#if defined(__mips__) && defined(TST_ABI32) ++ const unsigned long RLIM_INFINITY_UL = 0x7fffffffUL; ++#else ++ const unsigned long RLIM_INFINITY_UL = ULONG_MAX; ++#endif + + static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim) + { +-- +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 -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 -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 -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 - -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 6c5f360351..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 -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 - -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 - #include -+#include -+#define _GNU_SOURCE - #define __USE_GNU - #include - #undef __USE_GNU --#include -+#undef _GNU_SOURCE - - #include "test.h" - #include "safe_macros.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 - #include - #include -+#define _GNU_SOURCE - #define __USE_GNU - #include - #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 - #include - #include -+#define _GNU_SOURCE - #define __USE_GNU - #include - #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 -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 - -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 -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 - -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 - #include - #include -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 - #include - #include -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 - #include - #include -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 - #include - #include --- -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 -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 - -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 - #include - #include --- -2.7.0 - 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 40ee894143..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 -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 - -Upstream-Status: Pending ---- - include/lapi/rt_sigaction.h | 4 ++-- - testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++ - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h -index 18236db..15facda 100644 ---- a/include/lapi/rt_sigaction.h -+++ b/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; -diff --git a/testcases/kernel/syscalls/rt_sigsuspend/Makefile b/testcases/kernel/syscalls/rt_sigsuspend/Makefile -index 37bc3a9..2ca7f7c 100644 ---- a/testcases/kernel/syscalls/rt_sigsuspend/Makefile -+++ b/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/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 -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 -Upstream-Status: Pending - -Signed-off-by: Dengke Du ---- - .../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 665da3bef3..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 -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 -Signed-off-by: Dengke Du - -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 -@@ -291,6 +291,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 e826d48e3b..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?= -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 - -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 -@@ -303,7 +303,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/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch b/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch deleted file mode 100644 index ec5e2ef95a..0000000000 --- a/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch +++ /dev/null @@ -1,254 +0,0 @@ -From 04da9478887e705ea38e4f097492da20e651686c Mon Sep 17 00:00:00 2001 -From: Guangwen Feng -Date: Wed, 13 Sep 2017 15:48:42 +0800 -Subject: [PATCH] commands/ar01: Fix for test in deterministic mode - -If binutils was configured with --enable-deterministic-archives, -ar will run in deterministic mode by default, and use zero for -timestamps and uids/gids, which makes the test case abnormal. - -Fix this by add the "U" modifier when deterministic mode is default. - -Signed-off-by: Guangwen Feng -Signed-off-by: Fei Jie - -Upstream-Status: Backport -[http://lists.linux.it/pipermail/ltp/2017-September/005668.html] - -Signed-off-by: Yi Zhao ---- - testcases/commands/ar/ar01 | 92 ++++++++++++++++++++++++++-------------------- - 1 file changed, 52 insertions(+), 40 deletions(-) - -diff --git a/testcases/commands/ar/ar01 b/testcases/commands/ar/ar01 -index be105f6da..813a51d9c 100644 ---- a/testcases/commands/ar/ar01 -+++ b/testcases/commands/ar/ar01 -@@ -24,16 +24,28 @@ - # - AR="${AR:=ar}" - TST_CNT=17 -+TST_SETUP=setup - TST_TESTFUNC=test - TST_NEEDS_TMPDIR=1 - TST_NEEDS_CMDS="$AR" - - . tst_test.sh - -+setup() -+{ -+ ar --help | grep "use zero for timestamps and uids/gids (default)" \ -+ >/dev/null -+ if [ $? -eq 0 ]; then -+ MOD="U" -+ else -+ MOD="" -+ fi -+} -+ - test1() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -- ROD ar -ra file1.in lib.a $TST_DATAROOT/file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -+ ROD ar -ra"$MOD" file1.in lib.a $TST_DATAROOT/file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -50,9 +62,9 @@ test1() - - test2() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in -- ROD ar -ma file1.in lib.a file4.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in -+ ROD ar -ma"$MOD" file1.in lib.a file4.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile4.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -69,8 +81,8 @@ test2() - - test3() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -- ROD ar -rb file3.in lib.a $TST_DATAROOT/file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -+ ROD ar -rb"$MOD" file3.in lib.a $TST_DATAROOT/file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -87,9 +99,9 @@ test3() - - test4() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -- $TST_DATAROOT/file2.in -- ROD ar -mb file3.in lib.a file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -+ $TST_DATAROOT/file2.in -+ ROD ar -mb"$MOD" file3.in lib.a file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -106,7 +118,7 @@ test4() - - test5() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in \> ar.out -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out - - if [ -s ar.out ]; then - tst_res TFAIL "ar produced output unexpectedly (-c)" -@@ -120,7 +132,7 @@ test5() - - test6() - { -- ROD ar -qc lib.a $TST_DATAROOT/file1.in \> ar.out -+ ROD ar -qc"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out - - if [ -s ar.out ]; then - tst_res TFAIL "ar produced output unexpectedly (-qc)" -@@ -134,9 +146,9 @@ test6() - - test7() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -d lib.a file1.in file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -d"$MOD" lib.a file1.in file2.in - ROD ar -t lib.a \> ar.out - - printf "file3.in\n" > ar.exp -@@ -153,9 +165,9 @@ test7() - - test8() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -d lib.a -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -d"$MOD" lib.a - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -172,8 +184,8 @@ test8() - - test9() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -- ROD ar -ri file3.in lib.a $TST_DATAROOT/file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in -+ ROD ar -ri"$MOD" file3.in lib.a $TST_DATAROOT/file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -190,9 +202,9 @@ test9() - - test10() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -- $TST_DATAROOT/file2.in -- ROD ar -mi file3.in lib.a file2.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -+ $TST_DATAROOT/file2.in -+ ROD ar -mi"$MOD" file3.in lib.a file2.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -209,9 +221,9 @@ test10() - - test11() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -- $TST_DATAROOT/file2.in -- ROD ar -m lib.a file3.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ -+ $TST_DATAROOT/file2.in -+ ROD ar -m"$MOD" lib.a file3.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp -@@ -228,9 +240,9 @@ test11() - - test12() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -p lib.a \> ar.out -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -p"$MOD" lib.a \> ar.out - - printf "This is file one\nThis is file two\nThis is file three\n" > ar.exp - -@@ -247,9 +259,9 @@ test12() - test13() - { - -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -q lib.a $TST_DATAROOT/file4.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -q"$MOD" lib.a $TST_DATAROOT/file4.in - ROD ar -t lib.a \> ar.out - - printf "file1.in\nfile2.in\nfile3.in\nfile4.in\n" > ar.exp -@@ -267,14 +279,14 @@ test13() - test14() - { - ROD touch file0.in -- ROD ar -cr lib.a file0.in $TST_DATAROOT/file1.in -+ ROD ar -cr"$MOD" lib.a file0.in $TST_DATAROOT/file1.in - - file0_mtime1=$(ar -tv lib.a | grep file0.in) - file1_mtime1=$(ar -tv lib.a | grep file1.in) - - touch -c -t $(date --date='next day' +"%Y%m%d%H%M") file0.in - -- ROD ar -ru lib.a file0.in $TST_DATAROOT/file1.in -+ ROD ar -ru"$MOD" lib.a file0.in $TST_DATAROOT/file1.in - - file0_mtime2=$(ar -tv lib.a | grep file0.in) - file1_mtime2=$(ar -tv lib.a | grep file1.in) -@@ -296,7 +308,7 @@ test14() - - test15() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in - ROD ar -tv lib.a \> ar.out - - if grep -q '[rwx-]\{9\} [0-9].*/[0-9].*\s*[0-9].*.*file1.in' ar.out; then -@@ -311,9 +323,9 @@ test15() - - test16() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -- $TST_DATAROOT/file3.in -- ROD ar -xv lib.a \> ar.out -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ -+ $TST_DATAROOT/file3.in -+ ROD ar -xv"$MOD" lib.a \> ar.out - - printf "x - file1.in\nx - file2.in\nx - file3.in\n" > ar.exp - -@@ -335,8 +347,8 @@ test16() - - test17() - { -- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in -- ROD ar -xv lib.a file2.in \> ar.out -+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in -+ ROD ar -xv"$MOD" lib.a file2.in \> ar.out - - printf "x - file2.in\n" > ar.exp - --- -2.19.0.rc2 - diff --git a/meta/recipes-extended/ltp/ltp/define-sigrtmin-and-sigrtmax-for-musl.patch b/meta/recipes-extended/ltp/ltp/define-sigrtmin-and-sigrtmax-for-musl.patch deleted file mode 100644 index c324463e62..0000000000 --- a/meta/recipes-extended/ltp/ltp/define-sigrtmin-and-sigrtmax-for-musl.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 34b91edc70709f32b44f6b3a32c8f18db393e36c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Daniel=20D=C3=ADaz?= -Date: Wed, 20 Feb 2019 08:07:27 -0600 -Subject: [PATCH] Define __SIGRTMIN and __SIGRTMAX for MUSL -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Some libc implementations might differ in the definitions they -include. Exempli gratia: MUSL does not define __SIGRTMAX nor -__SIGRTMIN. - -These two tests fail to build because of the missing -definitions: - testcases/kernel/syscalls/ptrace/ptrace05.c - testcases/kernel/syscalls/sighold/sighold02.c - -Out of precaution, these two also include this header: - lib/tst_sig.c - testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c - -Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2019-February/010916.html] - -Signed-off-by: Daniel Díaz ---- - include/lapi/signal.h | 24 +++++++++++++++++++ - lib/tst_sig.c | 1 + - testcases/kernel/syscalls/ptrace/ptrace05.c | 1 + - .../syscalls/rt_sigsuspend/rt_sigsuspend01.c | 1 + - testcases/kernel/syscalls/sighold/sighold02.c | 1 + - 5 files changed, 28 insertions(+) - create mode 100644 include/lapi/signal.h - -diff --git a/include/lapi/signal.h b/include/lapi/signal.h -new file mode 100644 -index 000000000..d22965a94 ---- /dev/null -+++ b/include/lapi/signal.h -@@ -0,0 +1,24 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+/* -+ * Copyright (c) 2019 Linaro Limited. All rights reserved. -+ * Author: Daniel Díaz -+ */ -+ -+#ifndef LAPI_SIGNAL_H -+#define LAPI_SIGNAL_H -+ -+#include -+ -+/* -+ * Some libc implementations might differ in the definitions they include. This -+ * covers those differences for all tests to successfully build. -+ */ -+ -+#ifndef __SIGRTMIN -+# define __SIGRTMIN 32 -+#endif -+#ifndef __SIGRTMAX -+# define __SIGRTMAX (_NSIG - 1) -+#endif -+ -+#endif -diff --git a/lib/tst_sig.c b/lib/tst_sig.c -index 36565e13d..6d77aeafd 100644 ---- a/lib/tst_sig.c -+++ b/lib/tst_sig.c -@@ -72,6 +72,7 @@ - #include - #include - #include "test.h" -+#include "lapi/signal.h" - - #define MAXMESG 150 /* size of mesg string sent to tst_res */ - -diff --git a/testcases/kernel/syscalls/ptrace/ptrace05.c b/testcases/kernel/syscalls/ptrace/ptrace05.c -index 420330029..54cfa4d7b 100644 ---- a/testcases/kernel/syscalls/ptrace/ptrace05.c -+++ b/testcases/kernel/syscalls/ptrace/ptrace05.c -@@ -38,6 +38,7 @@ - #include "ptrace.h" - - #include "test.h" -+#include "lapi/signal.h" - - char *TCID = "ptrace05"; - int TST_TOTAL = 0; -diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c -index f17a9aae6..e577cf227 100644 ---- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c -+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c -@@ -18,6 +18,7 @@ - #include "tst_test.h" - #include "lapi/syscalls.h" - #include "lapi/safe_rt_signal.h" -+#include "lapi/signal.h" - - static void sig_handler(int sig) - { -diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c -index d1d4b0b06..b763142df 100644 ---- a/testcases/kernel/syscalls/sighold/sighold02.c -+++ b/testcases/kernel/syscalls/sighold/sighold02.c -@@ -49,6 +49,7 @@ - #include - #include "test.h" - #include "safe_macros.h" -+#include "lapi/signal.h" - - /* _XOPEN_SOURCE disables NSIG */ - #ifndef NSIG --- -2.17.1 - diff --git a/meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch b/meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch deleted file mode 100644 index 24449148f2..0000000000 --- a/meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 430e05c2169ed15aaa6d7f9459edd607603cee02 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Daniel=20D=C3=ADaz?= -Date: Mon, 25 Feb 2019 10:44:33 -0600 -Subject: [PATCH] setregid01: Fix security warning for string formatting -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -GCC 8.2.0 complains with the following: - setregid01.c: In function 'run': - setregid01.c:47:3: error: format not a string literal and no format arguments [-Werror=format-security] - tst_res(TFAIL | TTERRNO, tc->msg); - ^~~~~~~ -because there is no string formatting in the message. This can -be seen with CFLAGS set to: - -Wformat -Wformat-security -Werror=format-security -as Yocto Project's Poky does, e.g.: - http://errors.yoctoproject.org/Errors/Details/230043/ - -Upstream-Status: Backport [46e1eda55f188810e6bf3a939b92d604321807ae] - -Signed-off-by: Daniel Díaz -Reviewed-by: Enji Cooper ---- - testcases/kernel/syscalls/setregid/setregid01.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/testcases/kernel/syscalls/setregid/setregid01.c b/testcases/kernel/syscalls/setregid/setregid01.c -index f2e41e134..8c9e11918 100644 ---- a/testcases/kernel/syscalls/setregid/setregid01.c -+++ b/testcases/kernel/syscalls/setregid/setregid01.c -@@ -44,9 +44,9 @@ static void run(unsigned int n) - TEST(SETREGID(*tc->arg1, *tc->arg2)); - - if (TST_RET == -1) -- tst_res(TFAIL | TTERRNO, tc->msg); -+ tst_res(TFAIL | TTERRNO, "%s", tc->msg); - else -- tst_res(TPASS, tc->msg); -+ tst_res(TPASS, "%s", tc->msg); - } - - static void setup(void) --- -2.17.1 - diff --git a/meta/recipes-extended/ltp/ltp_20190115.bb b/meta/recipes-extended/ltp/ltp_20190115.bb deleted file mode 100644 index f208b712dd..0000000000 --- a/meta/recipes-extended/ltp/ltp_20190115.bb +++ /dev/null @@ -1,128 +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 = "https://linux-test-project.github.io/" -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://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 " - -# 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" - -CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" -CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" -SRCREV = "a6a5caef13632e669dda27b0461726eba546a2f3" - -SRC_URI = "git://github.com/linux-test-project/ltp.git \ - 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://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://0026-crash01-Define-_GNU_SOURCE.patch \ - file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.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://0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch \ - file://0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \ - file://define-sigrtmin-and-sigrtmax-for-musl.patch \ - file://setregid01-security-string-formatting.patch \ - file://0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch \ - file://0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch \ - file://0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch \ - file://0001-file01.sh-Fix-in-was-not-recognized.patch \ - file://0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch \ - file://0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.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 --with-open-posix-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 \ - file \ - gawk \ - gzip \ - iproute2 \ - ldd \ - libaio \ - logrotate \ - perl \ - python-core \ - procps \ - quota \ - unzip \ - util-linux \ - which \ - tar \ -" - -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/* /opt/ltp/testcases/data/nm01/lib.a /opt/ltp/lib/libmem.a" - -# Avoid stripping some generated binaries otherwise some of the ltp tests such as ldd01 & nm01 fail -INHIBIT_PACKAGE_STRIP_FILES = "/opt/ltp/testcases/bin/nm01 /opt/ltp/testcases/bin/ldd01" -INSANE_SKIP_${PN} += "already-stripped staticdev" - -# 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_20190517.bb b/meta/recipes-extended/ltp/ltp_20190517.bb new file mode 100644 index 0000000000..1f3a94bdfa --- /dev/null +++ b/meta/recipes-extended/ltp/ltp_20190517.bb @@ -0,0 +1,115 @@ +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 = "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://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 " + +# 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" + +CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" +CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" +SRCREV = "ac33ef87f0b9dc56533026435be3ea8c67ce86d2" + +SRC_URI = "git://github.com/linux-test-project/ltp.git \ + file://0001-build-Add-option-to-select-libc-implementation.patch \ + file://0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \ + file://0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ + file://0004-guard-mallocopt-with-__GLIBC__.patch \ + file://0005-getdents-define-getdents-getdents64-only-for-glibc.patch \ + file://0006-rt_tgsigqueueinfo-disable-test-on-musl.patch \ + file://0007-Fix-test_proc_kill-hanging.patch \ + file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ + file://0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \ + file://0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch \ + file://0011-direct_io-diotest4-drop-MAP_FIXED.patch \ + file://0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.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 --with-open-posix-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 \ + file \ + gawk \ + gzip \ + iproute2 \ + ldd \ + libaio \ + logrotate \ + perl \ + python-core \ + procps \ + quota \ + unzip \ + util-linux \ + which \ + tar \ +" + +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/* /opt/ltp/testcases/data/nm01/lib.a /opt/ltp/lib/libmem.a" + +# Avoid stripping some generated binaries otherwise some of the ltp tests such as ldd01 & nm01 fail +INHIBIT_PACKAGE_STRIP_FILES = "/opt/ltp/testcases/bin/nm01 /opt/ltp/testcases/bin/ldd01" +INSANE_SKIP_${PN} += "already-stripped staticdev" + +# 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' -- cgit v1.2.3-54-g00ecf