summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2019-07-19 13:13:18 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-19 16:19:14 +0100
commita921c2f9dbefde3592bfe65c80ff1ce973aac89b (patch)
tree26b492438631afde3c24b777ed7f960a750c26d7
parent161d036569c17d28a1ce625a1c2e258fb6cb18c3 (diff)
downloadpoky-a921c2f9dbefde3592bfe65c80ff1ce973aac89b.tar.gz
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 <yi.zhao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch (renamed from meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch)27
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-file01.sh-Fix-in-was-not-recognized.patch38
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch74
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch70
-rw-r--r--meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch (renamed from meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch)13
-rw-r--r--meta/recipes-extended/ltp/ltp/0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch58
-rw-r--r--meta/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch (renamed from meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch)9
-rw-r--r--meta/recipes-extended/ltp/ltp/0005-getdents-define-getdents-getdents64-only-for-glibc.patch (renamed from meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch)12
-rw-r--r--meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch35
-rw-r--r--meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch (renamed from meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch)10
-rw-r--r--meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch31
-rw-r--r--meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch151
-rw-r--r--meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch (renamed from meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch)14
-rw-r--r--meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch36
-rw-r--r--meta/recipes-extended/ltp/ltp/0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch (renamed from meta/recipes-extended/ltp/ltp/0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch)6
-rw-r--r--meta/recipes-extended/ltp/ltp/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch (renamed from meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch)9
-rw-r--r--meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch (renamed from meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch)35
-rw-r--r--meta/recipes-extended/ltp/ltp/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch (renamed from meta/recipes-extended/ltp/ltp/0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch)8
-rw-r--r--meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch73
-rw-r--r--meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch50
-rw-r--r--meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch70
-rw-r--r--meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch31
-rw-r--r--meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch48
-rw-r--r--meta/recipes-extended/ltp/ltp/0034-periodic_output.patch55
-rw-r--r--meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch254
-rw-r--r--meta/recipes-extended/ltp/ltp/define-sigrtmin-and-sigrtmax-for-musl.patch114
-rw-r--r--meta/recipes-extended/ltp/ltp/setregid01-security-string-formatting.patch46
-rw-r--r--meta/recipes-extended/ltp/ltp_20190517.bb (renamed from meta/recipes-extended/ltp/ltp_20190115.bb)39
28 files changed, 184 insertions, 1232 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch
index 3c66c9436f..b5c25c56a5 100644
--- a/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
+++ b/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch
@@ -1,7 +1,7 @@
1From 53acddddf1b324e06af886ee4639b774e5c8c8bc Mon Sep 17 00:00:00 2001 1From ec282980e6eee96f5b74aba464141f86049263e6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:19:03 +0000 3Date: Thu, 7 Jan 2016 18:19:03 +0000
4Subject: [PATCH 04/32] build: Add option to select libc implementation 4Subject: [PATCH] build: Add option to select libc implementation
5 5
6There are more than glibc for C library implementation available on 6There are more than glibc for C library implementation available on
7linux now a days, uclibc cloaked like glibc but musl e.g. is very 7linux now a days, uclibc cloaked like glibc but musl e.g. is very
@@ -9,8 +9,9 @@ different and does not implement all GNU extentions
9 9
10Disable tests specifically not building _yet_ on musl based systems 10Disable tests specifically not building _yet_ on musl based systems
11 11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Upstream-Status: Pending 12Upstream-Status: Pending
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
14--- 15---
15 Makefile | 5 +++++ 16 Makefile | 5 +++++
16 testcases/kernel/Makefile | 5 ++++- 17 testcases/kernel/Makefile | 5 ++++-
@@ -23,10 +24,10 @@ Upstream-Status: Pending
23 8 files changed, 35 insertions(+), 2 deletions(-) 24 8 files changed, 35 insertions(+), 2 deletions(-)
24 25
25diff --git a/Makefile b/Makefile 26diff --git a/Makefile b/Makefile
26index 297f8e7..906b280 100644 27index 768ca46..e9d679a 100644
27--- a/Makefile 28--- a/Makefile
28+++ b/Makefile 29+++ b/Makefile
29@@ -49,6 +49,11 @@ SKIP_IDCHECK ?= 0 30@@ -41,6 +41,11 @@ vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include
30 UCLINUX ?= 0 31 UCLINUX ?= 0
31 export UCLINUX 32 export UCLINUX
32 33
@@ -39,7 +40,7 @@ index 297f8e7..906b280 100644
39 # COMMON_TARGETS: Targets which exist in all, clean, and install. 40 # COMMON_TARGETS: Targets which exist in all, clean, and install.
40 # INSTALL_TARGETS: Targets which exist in clean and install (contains 41 # INSTALL_TARGETS: Targets which exist in clean and install (contains
41diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile 42diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
42index 50a12fa..4f1987f 100644 43index 39d79c7..24a57d9 100644
43--- a/testcases/kernel/Makefile 44--- a/testcases/kernel/Makefile
44+++ b/testcases/kernel/Makefile 45+++ b/testcases/kernel/Makefile
45@@ -49,12 +49,15 @@ SUBDIRS += connectors \ 46@@ -49,12 +49,15 @@ SUBDIRS += connectors \
@@ -60,7 +61,7 @@ index 50a12fa..4f1987f 100644
60 SUBDIRS += power_management 61 SUBDIRS += power_management
61 endif 62 endif
62diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile 63diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile
63index 6245ed0..aa4eb7f 100644 64index 6a57d79..74bb933 100644
64--- a/testcases/kernel/sched/Makefile 65--- a/testcases/kernel/sched/Makefile
65+++ b/testcases/kernel/sched/Makefile 66+++ b/testcases/kernel/sched/Makefile
66@@ -23,5 +23,7 @@ 67@@ -23,5 +23,7 @@
@@ -73,7 +74,7 @@ index 6245ed0..aa4eb7f 100644
73+endif 74+endif
74 include $(top_srcdir)/include/mk/generic_trunk_target.mk 75 include $(top_srcdir)/include/mk/generic_trunk_target.mk
75diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile 76diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
76index 8acb395..b749126 100644 77index 45a00cf..d1becd0 100644
77--- a/testcases/kernel/syscalls/Makefile 78--- a/testcases/kernel/syscalls/Makefile
78+++ b/testcases/kernel/syscalls/Makefile 79+++ b/testcases/kernel/syscalls/Makefile
79@@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1) 80@@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1)
@@ -89,7 +90,7 @@ index 8acb395..b749126 100644
89 ifeq ($(UCLIBC),1) 90 ifeq ($(UCLIBC),1)
90 FILTER_OUT_DIRS += profil 91 FILTER_OUT_DIRS += profil
91diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile 92diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile
92index 8bc78c2..c36cf50 100644 93index 8c55a6b..f7cda62 100644
93--- a/testcases/network/nfsv4/acl/Makefile 94--- a/testcases/network/nfsv4/acl/Makefile
94+++ b/testcases/network/nfsv4/acl/Makefile 95+++ b/testcases/network/nfsv4/acl/Makefile
95@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk 96@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk
@@ -102,7 +103,7 @@ index 8bc78c2..c36cf50 100644
102+ 103+
103 include $(top_srcdir)/include/mk/generic_leaf_target.mk 104 include $(top_srcdir)/include/mk/generic_leaf_target.mk
104diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile 105diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile
105index 3160813..9bdf5d0 100644 106index 66e9d56..ea8eb8a 100644
106--- a/testcases/network/rpc/basic_tests/Makefile 107--- a/testcases/network/rpc/basic_tests/Makefile
107+++ b/testcases/network/rpc/basic_tests/Makefile 108+++ b/testcases/network/rpc/basic_tests/Makefile
108@@ -23,4 +23,9 @@ 109@@ -23,4 +23,9 @@
@@ -116,7 +117,7 @@ index 3160813..9bdf5d0 100644
116+ 117+
117 include $(top_srcdir)/include/mk/generic_trunk_target.mk 118 include $(top_srcdir)/include/mk/generic_trunk_target.mk
118diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile 119diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile
119index 7a7a57a..5808866 100644 120index 68616a7..748754b 100644
120--- a/testcases/realtime/func/pi-tests/Makefile 121--- a/testcases/realtime/func/pi-tests/Makefile
121+++ b/testcases/realtime/func/pi-tests/Makefile 122+++ b/testcases/realtime/func/pi-tests/Makefile
122@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk 123@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk
@@ -130,7 +131,7 @@ index 7a7a57a..5808866 100644
130 131
131 include $(top_srcdir)/include/mk/generic_leaf_target.mk 132 include $(top_srcdir)/include/mk/generic_leaf_target.mk
132diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile 133diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile
133index 5edc3b4..aa5987a 100644 134index 1881f75..266e0b8 100644
134--- a/testcases/realtime/stress/pi-tests/Makefile 135--- a/testcases/realtime/stress/pi-tests/Makefile
135+++ b/testcases/realtime/stress/pi-tests/Makefile 136+++ b/testcases/realtime/stress/pi-tests/Makefile
136@@ -24,4 +24,9 @@ top_srcdir ?= ../../../.. 137@@ -24,4 +24,9 @@ top_srcdir ?= ../../../..
@@ -144,5 +145,5 @@ index 5edc3b4..aa5987a 100644
144+ 145+
145 include $(top_srcdir)/include/mk/generic_leaf_target.mk 146 include $(top_srcdir)/include/mk/generic_leaf_target.mk
146-- 147--
1472.7.0 1482.7.4
148 149
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 @@
1From 974e9b862e503c50501079e6586f81918e94a849 Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Fri, 19 Apr 2019 17:57:48 +0800
4Subject: [PATCH] file01.sh: Fix in was not recognized
5
6Some file has "pie" appending after LSB or MSB, which causes mismatch and the
7following error.
8
9"file01 10 TFAIL: in: was not recognized"
10..."ELF 64-bit LSB pie executable"...
11
12This patches tunes the regulation expression to include those cases.
13
14Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2019-April/011758.html]
15
16Signed-off-by: He Zhe <zhe.he@windriver.com>
17---
18 testcases/commands/file/file01.sh | 4 +++-
19 1 file changed, 3 insertions(+), 1 deletion(-)
20
21diff --git a/testcases/commands/file/file01.sh b/testcases/commands/file/file01.sh
22index 0a8119e..55c0433 100755
23--- a/testcases/commands/file/file01.sh
24+++ b/testcases/commands/file/file01.sh
25@@ -91,7 +91,9 @@ do_test()
26 9) file_test in.m4 "M4 macro processor script, ASCII text" \
27 "ASCII M4 macro language pre-processor text";;
28 10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
29- "ELF .*-bit $TEST_ARCH shared object, .*";;
30+ "ELF .*-bit $TEST_ARCH shared object, .*" \
31+ "ELF .*-bit $TEST_ARCH pie executable, .*" \
32+ "ELF .*-bit $TEST_ARCH pie shared object, .*";;
33 11) file_test in.ar "current ar archive";;
34 12) file_test in.tar "tar archive";;
35 13) file_test in.tar.gz "gzip compressed data, .*";;
36--
372.7.4
38
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 @@
1From d5293d73b760268a6b200ab7d9323e37700e6a8c Mon Sep 17 00:00:00 2001
2From: Petr Vorel <petr.vorel@gmail.com>
3Date: Thu, 28 Mar 2019 07:11:25 +0100
4Subject: [PATCH] lapi: Define TST_ABI{,32,64} to detect target type
5
6This is meant to be a replacement of __WORDSIZE definition.
7
8Motivation was instead of finding, where all libc define
9__WORDSIZE, which is usually used for detecting target type
10(at least MUSL defines it in different place than other libc)
11we define our own constant.
12
13Suggested-by: Cyril Hrubis <chrubis@suse.cz>
14Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
15
16Upstream-Status: Backport
17Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
18---
19 include/lapi/abisize.h | 29 +++++++++++++----------------
20 1 file changed, 13 insertions(+), 16 deletions(-)
21
22diff --git a/include/lapi/abisize.h b/include/lapi/abisize.h
23index 897bdfd..9e6622c 100644
24--- a/include/lapi/abisize.h
25+++ b/include/lapi/abisize.h
26@@ -1,25 +1,22 @@
27+// SPDX-License-Identifier: GPL-2.0-or-later
28 /*
29- * Copyright (c) 2014 Linux Test Project
30+ * Copyright (c) 2014-2019 Linux Test Project
31 * Cyril Hrubis <chrubis@suse.cz>
32- *
33- * This program is free software; you can redistribute it and/or
34- * modify it under the terms of the GNU General Public License as
35- * published by the Free Software Foundation; either version 2 of
36- * the License, or (at your option) any later version.
37- *
38- * This program is distributed in the hope that it would be useful,
39- * but WITHOUT ANY WARRANTY; without even the implied warranty of
40- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41- * GNU General Public License for more details.
42- *
43- * You should have received a copy of the GNU General Public License
44- * along with this program; if not, write the Free Software Foundation,
45- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
46+ * Petr Vorel <petr.vorel@gmail.com>
47 */
48
49 #ifndef ABISIZE_H__
50 #define ABISIZE_H__
51
52+/* __WORDSIZE replacement */
53+#if defined(__LP64__) || defined(_LP64)
54+# define TST_ABI64
55+# define TST_ABI 64
56+#else
57+# define TST_ABI32
58+# define TST_ABI 32
59+#endif
60+
61 /*
62 * Determines if we have to split up 64 bit arguments or not
63 *
64@@ -29,6 +26,6 @@
65 (defined(__mips__) && _MIPS_SIM == _ABIN32) || \
66 (defined(__x86_64__) && defined(__ILP32__)) || \
67 (defined(__aarch64__) && defined(__ILP32__)) || \
68- __WORDSIZE == 64
69+ defined(TST_ABI64)
70
71 #endif /* ABISIZE_H__ */
72--
732.8.1
74
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 @@
1From db57ddc1497e72947da2b14f471ab521478ef99d Mon Sep 17 00:00:00 2001
2From: Tommi Rantala <tommi.t.rantala@nokia.com>
3Date: Thu, 31 Jan 2019 19:49:00 +0200
4Subject: [PATCH] syscalls/setrlimit03.c: read /proc/sys/fs/nr_open for
5 RLIMIT_NOFILE limit
6
7Since kernel v2.6.25 RLIMIT_NOFILE limit is no longer hardcoded to
8NR_OPEN, but can be set via /proc/sys/fs/nr_open, see kernel commit
99cfe015aa424b3c003baba3841a60dd9b5ad319b ("get rid of NR_OPEN and
10introduce a sysctl_nr_open").
11
12nr_open default value is 1024*1024, so setrlimit03 has been passing fine
13on new kernels, only "unexpectedly succeeding" if nr_open is set to some
14larger value.
15
16Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
17Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
18
19Upstream-Status: Backport [db57ddc1497e ("syscalls/setrlimit03.c: read /proc/sys/fs/nr_open for RLIMIT_NOFILE limit")]
20
21Signed-off-by: He Zhe <zhe.he@windriver.com>
22---
23 testcases/kernel/syscalls/setrlimit/setrlimit03.c | 13 +++++++++++--
24 1 file changed, 11 insertions(+), 2 deletions(-)
25
26diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit03.c b/testcases/kernel/syscalls/setrlimit/setrlimit03.c
27index 29b52aa..12455fe 100644
28--- a/testcases/kernel/syscalls/setrlimit/setrlimit03.c
29+++ b/testcases/kernel/syscalls/setrlimit/setrlimit03.c
30@@ -35,7 +35,10 @@
31 # define NR_OPEN (1024*1024)
32 #endif
33
34+#define NR_OPEN_PATH "/proc/sys/fs/nr_open"
35+
36 static struct rlimit rlim1, rlim2;
37+static unsigned int nr_open = NR_OPEN;
38
39 static struct tcase {
40 struct rlimit *rlimt;
41@@ -51,7 +54,10 @@ static void verify_setrlimit(unsigned int n)
42
43 TEST(setrlimit(RLIMIT_NOFILE, tc->rlimt));
44 if (TST_RET != -1) {
45- tst_res(TFAIL, "call succeeded unexpectedly");
46+ tst_res(TFAIL, "call succeeded unexpectedly "
47+ "(nr_open=%u rlim_cur=%lu rlim_max=%lu)", nr_open,
48+ (unsigned long)(tc->rlimt->rlim_cur),
49+ (unsigned long)(tc->rlimt->rlim_max));
50 return;
51 }
52
53@@ -65,10 +71,13 @@ static void verify_setrlimit(unsigned int n)
54
55 static void setup(void)
56 {
57+ if (!access(NR_OPEN_PATH, F_OK))
58+ SAFE_FILE_SCANF(NR_OPEN_PATH, "%u", &nr_open);
59+
60 SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlim1);
61 rlim2.rlim_max = rlim1.rlim_cur;
62 rlim2.rlim_cur = rlim1.rlim_max + 1;
63- rlim1.rlim_max = NR_OPEN + 1;
64+ rlim1.rlim_max = nr_open + 1;
65 }
66
67 static struct tst_test test = {
68--
692.7.4
70
diff --git a/meta/recipes-extended/ltp/ltp/0005-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
index b9390e2c8a..eff9ed0741 100644
--- a/meta/recipes-extended/ltp/ltp/0005-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
@@ -1,20 +1,21 @@
1From 6e3058521b50d91d4b0569c4d491c5af5ff798b2 Mon Sep 17 00:00:00 2001 1From 81e5bd5442337a4a648a0dbbff47eaac0d351287 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:22:38 +0000 3Date: Thu, 7 Jan 2016 18:22:38 +0000
4Subject: [PATCH 05/32] kernel/controllers: Link with libfts explicitly on musl 4Subject: [PATCH] kernel/controllers: Link with libfts explicitly on musl
5 5
6musl does not implement fts like glibc and therefore it depends on 6musl does not implement fts like glibc and therefore it depends on
7external implementation for all fts APIs 7external implementation for all fts APIs
8 8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10Upstream-Status: Pending 9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
11--- 12---
12 testcases/kernel/controllers/Makefile.inc | 3 +++ 13 testcases/kernel/controllers/Makefile.inc | 3 +++
13 testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++ 14 testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++
14 2 files changed, 6 insertions(+) 15 2 files changed, 6 insertions(+)
15 16
16diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc 17diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc
17index b106283..ef5fc0c 100644 18index 4ca0b5a..1d85e4d 100644
18--- a/testcases/kernel/controllers/Makefile.inc 19--- a/testcases/kernel/controllers/Makefile.inc
19+++ b/testcases/kernel/controllers/Makefile.inc 20+++ b/testcases/kernel/controllers/Makefile.inc
20@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB) 21@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB)
@@ -28,7 +29,7 @@ index b106283..ef5fc0c 100644
28 INSTALL_TARGETS ?= *.sh 29 INSTALL_TARGETS ?= *.sh
29 30
30diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc 31diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc
31index 9e002f4..e0fcb9c 100644 32index db6a843..86dd2a8 100644
32--- a/testcases/kernel/controllers/cpuset/Makefile.inc 33--- a/testcases/kernel/controllers/cpuset/Makefile.inc
33+++ b/testcases/kernel/controllers/cpuset/Makefile.inc 34+++ b/testcases/kernel/controllers/cpuset/Makefile.inc
34@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET) 35@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET)
@@ -42,5 +43,5 @@ index 9e002f4..e0fcb9c 100644
42 INSTALL_TARGETS ?= *.sh 43 INSTALL_TARGETS ?= *.sh
43 44
44-- 45--
452.7.0 462.7.4
46 47
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 @@
1From 29ce9fdab3bd34e69d73b5b890795559c06553f7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:40:08 +0000
4Subject: [PATCH] Check if __GLIBC_PREREQ is defined before using it
5
6__GLIBC_PREREQ is specific to glibc so it should be checked if it is
7defined or not.
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
13---
14 testcases/kernel/syscalls/accept4/accept4_01.c | 7 +++++++
15 1 file changed, 7 insertions(+)
16
17diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c
18index dd289cf..76aa969 100644
19--- a/testcases/kernel/syscalls/accept4/accept4_01.c
20+++ b/testcases/kernel/syscalls/accept4/accept4_01.c
21@@ -38,6 +38,7 @@
22 static struct sockaddr_in conn_addr;
23 static int listening_fd;
24
25+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
26 #if !(__GLIBC_PREREQ(2, 10))
27 static int
28 accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
29@@ -56,6 +57,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
30 #endif
31 }
32 #endif
33+#endif
34
35 static int create_listening_socket(void)
36 {
37@@ -115,6 +117,7 @@ static void verify_accept4(unsigned int nr)
38 SAFE_CONNECT(connfd, (struct sockaddr *)&conn_addr, sizeof(conn_addr));
39 addrlen = sizeof(claddr);
40
41+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
42 #if !(__GLIBC_PREREQ(2, 10))
43 TEST(accept4_01(listening_fd, (struct sockaddr *)&claddr, &addrlen,
44 tcase->cloexec | tcase->nonblock));
45@@ -122,6 +125,10 @@ static void verify_accept4(unsigned int nr)
46 TEST(accept4(listening_fd, (struct sockaddr *)&claddr, &addrlen,
47 tcase->cloexec | tcase->nonblock));
48 #endif
49+#else
50+ TEST(accept4(listening_fd, (struct sockaddr *)&claddr, &addrlen,
51+ tcase->cloexec | tcase->nonblock));
52+#endif
53 if (TST_RET == -1) {
54 if (TST_ERR == ENOSYS)
55 tst_brk(TCONF, "syscall __NR_accept4 not supported");
56--
572.7.4
58
diff --git a/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch b/meta/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch
index a79763d00e..5622a64d43 100644
--- a/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch
+++ b/meta/recipes-extended/ltp/ltp/0004-guard-mallocopt-with-__GLIBC__.patch
@@ -1,12 +1,13 @@
1From f42b060e80c9f40627c712d4d56d45221bd7d9fa Mon Sep 17 00:00:00 2001 1From d0fc9ca5d3366f9b8907e463222403cd2327be10 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 06:51:20 +0000 3Date: Fri, 8 Jan 2016 06:51:20 +0000
4Subject: [PATCH 18/32] guard mallocopt() with __GLIBC__ 4Subject: [PATCH] guard mallocopt() with __GLIBC__
5 5
6mallocopt is not available on non glibc implementations 6mallocopt is not available on non glibc implementations
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending 8Upstream-Status: Pending
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
10--- 11---
11 utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++-- 12 utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++--
12 1 file changed, 2 insertions(+), 2 deletions(-) 13 1 file changed, 2 insertions(+), 2 deletions(-)
@@ -29,5 +30,5 @@ index 5bb8eff..934d951 100644
29 fprintf(stderr, "Chunk size %u smaller than record size %u\n", 30 fprintf(stderr, "Chunk size %u smaller than record size %u\n",
30 chunk_size, record_size); 31 chunk_size, record_size);
31-- 32--
322.7.0 332.7.4
33 34
diff --git a/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch b/meta/recipes-extended/ltp/ltp/0005-getdents-define-getdents-getdents64-only-for-glibc.patch
index 7060a64b1a..d1f7b0746b 100644
--- a/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
+++ b/meta/recipes-extended/ltp/ltp/0005-getdents-define-getdents-getdents64-only-for-glibc.patch
@@ -1,20 +1,20 @@
1From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001 1From b996b2480fe3a800ffbdc4a0fdc5e8775c575449 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 06:57:04 +0000 3Date: Fri, 8 Jan 2016 06:57:04 +0000
4Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc 4Subject: [PATCH] getdents: define getdents/getdents64 only for glibc
5 5
6getdents/getdents64 are implemented in musl and when we define static 6getdents/getdents64 are implemented in musl and when we define static
7functions with same name, it errors out. 7functions with same name, it errors out.
8 8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Pending 9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12--- 12---
13 testcases/kernel/syscalls/getdents/getdents.h | 6 ++++-- 13 testcases/kernel/syscalls/getdents/getdents.h | 6 ++++--
14 1 file changed, 4 insertions(+), 2 deletions(-) 14 1 file changed, 4 insertions(+), 2 deletions(-)
15 15
16diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h 16diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h
17index abea655..db63d89 100644 17index 702b0bd..860b22e 100644
18--- a/testcases/kernel/syscalls/getdents/getdents.h 18--- a/testcases/kernel/syscalls/getdents/getdents.h
19+++ b/testcases/kernel/syscalls/getdents/getdents.h 19+++ b/testcases/kernel/syscalls/getdents/getdents.h
20@@ -34,12 +34,13 @@ struct linux_dirent { 20@@ -34,12 +34,13 @@ struct linux_dirent {
@@ -46,5 +46,5 @@ index abea655..db63d89 100644
46+#endif 46+#endif
47 #endif /* GETDENTS_H */ 47 #endif /* GETDENTS_H */
48-- 48--
492.7.0 492.7.4
50 50
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 @@
1From 60054686e2c1a4bedf1d507af97ebbb7ff491e77 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jul 2019 15:23:15 +0800
4Subject: [PATCH] rt_tgsigqueueinfo: disable test on musl
5
6Fix build error with musl:
7rt_tgsigqueueinfo01.c: In function 'sigusr1_handler':
8rt_tgsigqueueinfo01.c:42:22: error: 'siginfo_t' {aka 'struct <anonymous>'} has no member named '_sifields'; did you mean '__si_fields'?
9 42 | sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr;
10 | ^~~~~~~~~
11 | __si_fields
12
13Upstream-Status: Pending
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 testcases/kernel/syscalls/Makefile | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
21index d1becd0..1f3ff34 100644
22--- a/testcases/kernel/syscalls/Makefile
23+++ b/testcases/kernel/syscalls/Makefile
24@@ -31,7 +31,7 @@ endif
25 ifeq ($(LIBC),musl)
26 FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \
27 rt_sigsuspend setdomainname sethostname sigsuspend \
28- ustat
29+ ustat rt_tgsigqueueinfo
30 endif
31
32 ifeq ($(UCLIBC),1)
33--
342.7.4
35
diff --git a/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch
index 665da3bef3..0e7264574f 100644
--- a/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
+++ b/meta/recipes-extended/ltp/ltp/0007-Fix-test_proc_kill-hanging.patch
@@ -1,22 +1,22 @@
1From f7c602b639db0d118e07d3fa7b6deead0be0c72b Mon Sep 17 00:00:00 2001 1From f4fafbdffae3a63c81f65cef98c72dda26283e06 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com> 2From: Dengke Du <dengke.du@windriver.com>
3Date: Wed, 8 Feb 2017 16:17:17 +0800 3Date: Wed, 8 Feb 2017 16:17:17 +0800
4Subject: [PATCH 3/5] Fix test_proc_kill hanging 4Subject: [PATCH] Fix test_proc_kill hanging
5 5
6Sometimes the signal is delivered to memcg_process before the framework took 6Sometimes the signal is delivered to memcg_process before the framework took
7into consideration its pid entered in the tasks. Fixed by delaying the signal 7into consideration its pid entered in the tasks. Fixed by delaying the signal
8send command. 8send command.
9 9
10Upstream-Status: Pending
11
10Signed-off-by: George Nita <george.nita@enea.com> 12Signed-off-by: George Nita <george.nita@enea.com>
11Signed-off-by: Dengke Du <dengke.du@windriver.com> 13Signed-off-by: Dengke Du <dengke.du@windriver.com>
12
13Upstream-Status: Pending
14--- 14---
15 testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 1 + 15 testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 1 +
16 1 file changed, 1 insertion(+) 16 1 file changed, 1 insertion(+)
17 17
18diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh 18diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
19index b785fe3..2918cc5 100755 19index aadaae4..deea5d6 100755
20--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh 20--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
21+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh 21+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
22@@ -291,6 +291,7 @@ test_proc_kill() 22@@ -291,6 +291,7 @@ test_proc_kill()
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 @@
1From d1a27570457fb6e1d6bafe81bfa0f3507b137e32 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Thu, 9 Feb 2017 18:20:58 +0800
4Subject: [PATCH] fix __WORDSIZE undeclared when building with musl
5
6fix __WORDSIZE undeclared when building with musl.
7
8Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177]
9
10Signed-off-by: Dengke Du <dengke.du@windriver.com>
11---
12 include/old/test.h | 3 +++
13 1 file changed, 3 insertions(+)
14
15diff --git a/include/old/test.h b/include/old/test.h
16index b36764d83..cc6f1b551 100644
17--- a/include/old/test.h
18+++ b/include/old/test.h
19@@ -17,6 +17,9 @@
20 #include <string.h>
21 #include <stdlib.h>
22 #include <stdint.h>
23+#ifndef __GLIBC__
24+#include <bits/reg.h>
25+#endif
26
27 #include "usctest.h"
28
29--
302.11.0
31
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 @@
1From fc2b47ad979a87bfbd11aeea3f67c26e7fb39e30 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:40:08 +0000
4Subject: [PATCH] Check if __GLIBC_PREREQ is defined before using it
5
6__GLIBC_PREREQ is specific to glibc so it should be checked if it is
7defined or not.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Pending
12---
13 .../kernel/syscalls/accept4/accept4_01.c | 9 ++++++-
14 .../sched_getaffinity/sched_getaffinity01.c | 26 +++++++++++++++++++
15 2 files changed, 34 insertions(+), 1 deletion(-)
16
17diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c
18index dec4ef93b..c5d74b07f 100644
19--- a/testcases/kernel/syscalls/accept4/accept4_01.c
20+++ b/testcases/kernel/syscalls/accept4/accept4_01.c
21@@ -64,6 +64,7 @@ static void cleanup(void)
22 tst_rmdir();
23 }
24
25+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
26 #if !(__GLIBC_PREREQ(2, 10))
27 static int
28 accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
29@@ -82,7 +83,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
30 }
31 tst_resm(TINFO, "\n");
32 #endif
33-
34 #if USE_SOCKETCALL
35 long args[6];
36
37@@ -97,6 +97,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
38 #endif
39 }
40 #endif
41+#endif
42
43 static void
44 do_test(int lfd, struct sockaddr_in *conn_addr,
45@@ -119,9 +120,15 @@ do_test(int lfd, struct sockaddr_in *conn_addr,
46 die("Connect Error");
47
48 addrlen = sizeof(struct sockaddr_in);
49+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
50 #if !(__GLIBC_PREREQ(2, 10))
51 acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen,
52 closeonexec_flag | nonblock_flag);
53+
54+#else
55+ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
56+ closeonexec_flag | nonblock_flag);
57+#endif
58 #else
59 acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
60 closeonexec_flag | nonblock_flag);
61diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
62index 02f04b909..d906d7e09 100644
63--- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
64+++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
65@@ -67,9 +67,11 @@ do { \
66 tst_resm((TEST_RETURN == -1 ? TPASS : TFAIL) | TTERRNO, #t); \
67 } while (0)
68
69+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
70 #if !(__GLIBC_PREREQ(2, 7))
71 #define CPU_FREE(ptr) free(ptr)
72 #endif
73+#endif
74
75 int main(int ac, char **av)
76 {
77@@ -96,17 +98,26 @@ static void do_test(void)
78 pid_t unused_pid;
79 unsigned len;
80
81+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
82 #if __GLIBC_PREREQ(2, 7)
83 realloc:
84 mask = CPU_ALLOC(nrcpus);
85+#else
86+ mask = malloc(sizeof(cpu_set_t));
87+#endif
88 #else
89 mask = malloc(sizeof(cpu_set_t));
90 #endif
91 if (mask == NULL)
92 tst_brkm(TFAIL | TTERRNO, cleanup, "fail to get enough memory");
93+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
94 #if __GLIBC_PREREQ(2, 7)
95 len = CPU_ALLOC_SIZE(nrcpus);
96 CPU_ZERO_S(len, mask);
97+#else
98+ len = sizeof(cpu_set_t);
99+ CPU_ZERO(mask);
100+#endif
101 #else
102 len = sizeof(cpu_set_t);
103 CPU_ZERO(mask);
104@@ -115,11 +126,18 @@ realloc:
105 TEST(sched_getaffinity(0, len, mask));
106 if (TEST_RETURN == -1) {
107 CPU_FREE(mask);
108+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
109 #if __GLIBC_PREREQ(2, 7)
110 if (errno == EINVAL && nrcpus < (1024 << 8)) {
111 nrcpus = nrcpus << 2;
112 goto realloc;
113 }
114+#else
115+ if (errno == EINVAL)
116+ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a "
117+ "newer glibc(>= 2.7)");
118+ else
119+#endif
120 #else
121 if (errno == EINVAL)
122 tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a "
123@@ -132,8 +150,12 @@ realloc:
124 tst_resm(TINFO, "cpusetsize is %d", len);
125 tst_resm(TINFO, "mask.__bits[0] = %lu ", mask->__bits[0]);
126 for (i = 0; i < num; i++) {
127+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
128 #if __GLIBC_PREREQ(2, 7)
129 TEST(CPU_ISSET_S(i, len, mask));
130+#else
131+ TEST(CPU_ISSET(i, mask));
132+#endif
133 #else
134 TEST(CPU_ISSET(i, mask));
135 #endif
136@@ -144,8 +166,12 @@ realloc:
137 }
138 }
139
140+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
141 #if __GLIBC_PREREQ(2, 7)
142 CPU_ZERO_S(len, mask);
143+#else
144+ CPU_ZERO(mask);
145+#endif
146 #else
147 CPU_ZERO(mask);
148 #endif
149--
1502.17.1
151
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/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
index e826d48e3b..b46325eaf3 100644
--- a/meta/recipes-extended/ltp/ltp/0036-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
@@ -1,8 +1,8 @@
1From 672a56be14426eae44864673c6c2afca0ab89d46 Mon Sep 17 00:00:00 2001 1From aa7a9185a037ad59012bd46713ac340458e95209 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com> 2From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
3Date: Fri, 13 May 2016 11:11:28 -0500 3Date: Fri, 13 May 2016 11:11:28 -0500
4Subject: [PATCH] testcases/network/nfsv4/acl/acl1.c: Security fix on string 4Subject: [PATCH] testcases/network/nfsv4/acl/acl1.c: Security fix on
5 printf 5 string printf
6MIME-Version: 1.0 6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8 7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit 8Content-Transfer-Encoding: 8bit
@@ -16,15 +16,15 @@ acl1.c:317:2: error: format not a string literal and no format arguments
16 16
17[YOCTO #9548] 17[YOCTO #9548]
18 18
19Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
20
21Upstream-Status: Pending 19Upstream-Status: Pending
20
21Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
22--- 22---
23 testcases/network/nfsv4/acl/acl1.c | 2 +- 23 testcases/network/nfsv4/acl/acl1.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-) 24 1 file changed, 1 insertion(+), 1 deletion(-)
25 25
26diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c 26diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c
27index b8b67b4..7c7c506 100644 27index bdf0180..898b7ca 100644
28--- a/testcases/network/nfsv4/acl/acl1.c 28--- a/testcases/network/nfsv4/acl/acl1.c
29+++ b/testcases/network/nfsv4/acl/acl1.c 29+++ b/testcases/network/nfsv4/acl/acl1.c
30@@ -303,7 +303,7 @@ void test_acl_default(char *dir, acl_t acl) 30@@ -303,7 +303,7 @@ void test_acl_default(char *dir, acl_t acl)
@@ -37,5 +37,5 @@ index b8b67b4..7c7c506 100644
37 system(cmd); 37 system(cmd);
38 acl2 = acl_get_file(path, ACL_TYPE_ACCESS); 38 acl2 = acl_get_file(path, ACL_TYPE_ACCESS);
39-- 39--
402.1.4 402.7.4
41 41
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 @@
1From bf5dd2932200e0199a38f3028d3bef2253f32e38 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Thu, 9 Feb 2017 17:17:37 +0800
4Subject: [PATCH] fix redefinition of 'struct msgbuf' error building with musl
5
6When building with musl the file "sys/msg.h" already contain 'struct msgbuf'
7
8Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177]
9
10Signed-off-by: Dengke Du <dengke.du@windriver.com>
11---
12 testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
16index a757c0d18..e023114d2 100644
17--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
18+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
19@@ -47,11 +47,13 @@ const char *TCID = "msgrcv08";
20 const int TST_TOTAL = 1;
21
22 #if __WORDSIZE == 32
23-
24+#ifdef __GLIBC__
25 struct msgbuf {
26 long mtype; /* message type, must be > 0 */
27 char mtext[16]; /* message data */
28 };
29+#else
30+#endif
31
32 static void msr(int msqid)
33 {
34--
352.11.0
36
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/0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch
index 84736053bf..d32ac1dd7c 100644
--- a/meta/recipes-extended/ltp/ltp/0001-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
@@ -1,4 +1,4 @@
1From 85c972f730e8efe891a06ea3a2dfb5cbbdfbfbf4 Mon Sep 17 00:00:00 2001 1From a8715a1446305ffd76406f63c7f160c13a5b2e72 Mon Sep 17 00:00:00 2001
2From: "Hongzhi.Song" <hongzhi.song@windriver.com> 2From: "Hongzhi.Song" <hongzhi.song@windriver.com>
3Date: Wed, 10 Oct 2018 22:07:05 -0400 3Date: Wed, 10 Oct 2018 22:07:05 -0400
4Subject: [PATCH] open_posix_testsuite/mmap24-2: Relax condition a bit 4Subject: [PATCH] open_posix_testsuite/mmap24-2: Relax condition a bit
@@ -23,7 +23,7 @@ Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
23 1 file changed, 5 insertions(+), 5 deletions(-) 23 1 file changed, 5 insertions(+), 5 deletions(-)
24 24
25diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c 25diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
26index de51d43..810e5c8 100644 26index 9cf83d9..55090a6 100644
27--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c 27--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
28+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c 28+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
29@@ -7,7 +7,7 @@ 29@@ -7,7 +7,7 @@
@@ -64,5 +64,5 @@ index de51d43..810e5c8 100644
64 return PTS_FAIL; 64 return PTS_FAIL;
65 } 65 }
66-- 66--
672.8.1 672.7.4
68 68
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/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch
index d837f073a9..8704e5ffe8 100644
--- 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/0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch
@@ -1,4 +1,4 @@
1From db0a43d9388be2c347a8306751bbe6bec086d062 Mon Sep 17 00:00:00 2001 1From 794933b38354a2612cf2c471f11798b306f35315 Mon Sep 17 00:00:00 2001
2From: Jan Stancek <jstancek@redhat.com> 2From: Jan Stancek <jstancek@redhat.com>
3Date: Mon, 20 May 2019 20:47:20 +0200 3Date: Mon, 20 May 2019 20:47:20 +0200
4Subject: [PATCH] shmctl01: don't use hardcoded index == 0 for SHM_STAT test 4Subject: [PATCH] shmctl01: don't use hardcoded index == 0 for SHM_STAT test
@@ -21,10 +21,11 @@ Signed-off-by: Jan Stancek <jstancek@redhat.com>
21Reviewed-by: Petr Vorel <pvorel@suse.cz> 21Reviewed-by: Petr Vorel <pvorel@suse.cz>
22Acked-by: Cyril Hrubis <chrubis@suse.cz> 22Acked-by: Cyril Hrubis <chrubis@suse.cz>
23 23
24Upstream-Status: Backport from v20190517 24Upstream-Status: Backport
25[https://lists.linux.it/pipermail/ltp/2019-May/012051.html] 25[https://github.com/linux-test-project/ltp/commit/db0a43d9388be2c347a8306751bbe6bec086d062]
26 26
27Signed-off-by: Hongzhi Song <hongzhi.song@windriver.com> 27Signed-off-by: Hongzhi Song <hongzhi.song@windriver.com>
28Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
28--- 29---
29 testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 21 ++++++++++++++++++--- 30 testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 21 ++++++++++++++++++---
30 1 file changed, 18 insertions(+), 3 deletions(-) 31 1 file changed, 18 insertions(+), 3 deletions(-)
@@ -77,5 +78,5 @@ index 1b46977..52bf23a 100644
77 78
78 static void func_lock(int ret) 79 static void func_lock(int ret)
79-- 80--
802.8.1 812.7.4
81 82
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/0011-direct_io-diotest4-drop-MAP_FIXED.patch
index 620027bd0d..9cd188f656 100644
--- a/meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch
+++ b/meta/recipes-extended/ltp/ltp/0011-direct_io-diotest4-drop-MAP_FIXED.patch
@@ -1,26 +1,33 @@
1From 785809201ad7dea2872d493efbfd65bb215710d6 Mon Sep 17 00:00:00 2001 1From f210d7e19b721041f31b7f258a169f89dc850303 Mon Sep 17 00:00:00 2001
2From: "Hongzhi.Song" <hongzhi.song@windriver.com> 2From: Jan Stancek <jstancek@redhat.com>
3Date: Sun, 30 Jun 2019 21:56:16 -0400 3Date: Thu, 4 Jul 2019 16:45:23 +0200
4Subject: [PATCH] diotest4: Let kernel pick an address when calling mmap 4Subject: [PATCH] direct_io/diotest4: drop MAP_FIXED
5 5
6Error: 6Hongzhi reports that this test is failing on mips64 with 5.1+:
7diotest4 10 TBROK : diotest4.c:368: can't mmap file: Invalid argument 7 diotest4 10 TBROK : diotest4.c:368: can't mmap file: Invalid argument
8diotest4 11 TBROK : diotest4.c:368: Remaining cases broken 8 diotest4 11 TBROK : diotest4.c:368: Remaining cases broken
9I could reproduce it on emulated 5kc-malta, running 5.2.0-rc7.
9 10
10This is because the specified addr from mmap is invalid. 11Test is trying to map into area immediately following heap as MAP_SHARED,
11We should let kernel itself pick an addrress. 12but it used wrong alignment (fixed by 'lapi/mmap.h: include config.h').
12 13
14Usage of MAP_FIXED seems unnecessary, so drop that too and let the kernel
15pick an address.
16
17Reported-by: Hongzhi.Song <hongzhi.song@windriver.com>
13Signed-off-by: Jan Stancek <jstancek@redhat.com> 18Signed-off-by: Jan Stancek <jstancek@redhat.com>
19Acked-by: Cyril Hrubis <chrubis@suse.cz>
14 20
15Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2019-June/012570.html] 21Upstream-Status: Backport
22[https://github.com/linux-test-project/ltp/commit/f5444eeeabf252b8884b9465d277b6af853819e3]
16 23
17Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> 24Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
18--- 25---
19 testcases/kernel/io/direct_io/diotest4.c | 8 ++------ 26 testcases/kernel/io/direct_io/diotest4.c | 8 ++------
20 1 file changed, 2 insertions(+), 6 deletions(-) 27 1 file changed, 2 insertions(+), 6 deletions(-)
21 28
22diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c 29diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c
23index e4616e4..d88c431 100644 30index e4616e4..bf200cd 100644
24--- a/testcases/kernel/io/direct_io/diotest4.c 31--- a/testcases/kernel/io/direct_io/diotest4.c
25+++ b/testcases/kernel/io/direct_io/diotest4.c 32+++ b/testcases/kernel/io/direct_io/diotest4.c
26@@ -352,18 +352,14 @@ int main(int argc, char *argv[]) 33@@ -352,18 +352,14 @@ int main(int argc, char *argv[])
@@ -39,11 +46,11 @@ index e4616e4..d88c431 100644
39 } 46 }
40- shm_base = mmap(shm_base, 0x100000, PROT_READ | PROT_WRITE, 47- shm_base = mmap(shm_base, 0x100000, PROT_READ | PROT_WRITE,
41- MAP_SHARED | MAP_FIXED, fd, 0); 48- MAP_SHARED | MAP_FIXED, fd, 0);
42+ shm_base = mmap(NULL, 0x100000, PROT_READ | PROT_WRITE, 49+ shm_base = mmap(0, 0x100000, PROT_READ | PROT_WRITE,
43+ MAP_SHARED, fd, 0); 50+ MAP_SHARED, fd, 0);
44 if (shm_base == (caddr_t) - 1) { 51 if (shm_base == (caddr_t) - 1) {
45 tst_brkm(TBROK, cleanup, "can't mmap file: %s", 52 tst_brkm(TBROK, cleanup, "can't mmap file: %s",
46 strerror(errno)); 53 strerror(errno));
47-- 54--
482.8.1 552.7.4
49 56
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/0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch
index 7b662294f3..aecbc80e9b 100644
--- a/meta/recipes-extended/ltp/ltp/0001-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
@@ -1,4 +1,4 @@
1From e79652a3839869b1983d65999e5d5dcb50bc9cd7 Mon Sep 17 00:00:00 2001 1From 4ac747c1f7ff8e2ec2567d6672822e95a9b56e55 Mon Sep 17 00:00:00 2001
2From: "Hongzhi.Song" <hongzhi.song@windriver.com> 2From: "Hongzhi.Song" <hongzhi.song@windriver.com>
3Date: Mon, 15 Jul 2019 03:39:06 -0400 3Date: Mon, 15 Jul 2019 03:39:06 -0400
4Subject: [PATCH] getrlimit03: adjust a bit of code to compatiable with mips32 4Subject: [PATCH] getrlimit03: adjust a bit of code to compatiable with mips32
@@ -26,13 +26,15 @@ Signed-off-by: Jan Stancek <jstancek@redhat.com>
26Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> 26Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
27 27
28Upstream-Status: Backport 28Upstream-Status: Backport
29[https://github.com/linux-test-project/ltp/commit/7a3bca63cd7f059d490b6274f0fdf3247be93fde]
30
29Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> 31Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
30--- 32---
31 testcases/kernel/syscalls/getrlimit/getrlimit03.c | 8 +++++++- 33 testcases/kernel/syscalls/getrlimit/getrlimit03.c | 8 +++++++-
32 1 file changed, 7 insertions(+), 1 deletion(-) 34 1 file changed, 7 insertions(+), 1 deletion(-)
33 35
34diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit03.c b/testcases/kernel/syscalls/getrlimit/getrlimit03.c 36diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit03.c b/testcases/kernel/syscalls/getrlimit/getrlimit03.c
35index e4d56c4..03bd821 100644 37index e4d56c4..319bc49 100644
36--- a/testcases/kernel/syscalls/getrlimit/getrlimit03.c 38--- a/testcases/kernel/syscalls/getrlimit/getrlimit03.c
37+++ b/testcases/kernel/syscalls/getrlimit/getrlimit03.c 39+++ b/testcases/kernel/syscalls/getrlimit/getrlimit03.c
38@@ -26,6 +26,7 @@ 40@@ -26,6 +26,7 @@
@@ -58,5 +60,5 @@ index e4d56c4..03bd821 100644
58 static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim) 60 static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim)
59 { 61 {
60-- 62--
612.8.1 632.7.4
62 64
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 @@
1From b216435bb362df10c45f544b78d8c884eaa901fd Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:01:02 +0000
4Subject: [PATCH 21/32] Define _GNU_SOURCE for MREMAP_MAYMOVE definition
5
6musl guards MREMAP_MAYMOVE with _GNU_SOURCE unlike glibc which uses
7__USE_GNU
8
9Fixes errors like
10error: 'MREMAP_MAYMOVE' undeclared (first use in this function)
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13
14Upstream-Status: Pending
15---
16 testcases/kernel/syscalls/mremap/mremap01.c | 4 +++-
17 testcases/kernel/syscalls/mremap/mremap02.c | 2 ++
18 testcases/kernel/syscalls/mremap/mremap03.c | 2 ++
19 3 files changed, 7 insertions(+), 1 deletion(-)
20
21diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c
22index d63d1e4..24ca174 100644
23--- a/testcases/kernel/syscalls/mremap/mremap01.c
24+++ b/testcases/kernel/syscalls/mremap/mremap01.c
25@@ -76,10 +76,12 @@
26 */
27 #include <unistd.h>
28 #include <errno.h>
29+#include <fcntl.h>
30+#define _GNU_SOURCE
31 #define __USE_GNU
32 #include <sys/mman.h>
33 #undef __USE_GNU
34-#include <fcntl.h>
35+#undef _GNU_SOURCE
36
37 #include "test.h"
38 #include "safe_macros.h"
39diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c
40index 5a51b9a..a530a6b 100644
41--- a/testcases/kernel/syscalls/mremap/mremap02.c
42+++ b/testcases/kernel/syscalls/mremap/mremap02.c
43@@ -75,9 +75,11 @@
44 #include <errno.h>
45 #include <unistd.h>
46 #include <fcntl.h>
47+#define _GNU_SOURCE
48 #define __USE_GNU
49 #include <sys/mman.h>
50 #undef __USE_GNU
51+#undef _GNU_SOURCE
52
53 #include "test.h"
54
55diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
56index 12e3829..9b39f8b 100644
57--- a/testcases/kernel/syscalls/mremap/mremap03.c
58+++ b/testcases/kernel/syscalls/mremap/mremap03.c
59@@ -76,9 +76,11 @@
60 #include <errno.h>
61 #include <unistd.h>
62 #include <fcntl.h>
63+#define _GNU_SOURCE
64 #define __USE_GNU
65 #include <sys/mman.h>
66 #undef __USE_GNU
67+#undef _GNU_SOURCE
68
69 #include "test.h"
70
71--
722.7.0
73
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 @@
1From 560347f77236616a635b4a997a0596b8da4d0799 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:08:25 +0000
4Subject: [PATCH 23/32] ptrace: Use int instead of enum __ptrace_request
5
6__ptrace_request is only available with glibc
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9
10Upstream-Status: Pending
11---
12 testcases/kernel/syscalls/ptrace/ptrace03.c | 4 ++++
13 testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h | 4 ++++
14 2 files changed, 8 insertions(+)
15
16diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c
17index a4028fc..f1880cd 100644
18--- a/testcases/kernel/syscalls/ptrace/ptrace03.c
19+++ b/testcases/kernel/syscalls/ptrace/ptrace03.c
20@@ -102,7 +102,11 @@ static pid_t unused_pid;
21 static pid_t zero_pid;
22
23 struct test_case_t {
24+#ifdef __GLIBC__
25 enum __ptrace_request request;
26+#else
27+ int request;
28+#endif
29 pid_t *pid;
30 int exp_errno;
31 } test_cases[] = {
32diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
33index ae538e9..85aa89d 100644
34--- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
35+++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
36@@ -130,7 +130,11 @@ static char *strings[] = {
37 SPT(KILL)
38 SPT(SINGLESTEP)
39 };
40+#ifdef __GLIBC__
41 static inline char *strptrace(enum __ptrace_request request)
42+#else
43+static inline char *strptrace(int request)
44+#endif
45 {
46 return strings[request];
47 }
48--
492.7.0
50
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 @@
1From e01e9862c248dc90a8ec6f2d06f8469d7a50cd8e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:14:58 +0000
4Subject: [PATCH 24/32] rt_sigaction/rt_sigprocmark: Define _GNU_SOURCE
5
6Fixes musl build failure e.g.
7error: 'SA_NOMASK' undeclared here (not in a function)
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Pending
12---
13 testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c | 1 +
14 testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +-
15 testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c | 1 +
16 testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c | 1 +
17 4 files changed, 4 insertions(+), 1 deletion(-)
18
19diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
20index 5cf89cc..bdcb91a 100644
21--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
22+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
23@@ -28,6 +28,7 @@
24 /* sigset_t type. */
25 /******************************************************************************/
26
27+#define _GNU_SOURCE
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <unistd.h>
31diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
32index a1da743..8a27a0f 100644
33--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
34+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
35@@ -23,7 +23,7 @@
36 /* Description: This tests the rt_sigaction() syscall */
37 /* rt_sigaction Expected EFAULT error check */
38 /******************************************************************************/
39-
40+#define _GNU_SOURCE
41 #include <stdio.h>
42 #include <stdlib.h>
43 #include <unistd.h>
44diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
45index 175d220..e7627cd 100644
46--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
47+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
48@@ -24,6 +24,7 @@
49 /* rt_sigaction Expected EINVAL error check */
50 /******************************************************************************/
51
52+#define _GNU_SOURCE
53 #include <stdio.h>
54 #include <stdlib.h>
55 #include <unistd.h>
56diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
57index 74e5a61..75c57fc 100644
58--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
59+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
60@@ -39,6 +39,7 @@
61 /* sigsetsize should indicate the size of a sigset_t type. */
62 /******************************************************************************/
63
64+#define _GNU_SOURCE
65 #include <stdio.h>
66 #include <signal.h>
67 #include <errno.h>
68--
692.7.0
70
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 @@
1From 0133a2b29d6f48d8e2bba6a3be581cdfa91311a6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:21:05 +0000
4Subject: [PATCH 26/32] crash01: Define _GNU_SOURCE
5
6Fixes musl build errors like
7error: 'SA_NOMASK' undeclared (first use in this function)
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Pending
12---
13 testcases/misc/crash/crash01.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/testcases/misc/crash/crash01.c b/testcases/misc/crash/crash01.c
17index 0574521..08a02e7 100644
18--- a/testcases/misc/crash/crash01.c
19+++ b/testcases/misc/crash/crash01.c
20@@ -49,7 +49,7 @@ stress test at the same time you run other tests, like a multi-user
21 benchmark.
22
23 */
24-
25+#define _GNU_SOURCE
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29--
302.7.0
31
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 @@
1From 94557fb7e1293c61145c959b8c5ffecf4a2b1069 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:24:44 +0000
4Subject: [PATCH 28/32] rt_sigaction.h: Use sighandler_t instead of
5 __sighandler_t
6
7When _GNU_SOURCE is used then both typedefs are same and using
8sighandler_t makes it work on musl too
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12Upstream-Status: Pending
13---
14 include/lapi/rt_sigaction.h | 4 ++--
15 testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++
16 2 files changed, 5 insertions(+), 2 deletions(-)
17
18diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
19index 18236db..15facda 100644
20--- a/include/lapi/rt_sigaction.h
21+++ b/include/lapi/rt_sigaction.h
22@@ -36,12 +36,12 @@
23 #if defined(__mips__)
24 struct kernel_sigaction {
25 unsigned int sa_flags;
26- __sighandler_t k_sa_handler;
27+ sighandler_t k_sa_handler;
28 sigset_t sa_mask;
29 };
30 #else
31 struct kernel_sigaction {
32- __sighandler_t k_sa_handler;
33+ sighandler_t k_sa_handler;
34 unsigned long sa_flags;
35 void (*sa_restorer) (void);
36 sigset_t sa_mask;
37diff --git a/testcases/kernel/syscalls/rt_sigsuspend/Makefile b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
38index 37bc3a9..2ca7f7c 100644
39--- a/testcases/kernel/syscalls/rt_sigsuspend/Makefile
40+++ b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
41@@ -19,4 +19,7 @@
42 top_srcdir ?= ../../../..
43
44 include $(top_srcdir)/include/mk/testcases.mk
45+
46+CFLAGS += -D_GNU_SOURCE
47+
48 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 @@
1From 5a77e2bdc083f4f842a8ba7c2db1a7ac6e5f0664 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Wed, 31 May 2017 21:26:05 -0400
4Subject: [PATCH] Add periodic output for long time test.
5
6This is needed in context of having scripts running ltp tests and
7waiting with a timeout for the output of the tests.
8
9Signed-off-by: Tudor Florea <tudor.florea@enea.com>
10Upstream-Status: Pending
11
12Signed-off-by: Dengke Du <dengke.du@windriver.com>
13---
14 .../kernel/controllers/memcg/stress/memcg_stress_test.sh | 11 ++++++++---
15 1 file changed, 8 insertions(+), 3 deletions(-)
16
17diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
18index af1a708..084e628 100755
19--- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
20+++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
21@@ -37,7 +37,8 @@ if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then
22 exit 0
23 fi
24
25-RUN_TIME=$(( 15 * 60 ))
26+ONE_MINUTE=60
27+RUN_TIME=15
28
29 cleanup()
30 {
31@@ -62,7 +63,7 @@ do_mount()
32 # $1 - Number of cgroups
33 # $2 - Allocated how much memory in one process? in MB
34 # $3 - The interval to touch memory in a process
35-# $4 - How long does this test run ? in second
36+# $4 - How long does this test run ? in minutes
37 run_stress()
38 {
39 do_mount;
40@@ -81,7 +82,11 @@ run_stress()
41 eval /bin/kill -s SIGUSR1 \$pid$i 2> /dev/null
42 done
43
44- sleep $4
45+ for i in $(seq 0 $(($4-1)))
46+ do
47+ eval echo "Started $i min ago. Still alive... "
48+ sleep $ONE_MINUTE
49+ done
50
51 for i in $(seq 0 $(($1-1)))
52 do
53--
542.8.1
55
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 @@
1From 04da9478887e705ea38e4f097492da20e651686c Mon Sep 17 00:00:00 2001
2From: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
3Date: Wed, 13 Sep 2017 15:48:42 +0800
4Subject: [PATCH] commands/ar01: Fix for test in deterministic mode
5
6If binutils was configured with --enable-deterministic-archives,
7ar will run in deterministic mode by default, and use zero for
8timestamps and uids/gids, which makes the test case abnormal.
9
10Fix this by add the "U" modifier when deterministic mode is default.
11
12Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
13Signed-off-by: Fei Jie <feij.fnst@cn.fujitsu.com>
14
15Upstream-Status: Backport
16[http://lists.linux.it/pipermail/ltp/2017-September/005668.html]
17
18Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
19---
20 testcases/commands/ar/ar01 | 92 ++++++++++++++++++++++++++--------------------
21 1 file changed, 52 insertions(+), 40 deletions(-)
22
23diff --git a/testcases/commands/ar/ar01 b/testcases/commands/ar/ar01
24index be105f6da..813a51d9c 100644
25--- a/testcases/commands/ar/ar01
26+++ b/testcases/commands/ar/ar01
27@@ -24,16 +24,28 @@
28 #
29 AR="${AR:=ar}"
30 TST_CNT=17
31+TST_SETUP=setup
32 TST_TESTFUNC=test
33 TST_NEEDS_TMPDIR=1
34 TST_NEEDS_CMDS="$AR"
35
36 . tst_test.sh
37
38+setup()
39+{
40+ ar --help | grep "use zero for timestamps and uids/gids (default)" \
41+ >/dev/null
42+ if [ $? -eq 0 ]; then
43+ MOD="U"
44+ else
45+ MOD=""
46+ fi
47+}
48+
49 test1()
50 {
51- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
52- ROD ar -ra file1.in lib.a $TST_DATAROOT/file2.in
53+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
54+ ROD ar -ra"$MOD" file1.in lib.a $TST_DATAROOT/file2.in
55 ROD ar -t lib.a \> ar.out
56
57 printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
58@@ -50,9 +62,9 @@ test1()
59
60 test2()
61 {
62- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
63- $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in
64- ROD ar -ma file1.in lib.a file4.in
65+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
66+ $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in
67+ ROD ar -ma"$MOD" file1.in lib.a file4.in
68 ROD ar -t lib.a \> ar.out
69
70 printf "file1.in\nfile4.in\nfile2.in\nfile3.in\n" > ar.exp
71@@ -69,8 +81,8 @@ test2()
72
73 test3()
74 {
75- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
76- ROD ar -rb file3.in lib.a $TST_DATAROOT/file2.in
77+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
78+ ROD ar -rb"$MOD" file3.in lib.a $TST_DATAROOT/file2.in
79 ROD ar -t lib.a \> ar.out
80
81 printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
82@@ -87,9 +99,9 @@ test3()
83
84 test4()
85 {
86- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
87- $TST_DATAROOT/file2.in
88- ROD ar -mb file3.in lib.a file2.in
89+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
90+ $TST_DATAROOT/file2.in
91+ ROD ar -mb"$MOD" file3.in lib.a file2.in
92 ROD ar -t lib.a \> ar.out
93
94 printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
95@@ -106,7 +118,7 @@ test4()
96
97 test5()
98 {
99- ROD ar -cr lib.a $TST_DATAROOT/file1.in \> ar.out
100+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out
101
102 if [ -s ar.out ]; then
103 tst_res TFAIL "ar produced output unexpectedly (-c)"
104@@ -120,7 +132,7 @@ test5()
105
106 test6()
107 {
108- ROD ar -qc lib.a $TST_DATAROOT/file1.in \> ar.out
109+ ROD ar -qc"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out
110
111 if [ -s ar.out ]; then
112 tst_res TFAIL "ar produced output unexpectedly (-qc)"
113@@ -134,9 +146,9 @@ test6()
114
115 test7()
116 {
117- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
118- $TST_DATAROOT/file3.in
119- ROD ar -d lib.a file1.in file2.in
120+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
121+ $TST_DATAROOT/file3.in
122+ ROD ar -d"$MOD" lib.a file1.in file2.in
123 ROD ar -t lib.a \> ar.out
124
125 printf "file3.in\n" > ar.exp
126@@ -153,9 +165,9 @@ test7()
127
128 test8()
129 {
130- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
131- $TST_DATAROOT/file3.in
132- ROD ar -d lib.a
133+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
134+ $TST_DATAROOT/file3.in
135+ ROD ar -d"$MOD" lib.a
136 ROD ar -t lib.a \> ar.out
137
138 printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
139@@ -172,8 +184,8 @@ test8()
140
141 test9()
142 {
143- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
144- ROD ar -ri file3.in lib.a $TST_DATAROOT/file2.in
145+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
146+ ROD ar -ri"$MOD" file3.in lib.a $TST_DATAROOT/file2.in
147 ROD ar -t lib.a \> ar.out
148
149 printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
150@@ -190,9 +202,9 @@ test9()
151
152 test10()
153 {
154- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
155- $TST_DATAROOT/file2.in
156- ROD ar -mi file3.in lib.a file2.in
157+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
158+ $TST_DATAROOT/file2.in
159+ ROD ar -mi"$MOD" file3.in lib.a file2.in
160 ROD ar -t lib.a \> ar.out
161
162 printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
163@@ -209,9 +221,9 @@ test10()
164
165 test11()
166 {
167- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
168- $TST_DATAROOT/file2.in
169- ROD ar -m lib.a file3.in
170+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
171+ $TST_DATAROOT/file2.in
172+ ROD ar -m"$MOD" lib.a file3.in
173 ROD ar -t lib.a \> ar.out
174
175 printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
176@@ -228,9 +240,9 @@ test11()
177
178 test12()
179 {
180- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
181- $TST_DATAROOT/file3.in
182- ROD ar -p lib.a \> ar.out
183+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
184+ $TST_DATAROOT/file3.in
185+ ROD ar -p"$MOD" lib.a \> ar.out
186
187 printf "This is file one\nThis is file two\nThis is file three\n" > ar.exp
188
189@@ -247,9 +259,9 @@ test12()
190 test13()
191 {
192
193- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
194- $TST_DATAROOT/file3.in
195- ROD ar -q lib.a $TST_DATAROOT/file4.in
196+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
197+ $TST_DATAROOT/file3.in
198+ ROD ar -q"$MOD" lib.a $TST_DATAROOT/file4.in
199 ROD ar -t lib.a \> ar.out
200
201 printf "file1.in\nfile2.in\nfile3.in\nfile4.in\n" > ar.exp
202@@ -267,14 +279,14 @@ test13()
203 test14()
204 {
205 ROD touch file0.in
206- ROD ar -cr lib.a file0.in $TST_DATAROOT/file1.in
207+ ROD ar -cr"$MOD" lib.a file0.in $TST_DATAROOT/file1.in
208
209 file0_mtime1=$(ar -tv lib.a | grep file0.in)
210 file1_mtime1=$(ar -tv lib.a | grep file1.in)
211
212 touch -c -t $(date --date='next day' +"%Y%m%d%H%M") file0.in
213
214- ROD ar -ru lib.a file0.in $TST_DATAROOT/file1.in
215+ ROD ar -ru"$MOD" lib.a file0.in $TST_DATAROOT/file1.in
216
217 file0_mtime2=$(ar -tv lib.a | grep file0.in)
218 file1_mtime2=$(ar -tv lib.a | grep file1.in)
219@@ -296,7 +308,7 @@ test14()
220
221 test15()
222 {
223- ROD ar -cr lib.a $TST_DATAROOT/file1.in
224+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in
225 ROD ar -tv lib.a \> ar.out
226
227 if grep -q '[rwx-]\{9\} [0-9].*/[0-9].*\s*[0-9].*.*file1.in' ar.out; then
228@@ -311,9 +323,9 @@ test15()
229
230 test16()
231 {
232- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
233- $TST_DATAROOT/file3.in
234- ROD ar -xv lib.a \> ar.out
235+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
236+ $TST_DATAROOT/file3.in
237+ ROD ar -xv"$MOD" lib.a \> ar.out
238
239 printf "x - file1.in\nx - file2.in\nx - file3.in\n" > ar.exp
240
241@@ -335,8 +347,8 @@ test16()
242
243 test17()
244 {
245- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in
246- ROD ar -xv lib.a file2.in \> ar.out
247+ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in
248+ ROD ar -xv"$MOD" lib.a file2.in \> ar.out
249
250 printf "x - file2.in\n" > ar.exp
251
252--
2532.19.0.rc2
254
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 @@
1From 34b91edc70709f32b44f6b3a32c8f18db393e36c Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org>
3Date: Wed, 20 Feb 2019 08:07:27 -0600
4Subject: [PATCH] Define __SIGRTMIN and __SIGRTMAX for MUSL
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Some libc implementations might differ in the definitions they
10include. Exempli gratia: MUSL does not define __SIGRTMAX nor
11__SIGRTMIN.
12
13These two tests fail to build because of the missing
14definitions:
15 testcases/kernel/syscalls/ptrace/ptrace05.c
16 testcases/kernel/syscalls/sighold/sighold02.c
17
18Out of precaution, these two also include this header:
19 lib/tst_sig.c
20 testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
21
22Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2019-February/010916.html]
23
24Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
25---
26 include/lapi/signal.h | 24 +++++++++++++++++++
27 lib/tst_sig.c | 1 +
28 testcases/kernel/syscalls/ptrace/ptrace05.c | 1 +
29 .../syscalls/rt_sigsuspend/rt_sigsuspend01.c | 1 +
30 testcases/kernel/syscalls/sighold/sighold02.c | 1 +
31 5 files changed, 28 insertions(+)
32 create mode 100644 include/lapi/signal.h
33
34diff --git a/include/lapi/signal.h b/include/lapi/signal.h
35new file mode 100644
36index 000000000..d22965a94
37--- /dev/null
38+++ b/include/lapi/signal.h
39@@ -0,0 +1,24 @@
40+// SPDX-License-Identifier: GPL-2.0-or-later
41+/*
42+ * Copyright (c) 2019 Linaro Limited. All rights reserved.
43+ * Author: Daniel Díaz <daniel.diaz@linaro.org>
44+ */
45+
46+#ifndef LAPI_SIGNAL_H
47+#define LAPI_SIGNAL_H
48+
49+#include <signal.h>
50+
51+/*
52+ * Some libc implementations might differ in the definitions they include. This
53+ * covers those differences for all tests to successfully build.
54+ */
55+
56+#ifndef __SIGRTMIN
57+# define __SIGRTMIN 32
58+#endif
59+#ifndef __SIGRTMAX
60+# define __SIGRTMAX (_NSIG - 1)
61+#endif
62+
63+#endif
64diff --git a/lib/tst_sig.c b/lib/tst_sig.c
65index 36565e13d..6d77aeafd 100644
66--- a/lib/tst_sig.c
67+++ b/lib/tst_sig.c
68@@ -72,6 +72,7 @@
69 #include <signal.h>
70 #include <unistd.h>
71 #include "test.h"
72+#include "lapi/signal.h"
73
74 #define MAXMESG 150 /* size of mesg string sent to tst_res */
75
76diff --git a/testcases/kernel/syscalls/ptrace/ptrace05.c b/testcases/kernel/syscalls/ptrace/ptrace05.c
77index 420330029..54cfa4d7b 100644
78--- a/testcases/kernel/syscalls/ptrace/ptrace05.c
79+++ b/testcases/kernel/syscalls/ptrace/ptrace05.c
80@@ -38,6 +38,7 @@
81 #include "ptrace.h"
82
83 #include "test.h"
84+#include "lapi/signal.h"
85
86 char *TCID = "ptrace05";
87 int TST_TOTAL = 0;
88diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
89index f17a9aae6..e577cf227 100644
90--- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
91+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
92@@ -18,6 +18,7 @@
93 #include "tst_test.h"
94 #include "lapi/syscalls.h"
95 #include "lapi/safe_rt_signal.h"
96+#include "lapi/signal.h"
97
98 static void sig_handler(int sig)
99 {
100diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
101index d1d4b0b06..b763142df 100644
102--- a/testcases/kernel/syscalls/sighold/sighold02.c
103+++ b/testcases/kernel/syscalls/sighold/sighold02.c
104@@ -49,6 +49,7 @@
105 #include <sys/wait.h>
106 #include "test.h"
107 #include "safe_macros.h"
108+#include "lapi/signal.h"
109
110 /* _XOPEN_SOURCE disables NSIG */
111 #ifndef NSIG
112--
1132.17.1
114
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 @@
1From 430e05c2169ed15aaa6d7f9459edd607603cee02 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org>
3Date: Mon, 25 Feb 2019 10:44:33 -0600
4Subject: [PATCH] setregid01: Fix security warning for string formatting
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9GCC 8.2.0 complains with the following:
10 setregid01.c: In function 'run':
11 setregid01.c:47:3: error: format not a string literal and no format arguments [-Werror=format-security]
12 tst_res(TFAIL | TTERRNO, tc->msg);
13 ^~~~~~~
14because there is no string formatting in the message. This can
15be seen with CFLAGS set to:
16 -Wformat -Wformat-security -Werror=format-security
17as Yocto Project's Poky does, e.g.:
18 http://errors.yoctoproject.org/Errors/Details/230043/
19
20Upstream-Status: Backport [46e1eda55f188810e6bf3a939b92d604321807ae]
21
22Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
23Reviewed-by: Enji Cooper <yaneurabeya@gmail.com>
24---
25 testcases/kernel/syscalls/setregid/setregid01.c | 4 ++--
26 1 file changed, 2 insertions(+), 2 deletions(-)
27
28diff --git a/testcases/kernel/syscalls/setregid/setregid01.c b/testcases/kernel/syscalls/setregid/setregid01.c
29index f2e41e134..8c9e11918 100644
30--- a/testcases/kernel/syscalls/setregid/setregid01.c
31+++ b/testcases/kernel/syscalls/setregid/setregid01.c
32@@ -44,9 +44,9 @@ static void run(unsigned int n)
33 TEST(SETREGID(*tc->arg1, *tc->arg2));
34
35 if (TST_RET == -1)
36- tst_res(TFAIL | TTERRNO, tc->msg);
37+ tst_res(TFAIL | TTERRNO, "%s", tc->msg);
38 else
39- tst_res(TPASS, tc->msg);
40+ tst_res(TPASS, "%s", tc->msg);
41 }
42
43 static void setup(void)
44--
452.17.1
46
diff --git a/meta/recipes-extended/ltp/ltp_20190115.bb b/meta/recipes-extended/ltp/ltp_20190517.bb
index f208b712dd..1f3a94bdfa 100644
--- a/meta/recipes-extended/ltp/ltp_20190115.bb
+++ b/meta/recipes-extended/ltp/ltp_20190517.bb
@@ -27,34 +27,21 @@ CFLAGS_append_x86-64 = " -fomit-frame-pointer"
27 27
28CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" 28CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
29CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" 29CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
30SRCREV = "a6a5caef13632e669dda27b0461726eba546a2f3" 30SRCREV = "ac33ef87f0b9dc56533026435be3ea8c67ce86d2"
31 31
32SRC_URI = "git://github.com/linux-test-project/ltp.git \ 32SRC_URI = "git://github.com/linux-test-project/ltp.git \
33 file://0004-build-Add-option-to-select-libc-implementation.patch \ 33 file://0001-build-Add-option-to-select-libc-implementation.patch \
34 file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \ 34 file://0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
35 file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \ 35 file://0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
36 file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ 36 file://0004-guard-mallocopt-with-__GLIBC__.patch \
37 file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \ 37 file://0005-getdents-define-getdents-getdents64-only-for-glibc.patch \
38 file://0018-guard-mallocopt-with-__GLIBC__.patch \ 38 file://0006-rt_tgsigqueueinfo-disable-test-on-musl.patch \
39 file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \ 39 file://0007-Fix-test_proc_kill-hanging.patch \
40 file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \ 40 file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
41 file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \ 41 file://0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \
42 file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \ 42 file://0010-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch \
43 file://0026-crash01-Define-_GNU_SOURCE.patch \ 43 file://0011-direct_io-diotest4-drop-MAP_FIXED.patch \
44 file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \ 44 file://0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch \
45 file://0034-periodic_output.patch \
46 file://0035-fix-test_proc_kill-hang.patch \
47 file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
48 file://0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch \
49 file://0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \
50 file://define-sigrtmin-and-sigrtmax-for-musl.patch \
51 file://setregid01-security-string-formatting.patch \
52 file://0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch \
53 file://0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch \
54 file://0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch \
55 file://0001-file01.sh-Fix-in-was-not-recognized.patch \
56 file://0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch \
57 file://0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch \
58 " 45 "
59 46
60S = "${WORKDIR}/git" 47S = "${WORKDIR}/git"