summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-02-12 09:54:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-14 11:42:19 +0000
commitb5b8003a0b99fb591f2e2a0a5ed74e60a120dc87 (patch)
treedc2c9b361a74923b39f75c5b1dc0f845a335051d
parentf6b39575fb4cbc7cd9f7fbe57562ebca8901d59d (diff)
downloadpoky-b5b8003a0b99fb591f2e2a0a5ed74e60a120dc87.tar.gz
ltp: Upgrade to 20160126 and fix build on musl
pass -D__SANE_USERSPACE_TYPES__ to CFLAGS MIPS64/PPC64 uses long long for u64 in the kernel, but powerpc's asm/types.h prevents 64-bit userland from seeing this definition, instead defaulting to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get int-ll64.h included. (From OE-Core rev: d17984eda9635f98d4472019d4af83f661b4dfe7) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-Fix-compilation-for-gcc-5.x.patch79
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch202
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch (renamed from meta/recipes-extended/ltp/ltp/ltp-Do-not-link-against-libfl.patch)11
-rw-r--r--meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch43
-rw-r--r--meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch (renamed from meta/recipes-extended/ltp/ltp/add-knob-for-tirpc.patch)20
-rw-r--r--meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch147
-rw-r--r--meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch45
-rw-r--r--meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch31
-rw-r--r--meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch394
-rw-r--r--meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch279
-rw-r--r--meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch270
-rw-r--r--meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch73
-rw-r--r--meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch136
-rw-r--r--meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch351
-rw-r--r--meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch67
-rw-r--r--meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch56
-rw-r--r--meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch64
-rw-r--r--meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch45
-rw-r--r--meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch88
-rw-r--r--meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch32
-rw-r--r--meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch32
-rw-r--r--meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch48
-rw-r--r--meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch71
-rw-r--r--meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch29
-rw-r--r--meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch48
-rw-r--r--meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch68
-rw-r--r--meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch28
-rw-r--r--meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch29
-rw-r--r--meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch29
-rw-r--r--meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch43
-rw-r--r--meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch32
-rw-r--r--meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch33
-rw-r--r--meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch (renamed from meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch)17
-rw-r--r--meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch30
-rw-r--r--meta/recipes-extended/ltp/ltp/add-knob-for-numa.patch39
-rw-r--r--meta/recipes-extended/ltp/ltp/make-setregid02-work.patch61
-rw-r--r--meta/recipes-extended/ltp/ltp_20160126.bb (renamed from meta/recipes-extended/ltp/ltp_20150903.bb)45
37 files changed, 2705 insertions, 410 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-Fix-compilation-for-gcc-5.x.patch b/meta/recipes-extended/ltp/ltp/0001-Fix-compilation-for-gcc-5.x.patch
deleted file mode 100644
index 9407a34584..0000000000
--- a/meta/recipes-extended/ltp/ltp/0001-Fix-compilation-for-gcc-5.x.patch
+++ /dev/null
@@ -1,79 +0,0 @@
1From 40a2457cb8ec42a05a2f96b0810057efdb2a55f5 Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Wed, 16 Sep 2015 13:23:43 +0200
4Subject: [PATCH] Fix compilation for gcc-5.x
5
6The gcc-5.x defaults to -std=gnu11 instead of -std=gnu89 which causes
7semantics for inline functions changes.
8
9GNU89 inline: Same as C99 extern inline.
10
11So the standalone 'inline' causes error such as:
12
13git/testcases/kernel/syscalls/kill/kill10.c:355: undefined reference to `k_sigaction'
14
15Replace inline with static inline to fix this issue.
16
17Ref:
18https://gcc.gnu.org/gcc-5/porting_to.html
19
20Upstream-Status: Backport
21Signed-off-by: Kai Kang <kai.kang@windriver.com>
22Acked-by: Cyril Hrubis <chrubis@suse.cz>
23---
24 testcases/kernel/controllers/libcontrollers/libcontrollers.c | 2 +-
25 testcases/kernel/controllers/libcontrollers/libcontrollers.h | 2 +-
26 testcases/kernel/syscalls/kill/kill10.c | 4 ++--
27 3 files changed, 4 insertions(+), 4 deletions(-)
28
29diff --git a/testcases/kernel/controllers/libcontrollers/libcontrollers.c b/testcases/kernel/controllers/libcontrollers/libcontrollers.c
30index 844c5bc..75766fc 100644
31--- a/testcases/kernel/controllers/libcontrollers/libcontrollers.c
32+++ b/testcases/kernel/controllers/libcontrollers/libcontrollers.c
33@@ -158,7 +158,7 @@ int read_file(char *filepath, int action, unsigned int *value)
34 * Prints error message and returns -1
35 */
36
37-inline void error_function(char *msg1, char *msg2)
38+static inline void error_function(char *msg1, char *msg2)
39 {
40 fprintf(stdout, "ERROR: %s ", msg1);
41 fprintf(stdout, "%s\n", msg2);
42diff --git a/testcases/kernel/controllers/libcontrollers/libcontrollers.h b/testcases/kernel/controllers/libcontrollers/libcontrollers.h
43index bd8e2d8..cdde9f9 100644
44--- a/testcases/kernel/controllers/libcontrollers/libcontrollers.h
45+++ b/testcases/kernel/controllers/libcontrollers/libcontrollers.h
46@@ -70,7 +70,7 @@ enum{
47 GET_TASKS
48 };
49
50-inline void error_function(char *msg1, char *msg2);
51+static inline void error_function(char *msg1, char *msg2);
52
53 int read_shares_file(char *filepath);
54
55diff --git a/testcases/kernel/syscalls/kill/kill10.c b/testcases/kernel/syscalls/kill/kill10.c
56index 982d9da..33dbcd3 100644
57--- a/testcases/kernel/syscalls/kill/kill10.c
58+++ b/testcases/kernel/syscalls/kill/kill10.c
59@@ -185,7 +185,7 @@ int child_checklist_total = 0;
60 int checklist_cmp(const void *a, const void *b);
61 void checklist_reset(int bit);
62
63-inline int k_sigaction(int sig, struct sigaction *sa, struct sigaction *osa);
64+static inline int k_sigaction(int sig, struct sigaction *sa, struct sigaction *osa);
65
66 char *TCID = "kill10";
67 int TST_TOTAL = 1;
68@@ -756,7 +756,7 @@ void checklist_reset(int bit)
69
70 }
71
72-inline int k_sigaction(int sig, struct sigaction *sa, struct sigaction *osa)
73+static inline int k_sigaction(int sig, struct sigaction *sa, struct sigaction *osa)
74 {
75 int ret;
76 if ((ret = sigaction(sig, sa, osa)) == -1) {
77--
781.9.1
79
diff --git a/meta/recipes-extended/ltp/ltp/0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch b/meta/recipes-extended/ltp/ltp/0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch
deleted file mode 100644
index 1b4d2324a5..0000000000
--- a/meta/recipes-extended/ltp/ltp/0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch
+++ /dev/null
@@ -1,202 +0,0 @@
1From 9751a6526cffcdf4e3dc2cb33641259a7be00e19 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Sat, 7 Dec 2013 18:24:32 +0100
4Subject: [PATCH] Rename runtests_noltp.sh script so have unique name
5
6* they are installed in the same target path
7 /opt/ltp/testcases/bin/runtests_noltp.sh
8 and overwrite each other in non-deterministic way
9 when multiple processes are used in "make install"
10
11 ./temp/log.do_install:install -m 00775
12 "ltp/20120903-r2/ltp-20120903/testcases/kernel/containers/sysvipc/runtests_noltp.sh"
13 "ltp/20120903-r2/image/opt/ltp/testcases/bin/runtests_noltp.sh"
14 ./temp/log.do_install:install -m 00775
15 "ltp/20120903-r2/ltp-20120903/testcases/kernel/containers/utsname/runtests_noltp.sh"
16 "ltp/20120903-r2/image/opt/ltp/testcases/bin/runtests_noltp.sh"
17
18Upstream-Status: Pending
19
20Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
21---
22 .../kernel/containers/sysvipc/runipctests_noltp.sh | 31 ++++++++++++++++
23 .../kernel/containers/sysvipc/runtests_noltp.sh | 31 ----------------
24 .../kernel/containers/utsname/runtests_noltp.sh | 41 ----------------------
25 .../kernel/containers/utsname/runutstests_noltp.sh | 41 ++++++++++++++++++++++
26 4 files changed, 72 insertions(+), 72 deletions(-)
27 create mode 100644 testcases/kernel/containers/sysvipc/runipctests_noltp.sh
28 delete mode 100644 testcases/kernel/containers/sysvipc/runtests_noltp.sh
29 delete mode 100755 testcases/kernel/containers/utsname/runtests_noltp.sh
30 create mode 100755 testcases/kernel/containers/utsname/runutstests_noltp.sh
31
32diff --git a/testcases/kernel/containers/sysvipc/runipctests_noltp.sh b/testcases/kernel/containers/sysvipc/runipctests_noltp.sh
33new file mode 100644
34index 0000000..84f398f
35--- /dev/null
36+++ b/testcases/kernel/containers/sysvipc/runipctests_noltp.sh
37@@ -0,0 +1,31 @@
38+#!/bin/sh
39+################################################################################
40+## ##
41+## Copyright (c) International Business Machines Corp., 2007 ##
42+## ##
43+## This program is free software; you can redistribute it and#or modify ##
44+## it under the terms of the GNU General Public License as published by ##
45+## the Free Software Foundation; either version 2 of the License, or ##
46+## (at your option) any later version. ##
47+## ##
48+## This program is distributed in the hope that it will be useful, but ##
49+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
50+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
51+## for more details. ##
52+## ##
53+## You should have received a copy of the GNU General Public License ##
54+## along with this program; if not, write to the Free Software ##
55+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
56+## ##
57+################################################################################
58+
59+exit_code=0
60+echo "sysvipc tests"
61+for type in none clone unshare; do
62+ echo "**sysvipc $type"
63+ ./shmnstest_noltp $type
64+ if [ $? -ne 0 ]; then
65+ exit_code=$?
66+ fi
67+done
68+exit $exit_code
69diff --git a/testcases/kernel/containers/sysvipc/runtests_noltp.sh b/testcases/kernel/containers/sysvipc/runtests_noltp.sh
70deleted file mode 100644
71index 84f398f..0000000
72--- a/testcases/kernel/containers/sysvipc/runtests_noltp.sh
73+++ /dev/null
74@@ -1,31 +0,0 @@
75-#!/bin/sh
76-################################################################################
77-## ##
78-## Copyright (c) International Business Machines Corp., 2007 ##
79-## ##
80-## This program is free software; you can redistribute it and#or modify ##
81-## it under the terms of the GNU General Public License as published by ##
82-## the Free Software Foundation; either version 2 of the License, or ##
83-## (at your option) any later version. ##
84-## ##
85-## This program is distributed in the hope that it will be useful, but ##
86-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
87-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
88-## for more details. ##
89-## ##
90-## You should have received a copy of the GNU General Public License ##
91-## along with this program; if not, write to the Free Software ##
92-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
93-## ##
94-################################################################################
95-
96-exit_code=0
97-echo "sysvipc tests"
98-for type in none clone unshare; do
99- echo "**sysvipc $type"
100- ./shmnstest_noltp $type
101- if [ $? -ne 0 ]; then
102- exit_code=$?
103- fi
104-done
105-exit $exit_code
106diff --git a/testcases/kernel/containers/utsname/runtests_noltp.sh b/testcases/kernel/containers/utsname/runtests_noltp.sh
107deleted file mode 100755
108index 43cb7e2..0000000
109--- a/testcases/kernel/containers/utsname/runtests_noltp.sh
110+++ /dev/null
111@@ -1,41 +0,0 @@
112-#!/bin/sh
113-################################################################################
114-## ##
115-## Copyright (c) International Business Machines Corp., 2007 ##
116-## ##
117-## This program is free software; you can redistribute it and#or modify ##
118-## it under the terms of the GNU General Public License as published by ##
119-## the Free Software Foundation; either version 2 of the License, or ##
120-## (at your option) any later version. ##
121-## ##
122-## This program is distributed in the hope that it will be useful, but ##
123-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
124-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
125-## for more details. ##
126-## ##
127-## You should have received a copy of the GNU General Public License ##
128-## along with this program; if not, write to the Free Software ##
129-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
130-## ##
131-################################################################################
132-
133-oldhostname=`hostname`
134-exit_code=0
135-echo "unshare tests"
136-for i in `seq 1 5`; do
137- echo "test $i (unshare)"
138- ./utstest_noltp unshare $i
139- if [ $? -ne 0 ]; then
140- exit_code=$?
141- fi
142-done
143-echo "clone tests"
144-for i in `seq 1 5`; do
145- echo "test $i (clone)"
146- ./utstest_noltp clone $i
147- if [ $? -ne 0 ]; then
148- exit_code=$?
149- fi
150-done
151-hostname "$oldhostname"
152-exit $exit_code
153diff --git a/testcases/kernel/containers/utsname/runutstests_noltp.sh b/testcases/kernel/containers/utsname/runutstests_noltp.sh
154new file mode 100755
155index 0000000..43cb7e2
156--- /dev/null
157+++ b/testcases/kernel/containers/utsname/runutstests_noltp.sh
158@@ -0,0 +1,41 @@
159+#!/bin/sh
160+################################################################################
161+## ##
162+## Copyright (c) International Business Machines Corp., 2007 ##
163+## ##
164+## This program is free software; you can redistribute it and#or modify ##
165+## it under the terms of the GNU General Public License as published by ##
166+## the Free Software Foundation; either version 2 of the License, or ##
167+## (at your option) any later version. ##
168+## ##
169+## This program is distributed in the hope that it will be useful, but ##
170+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
171+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
172+## for more details. ##
173+## ##
174+## You should have received a copy of the GNU General Public License ##
175+## along with this program; if not, write to the Free Software ##
176+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
177+## ##
178+################################################################################
179+
180+oldhostname=`hostname`
181+exit_code=0
182+echo "unshare tests"
183+for i in `seq 1 5`; do
184+ echo "test $i (unshare)"
185+ ./utstest_noltp unshare $i
186+ if [ $? -ne 0 ]; then
187+ exit_code=$?
188+ fi
189+done
190+echo "clone tests"
191+for i in `seq 1 5`; do
192+ echo "test $i (clone)"
193+ ./utstest_noltp clone $i
194+ if [ $? -ne 0 ]; then
195+ exit_code=$?
196+ fi
197+done
198+hostname "$oldhostname"
199+exit $exit_code
200--
2011.8.4.3
202
diff --git a/meta/recipes-extended/ltp/ltp/ltp-Do-not-link-against-libfl.patch b/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
index 20fd4c3691..585b7cbc6a 100644
--- a/meta/recipes-extended/ltp/ltp/ltp-Do-not-link-against-libfl.patch
+++ b/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
@@ -1,16 +1,15 @@
1From 5bda9c0af56869c6ff2c25d38ea087179c946bc6 Mon Sep 17 00:00:00 2001 1From 14985fccf7428eaa0b45decc22bfd20fd780f621 Mon Sep 17 00:00:00 2001
2From: Chong Lu <Chong.Lu@windriver.com> 2From: Chong Lu <Chong.Lu@windriver.com>
3Date: Tue, 11 Mar 2014 14:47:22 +0800 3Date: Tue, 11 Mar 2014 14:47:22 +0800
4Subject: [PATCH] ltp: Don't link against libfl 4Subject: [PATCH 01/32] ltp: Don't link against libfl
5 5
6We have already defined yywrap function in scan.l file. After this, we no longer need to 6We have already defined yywrap function in scan.l file. After this, we no longer need to
7link against libfl and so no longer get errors about undefined references to yylex. 7link against libfl and so no longer get errors about undefined references to yylex.
8 8
9Upstream-Status: Pending
10
11Signed-off-by: Chong Lu <Chong.Lu@windriver.com> 9Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
12--- 11---
13 pan/Makefile | 2 +- 12 pan/Makefile | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-) 13 1 file changed, 1 insertion(+), 1 deletion(-)
15 14
16diff --git a/pan/Makefile b/pan/Makefile 15diff --git a/pan/Makefile b/pan/Makefile
@@ -27,5 +26,5 @@ index 4cc6466..a4b575b 100644
27 LFLAGS += -l 26 LFLAGS += -l
28 27
29-- 28--
301.7.9.5 292.7.0
31 30
diff --git a/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch b/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch
new file mode 100644
index 0000000000..68725dc7a4
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch
@@ -0,0 +1,43 @@
1From 867ad5d5d64b9b27ee32148027532db0a00f6433 Mon Sep 17 00:00:00 2001
2From: "Roy.Li" <rongqing.li@windriver.com>
3Date: Thu, 7 Jan 2016 17:33:26 +0000
4Subject: [PATCH 02/32] Add knob to control whether numa support should be
5 checked
6
7otherwise undeterministic dependency will be generated
8during build depending upong numa being staged or not
9
10signed-off-by: Roy.Li <rongqing.li@windriver.com>
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 m4/ltp-numa.m4 | 10 +++++++++-
14 1 file changed, 9 insertions(+), 1 deletion(-)
15
16diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4
17index 60ae07b..ed7078d 100644
18--- a/m4/ltp-numa.m4
19+++ b/m4/ltp-numa.m4
20@@ -24,7 +24,13 @@ dnl ----------------------------
21 dnl
22 AC_DEFUN([LTP_CHECK_SYSCALL_NUMA],
23 [dnl
24-AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
25+AC_MSG_CHECKING([for numa])
26+AC_ARG_WITH(
27+ [numa],
28+ AC_HELP_STRING([--without-numa],
29+ [without numa support]),
30+ [],
31+ [AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
32 LTP_SYSCALL_NUMA_HEADERS=yes
33 AC_CHECK_LIB(numa,numa_alloc_onnode,[have_numa_alloc_onnode="yes"])
34 if test "x$have_numa_alloc_onnode" = "xyes"; then
35@@ -48,3 +54,5 @@ if test "x$have_mpol_constants" = "xyes"; then
36 AC_DEFINE(HAVE_MPOL_CONSTANTS,1,[define to 1 if you have all constants required to use mbind tests])
37 fi
38 )])
39+AC_MSG_RESULT([$with_numa])
40+])
41--
422.7.0
43
diff --git a/meta/recipes-extended/ltp/ltp/add-knob-for-tirpc.patch b/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch
index 36ff4c775d..bf1176fc41 100644
--- a/meta/recipes-extended/ltp/ltp/add-knob-for-tirpc.patch
+++ b/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch
@@ -1,14 +1,19 @@
1[PATCH] add knob to control whether tirpc support should be checked 1From b193011da301b3d944e8fddcf4817513c31c5b88 Mon Sep 17 00:00:00 2001
2From: Fathi Boudra <fathi.boudra@linaro.org>
3Date: Thu, 7 Jan 2016 17:36:19 +0000
4Subject: [PATCH 03/32] Add knob to control tirpc support
2 5
3Upstream-Status: Pending 6allow to disable tirpc. Helps to disable it at top level for eg. musl it
4 7does not yet work.
5tirpc support is broken upstream. in the meantime, allow to disable tirpc.
6 8
7Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> 9Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
8--- 11---
9 configure.ac | 9 +++++++++ 12 configure.ac | 9 +++++++++
10 1 file changed, 9 insertions(+) 13 1 file changed, 9 insertions(+)
11 14
15diff --git a/configure.ac b/configure.ac
16index cc50397..9e2936b 100644
12--- a/configure.ac 17--- a/configure.ac
13+++ b/configure.ac 18+++ b/configure.ac
14@@ -98,6 +98,13 @@ if test "x$with_python" = xyes; then 19@@ -98,6 +98,13 @@ if test "x$with_python" = xyes; then
@@ -25,7 +30,7 @@ Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
25 # END tools knobs 30 # END tools knobs
26 31
27 # Testsuites knobs 32 # Testsuites knobs
28@@ -182,7 +189,9 @@ LTP_CHECK_RENAMEAT 33@@ -169,7 +176,9 @@ LTP_CHECK_RENAMEAT2
29 LTP_CHECK_FALLOCATE 34 LTP_CHECK_FALLOCATE
30 LTP_CHECK_SYSCALL_FCNTL 35 LTP_CHECK_SYSCALL_FCNTL
31 LTP_CHECK_SYSCALL_PERF_EVENT_OPEN 36 LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
@@ -35,3 +40,6 @@ Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
35 LTP_CHECK_TEE 40 LTP_CHECK_TEE
36 LTP_CHECK_SPLICE 41 LTP_CHECK_SPLICE
37 LTP_CHECK_VMSPLICE 42 LTP_CHECK_VMSPLICE
43--
442.7.0
45
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
new file mode 100644
index 0000000000..2de936304d
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
@@ -0,0 +1,147 @@
1From 53acddddf1b324e06af886ee4639b774e5c8c8bc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:19:03 +0000
4Subject: [PATCH 04/32] build: Add option to select libc implementation
5
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
8different and does not implement all GNU extentions
9
10Disable tests specifically not building _yet_ on musl based systems
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 Makefile | 5 +++++
15 testcases/kernel/Makefile | 5 ++++-
16 testcases/kernel/sched/Makefile | 4 +++-
17 testcases/kernel/syscalls/Makefile | 5 +++++
18 testcases/network/nfsv4/acl/Makefile | 4 ++++
19 testcases/network/rpc/basic_tests/Makefile | 5 +++++
20 testcases/realtime/func/pi-tests/Makefile | 4 ++++
21 testcases/realtime/stress/pi-tests/Makefile | 5 +++++
22 8 files changed, 35 insertions(+), 2 deletions(-)
23
24diff --git a/Makefile b/Makefile
25index 297f8e7..906b280 100644
26--- a/Makefile
27+++ b/Makefile
28@@ -49,6 +49,11 @@ SKIP_IDCHECK ?= 0
29 UCLINUX ?= 0
30 export UCLINUX
31
32+# System C library implementation (glibc,uclibc,musl etc.)
33+# default to glibc if not set
34+LIBC ?= glibc
35+export LIBC
36+
37 # CLEAN_TARGETS: Targets which exist solely in clean.
38 # COMMON_TARGETS: Targets which exist in all, clean, and install.
39 # INSTALL_TARGETS: Targets which exist in clean and install (contains
40diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
41index 50a12fa..4f1987f 100644
42--- a/testcases/kernel/Makefile
43+++ b/testcases/kernel/Makefile
44@@ -47,13 +47,16 @@ SUBDIRS += connectors \
45 logging \
46 mem \
47 numa \
48- pty \
49 sched \
50 security \
51 timers \
52 tracing \
53 module \
54
55+ifneq ($(LIBC),musl)
56+SUBDIRS += pty
57+endif
58+
59 ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
60 SUBDIRS += power_management
61 endif
62diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile
63index 6245ed0..aa4eb7f 100644
64--- a/testcases/kernel/sched/Makefile
65+++ b/testcases/kernel/sched/Makefile
66@@ -23,5 +23,7 @@
67 top_srcdir ?= ../../..
68
69 include $(top_srcdir)/include/mk/env_pre.mk
70-
71+ifeq ($(LIBC),musl)
72+ FILTER_OUT_DIRS += process_stress
73+endif
74 include $(top_srcdir)/include/mk/generic_trunk_target.mk
75diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
76index 8acb395..b749126 100644
77--- a/testcases/kernel/syscalls/Makefile
78+++ b/testcases/kernel/syscalls/Makefile
79@@ -28,5 +28,10 @@ ifeq ($(UCLINUX),1)
80 FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \
81 mincore mprotect nftw profil remap_file_pages sbrk
82 endif
83+ifeq ($(LIBC),musl)
84+FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \
85+ rt_sigsuspend setdomainname sethostname sigsuspend \
86+ ustat
87+endif
88
89 include $(top_srcdir)/include/mk/generic_trunk_target.mk
90diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile
91index 8bc78c2..c36cf50 100644
92--- a/testcases/network/nfsv4/acl/Makefile
93+++ b/testcases/network/nfsv4/acl/Makefile
94@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk
95
96 LDLIBS += $(ACL_LIBS)
97
98+ifeq ($(LIBC),musl)
99+FILTER_OUT_MAKE_TARGETS := acl1
100+endif
101+
102 include $(top_srcdir)/include/mk/generic_leaf_target.mk
103diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile
104index 3160813..9bdf5d0 100644
105--- a/testcases/network/rpc/basic_tests/Makefile
106+++ b/testcases/network/rpc/basic_tests/Makefile
107@@ -23,4 +23,9 @@
108 top_srcdir ?= ../../../..
109
110 include $(top_srcdir)/include/mk/env_pre.mk
111+
112+ifeq ($(LIBC),musl)
113+FILTER_OUT_DIRS += rpc01
114+endif
115+
116 include $(top_srcdir)/include/mk/generic_trunk_target.mk
117diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile
118index 7a7a57a..5808866 100644
119--- a/testcases/realtime/func/pi-tests/Makefile
120+++ b/testcases/realtime/func/pi-tests/Makefile
121@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk
122 include $(abs_srcdir)/../../config.mk
123
124 MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex
125+ifeq ($(LIBC),musl)
126+FILTER_OUT_MAKE_TARGETS := testpi-5 testpi-6 sbrk_mutex
127+endif
128+
129
130 include $(top_srcdir)/include/mk/generic_leaf_target.mk
131diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile
132index 5edc3b4..aa5987a 100644
133--- a/testcases/realtime/stress/pi-tests/Makefile
134+++ b/testcases/realtime/stress/pi-tests/Makefile
135@@ -24,4 +24,9 @@ top_srcdir ?= ../../../..
136
137 include $(top_srcdir)/include/mk/env_pre.mk
138 include $(abs_srcdir)/../../config.mk
139+
140+ifeq ($(LIBC),musl)
141+FILTER_OUT_MAKE_TARGETS := testpi-3
142+endif
143+
144 include $(top_srcdir)/include/mk/generic_leaf_target.mk
145--
1462.7.0
147
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
new file mode 100644
index 0000000000..8dab1ed2ec
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
@@ -0,0 +1,45 @@
1From 6e3058521b50d91d4b0569c4d491c5af5ff798b2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:22:38 +0000
4Subject: [PATCH 05/32] kernel/controllers: Link with libfts explicitly on musl
5
6musl does not implement fts like glibc and therefore it depends on
7external implementation for all fts APIs
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/controllers/Makefile.inc | 3 +++
12 testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++
13 2 files changed, 6 insertions(+)
14
15diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc
16index b106283..ef5fc0c 100644
17--- a/testcases/kernel/controllers/Makefile.inc
18+++ b/testcases/kernel/controllers/Makefile.inc
19@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB)
20 CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR)
21
22 LDFLAGS += -L$(abs_builddir)/../$(LIBDIR)
23+ifeq ($(LIBC),musl)
24+LDLIBS += -lfts
25+endif
26
27 INSTALL_TARGETS ?= *.sh
28
29diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc
30index 9e002f4..e0fcb9c 100644
31--- a/testcases/kernel/controllers/cpuset/Makefile.inc
32+++ b/testcases/kernel/controllers/cpuset/Makefile.inc
33@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET)
34 LDFLAGS += -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR)
35
36 LDLIBS += -lcpu_set -lcontrollers -lltp
37+ifeq ($(LIBC),musl)
38+LDLIBS += -lfts
39+endif
40
41 INSTALL_TARGETS ?= *.sh
42
43--
442.7.0
45
diff --git a/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch b/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
new file mode 100644
index 0000000000..56a48abcc9
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
@@ -0,0 +1,31 @@
1From fb8b895385a641d74f2186fe5f20a872209692ed Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:24:20 +0000
4Subject: [PATCH 06/32] sendfile: Use off64_t instead of __off64_t
5
6__off64_t is specific to glibc where as off64_t is widely available
7Add _GNU_SOURCE for off64_t defines from sys/types.h
8Fixes
9<command-line>:0:7: error: unknown type name 'off64_t'
10sendfile02.c:97:18: note: in expansion of macro 'OFF_T'
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 testcases/kernel/syscalls/sendfile/Makefile | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/testcases/kernel/syscalls/sendfile/Makefile b/testcases/kernel/syscalls/sendfile/Makefile
18index df7b63f..1bd1b57 100644
19--- a/testcases/kernel/syscalls/sendfile/Makefile
20+++ b/testcases/kernel/syscalls/sendfile/Makefile
21@@ -21,6 +21,6 @@ top_srcdir ?= ../../../..
22 include $(top_srcdir)/include/mk/testcases.mk
23 include $(abs_srcdir)/../utils/newer_64.mk
24
25-%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t
26+%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=off64_t -D_GNU_SOURCE
27
28 include $(top_srcdir)/include/mk/generic_leaf_target.mk
29--
302.7.0
31
diff --git a/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch b/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
new file mode 100644
index 0000000000..4be906ec78
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
@@ -0,0 +1,394 @@
1From 405c03171e4bf0edd698cb602cf7bd7fe1d0401a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:33:53 +0000
4Subject: [PATCH 07/32] replace SIGCLD with SIGCHLD
5
6its defined to use SIGCHLD anyway in
7
8bits/signum.h:#define SIGCLD SIGCHLD /* Same as SIGCHLD
9(System V). */
10
11plus it helps these tests compile with musl which adheres to posix
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 lib/tst_sig.c | 8 ++++----
16 testcases/kernel/connectors/pec/pec_listener.c | 1 +
17 testcases/kernel/fs/doio/doio.c | 4 ++--
18 testcases/kernel/fs/doio/growfiles.c | 2 +-
19 testcases/kernel/syscalls/fcntl/fcntl11.c | 8 ++++----
20 testcases/kernel/syscalls/fcntl/fcntl17.c | 8 ++++----
21 testcases/kernel/syscalls/fcntl/fcntl19.c | 8 ++++----
22 testcases/kernel/syscalls/fcntl/fcntl20.c | 8 ++++----
23 testcases/kernel/syscalls/fcntl/fcntl21.c | 8 ++++----
24 testcases/kernel/syscalls/kill/kill02.c | 6 +++---
25 testcases/kernel/syscalls/kill/kill12.c | 8 ++++----
26 testcases/kernel/syscalls/mkdir/mkdir09.c | 12 ++++++------
27 testcases/kernel/syscalls/sighold/sighold02.c | 2 +-
28 testcases/network/tcp_cmds/perf_lan/pingpong.c | 2 +-
29 testcases/network/tcp_cmds/perf_lan/pingpong6.c | 2 +-
30 15 files changed, 44 insertions(+), 43 deletions(-)
31
32diff --git a/lib/tst_sig.c b/lib/tst_sig.c
33index 3af5ffd..36565e1 100644
34--- a/lib/tst_sig.c
35+++ b/lib/tst_sig.c
36@@ -49,7 +49,7 @@
37 fork_flag - set to FORK or NOFORK depending upon whether the
38 calling program executes a fork() system call. It
39 is normally the case that the calling program treats
40- SIGCLD as an expected signal if fork() is being used.
41+ SIGCHLD as an expected signal if fork() is being used.
42
43 handler - a pointer to the unexpected signal handler to
44 be executed after an unexpected signal has been
45@@ -82,7 +82,7 @@ static void (*tst_setup_signal(int, void (*)(int))) (int);
46
47 /****************************************************************************
48 * tst_sig() : set-up to catch unexpected signals. fork_flag is set to NOFORK
49- * if SIGCLD is to be an "unexpected signal", otherwise it is set to
50+ * if SIGCHLD is to be an "unexpected signal", otherwise it is set to
51 * FORK. cleanup points to a cleanup routine to be executed before
52 * tst_exit is called (cleanup is set to NULL if no cleanup is desired).
53 * handler is a pointer to the signal handling routine (if handler is
54@@ -117,7 +117,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
55 for (sig = 1; sig < NSIG; sig++) {
56 /*
57 * SIGKILL is never unexpected.
58- * SIGCLD is only unexpected when
59+ * SIGCHLD is only unexpected when
60 * no forking is being done.
61 * SIGINFO is used for file quotas and should be expected
62 */
63@@ -205,7 +205,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
64 #endif
65 break;
66
67- case SIGCLD:
68+ case SIGCHLD:
69 if (fork_flag == FORK)
70 continue;
71
72diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
73index a1beb13..002750a 100644
74--- a/testcases/kernel/connectors/pec/pec_listener.c
75+++ b/testcases/kernel/connectors/pec/pec_listener.c
76@@ -20,6 +20,7 @@
77 /* */
78 /******************************************************************************/
79
80+#define _GNU_SOURCE
81 #include <sys/socket.h>
82 #include <sys/poll.h>
83 #include <sys/types.h>
84diff --git a/testcases/kernel/fs/doio/doio.c b/testcases/kernel/fs/doio/doio.c
85index 4b0dec5..5f65ef9 100644
86--- a/testcases/kernel/fs/doio/doio.c
87+++ b/testcases/kernel/fs/doio/doio.c
88@@ -573,7 +573,7 @@ int main(int argc, char **argv)
89 case SIGTSTP:
90 case SIGSTOP:
91 case SIGCONT:
92- case SIGCLD:
93+ case SIGCHLD:
94 case SIGBUS:
95 case SIGSEGV:
96 case SIGQUIT:
97@@ -615,7 +615,7 @@ int main(int argc, char **argv)
98 }
99
100 sigemptyset(&block_mask);
101- sigaddset(&block_mask, SIGCLD);
102+ sigaddset(&block_mask, SIGCHLD);
103 sigprocmask(SIG_BLOCK, &block_mask, &omask);
104
105 /*
106diff --git a/testcases/kernel/fs/doio/growfiles.c b/testcases/kernel/fs/doio/growfiles.c
107index 09e7f35..bbad230 100644
108--- a/testcases/kernel/fs/doio/growfiles.c
109+++ b/testcases/kernel/fs/doio/growfiles.c
110@@ -1640,7 +1640,7 @@ int set_sig(void)
111 #ifdef SIGRESTART
112 case SIGRESTART:
113 #endif /* SIGRESTART */
114- case SIGCLD:
115+ case SIGCHLD:
116 break;
117
118 default:
119diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
120index fa6ce53..2de2b6c 100644
121--- a/testcases/kernel/syscalls/fcntl/fcntl11.c
122+++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
123@@ -105,10 +105,10 @@ void setup(void)
124 memset(&act, 0, sizeof(act));
125 act.sa_handler = catch_child;
126 sigemptyset(&act.sa_mask);
127- sigaddset(&act.sa_mask, SIGCLD);
128- if ((sigaction(SIGCLD, &act, NULL)) < 0)
129+ sigaddset(&act.sa_mask, SIGCHLD);
130+ if ((sigaction(SIGCHLD, &act, NULL)) < 0)
131 tst_brkm(TBROK | TERRNO, cleanup,
132- "sigaction(SIGCLD, ..) failed");
133+ "sigaction(SIGCHLD, ..) failed");
134 }
135
136 void do_child(void)
137@@ -227,7 +227,7 @@ void stop_child(void)
138 {
139 struct flock fl;
140
141- signal(SIGCLD, SIG_DFL);
142+ signal(SIGCHLD, SIG_DFL);
143 fl.l_type = STOP;
144 parent_put(&fl);
145 wait(0);
146diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c
147index 5b03e39..6598b20 100644
148--- a/testcases/kernel/syscalls/fcntl/fcntl17.c
149+++ b/testcases/kernel/syscalls/fcntl/fcntl17.c
150@@ -150,9 +150,9 @@ int setup(void)
151 memset(&act, 0, sizeof(act));
152 act.sa_handler = catch_child;
153 sigemptyset(&act.sa_mask);
154- sigaddset(&act.sa_mask, SIGCLD);
155- if (sigaction(SIGCLD, &act, NULL) < 0) {
156- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
157+ sigaddset(&act.sa_mask, SIGCHLD);
158+ if (sigaction(SIGCHLD, &act, NULL) < 0) {
159+ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
160 return 1;
161 }
162 return 0;
163@@ -381,7 +381,7 @@ void stop_children(void)
164 {
165 int arg;
166
167- signal(SIGCLD, SIG_DFL);
168+ signal(SIGCHLD, SIG_DFL);
169 arg = STOP;
170 child_free(child_pipe1[1], arg);
171 child_free(child_pipe2[1], arg);
172diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
173index a542cfc..88c91d6 100644
174--- a/testcases/kernel/syscalls/fcntl/fcntl19.c
175+++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
176@@ -112,9 +112,9 @@ void setup(void)
177 memset(&act, 0, sizeof(act));
178 act.sa_handler = catch_child;
179 sigemptyset(&act.sa_mask);
180- sigaddset(&act.sa_mask, SIGCLD);
181- if ((sigaction(SIGCLD, &act, NULL)) < 0) {
182- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
183+ sigaddset(&act.sa_mask, SIGCHLD);
184+ if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
185+ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
186 fail = 1;
187 }
188 }
189@@ -265,7 +265,7 @@ void stop_child(void)
190 {
191 struct flock fl;
192
193- signal(SIGCLD, SIG_DFL);
194+ signal(SIGCHLD, SIG_DFL);
195 fl.l_type = STOP;
196 parent_put(&fl);
197 wait(0);
198diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
199index aa06bab..99fd783 100644
200--- a/testcases/kernel/syscalls/fcntl/fcntl20.c
201+++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
202@@ -109,9 +109,9 @@ void setup(void)
203 memset(&act, 0, sizeof(act));
204 act.sa_handler = catch_child;
205 sigemptyset(&act.sa_mask);
206- sigaddset(&act.sa_mask, SIGCLD);
207- if (sigaction(SIGCLD, &act, NULL) == -1)
208- tst_brkm(TFAIL | TERRNO, cleanup, "SIGCLD signal setup failed");
209+ sigaddset(&act.sa_mask, SIGCHLD);
210+ if (sigaction(SIGCHLD, &act, NULL) == -1)
211+ tst_brkm(TFAIL | TERRNO, cleanup, "SIGCHLD signal setup failed");
212 }
213
214 void cleanup(void)
215@@ -264,7 +264,7 @@ void stop_child(void)
216 {
217 struct flock fl;
218
219- signal(SIGCLD, SIG_DFL);
220+ signal(SIGCHLD, SIG_DFL);
221 fl.l_type = STOP;
222 parent_put(&fl);
223 wait(0);
224diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
225index 5307021..8f1a67c 100644
226--- a/testcases/kernel/syscalls/fcntl/fcntl21.c
227+++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
228@@ -110,9 +110,9 @@ void setup(void)
229 memset(&act, 0, sizeof(act));
230 act.sa_handler = catch_child;
231 sigemptyset(&act.sa_mask);
232- sigaddset(&act.sa_mask, SIGCLD);
233- if ((sigaction(SIGCLD, &act, NULL)) < 0) {
234- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
235+ sigaddset(&act.sa_mask, SIGCHLD);
236+ if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
237+ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
238 fail = 1;
239 }
240 }
241@@ -272,7 +272,7 @@ void stop_child(void)
242 {
243 struct flock fl;
244
245- signal(SIGCLD, SIG_DFL);
246+ signal(SIGCHLD, SIG_DFL);
247 fl.l_type = STOP;
248 parent_put(&fl);
249 wait(0);
250diff --git a/testcases/kernel/syscalls/kill/kill02.c b/testcases/kernel/syscalls/kill/kill02.c
251index 9d6cc68..08360dd 100644
252--- a/testcases/kernel/syscalls/kill/kill02.c
253+++ b/testcases/kernel/syscalls/kill/kill02.c
254@@ -701,7 +701,7 @@ void setup(void)
255
256 /*
257 * Set to catch unexpected signals.
258- * SIGCLD is set to be ignored because we do not wait for termination status.
259+ * SIGCHLD is set to be ignored because we do not wait for termination status.
260 * SIGUSR1 is set to be ignored because this is the signal we are using for
261 * the test and we are not concerned with the parent getting it.
262 */
263@@ -713,9 +713,9 @@ void setup(void)
264 "signal(SIGUSR1, SIG_IGN) failed");
265 }
266
267- if (signal(SIGCLD, SIG_IGN) == SIG_ERR) {
268+ if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) {
269 tst_brkm(TBROK | TERRNO, NULL,
270- "signal(SIGCLD, SIG_IGN) failed");
271+ "signal(SIGCHLD, SIG_IGN) failed");
272 }
273
274 TEST_PAUSE;
275diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c
276index 7a47a4a..d7c4147 100644
277--- a/testcases/kernel/syscalls/kill/kill12.c
278+++ b/testcases/kernel/syscalls/kill/kill12.c
279@@ -98,7 +98,7 @@ int main(int argc, char **argv)
280
281 exno = 1;
282
283- if (sigset(SIGCLD, chsig) == SIG_ERR) {
284+ if (sigset(SIGCHLD, chsig) == SIG_ERR) {
285 fprintf(temp, "\tsigset failed, errno = %d\n", errno);
286 fail_exit();
287 }
288@@ -128,7 +128,7 @@ int main(int argc, char **argv)
289 sleep(1);
290
291 kill(pid, sig); /* child should ignroe this sig */
292- kill(pid, SIGCLD); /* child should exit */
293+ kill(pid, SIGCHLD); /* child should exit */
294
295 #ifdef BCS
296 while ((npid = wait(&status)) != pid
297@@ -222,14 +222,14 @@ void do_child(void)
298 int exno = 1;
299
300 #ifdef UCLINUX
301- if (sigset(SIGCLD, chsig) == SIG_ERR) {
302+ if (sigset(SIGCHLD, chsig) == SIG_ERR) {
303 fprintf(temp, "\tsigset failed, errno = %d\n", errno);
304 fail_exit();
305 }
306 #endif
307
308 sigset(sig, SIG_IGN); /* set to ignore signal */
309- kill(getppid(), SIGCLD); /* tell parent we are ready */
310+ kill(getppid(), SIGCHLD); /* tell parent we are ready */
311 while (!chflag)
312 sleep(1); /* wait for parent */
313
314diff --git a/testcases/kernel/syscalls/mkdir/mkdir09.c b/testcases/kernel/syscalls/mkdir/mkdir09.c
315index 41c20e9..07b4fb8 100644
316--- a/testcases/kernel/syscalls/mkdir/mkdir09.c
317+++ b/testcases/kernel/syscalls/mkdir/mkdir09.c
318@@ -122,10 +122,10 @@ int main(int argc, char *argv[])
319
320 }
321
322- /* Set up to catch SIGCLD signal */
323- if (signal(SIGCLD, chld) == SIG_ERR) {
324+ /* Set up to catch SIGCHLD signal */
325+ if (signal(SIGCHLD, chld) == SIG_ERR) {
326 tst_brkm(TFAIL, cleanup,
327- "Error setting up SIGCLD signal, ERRNO = %d", errno);
328+ "Error setting up SIGCHLD signal, ERRNO = %d", errno);
329
330 }
331
332@@ -236,9 +236,9 @@ int runtest(void)
333 tst_brkm(TFAIL, cleanup,
334 "Error resetting SIGTERM signal, ERRNO = %d", errno);
335 }
336- if (signal(SIGCLD, SIG_DFL) == SIG_ERR) {
337+ if (signal(SIGCHLD, SIG_DFL) == SIG_ERR) {
338 tst_brkm(TFAIL, cleanup,
339- "Error resetting SIGCLD signal, ERRNO = %d", errno);
340+ "Error resetting SIGCHLD signal, ERRNO = %d", errno);
341 }
342
343 if (test_time) {
344@@ -372,7 +372,7 @@ void term(int sig)
345
346 void chld(int sig)
347 {
348- /* Routine to handle SIGCLD signal. */
349+ /* Routine to handle SIGCHLD signal. */
350
351 sigchld++;
352 if (jump) {
353diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
354index e3076fb..be01874 100644
355--- a/testcases/kernel/syscalls/sighold/sighold02.c
356+++ b/testcases/kernel/syscalls/sighold/sighold02.c
357@@ -77,7 +77,7 @@ static int sigs_map[NUMSIGS];
358 static int skip_sig(int sig)
359 {
360 switch (sig) {
361- case SIGCLD:
362+ case SIGCHLD:
363 case SIGKILL:
364 case SIGALRM:
365 case SIGSTOP:
366diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong.c b/testcases/network/tcp_cmds/perf_lan/pingpong.c
367index 1196312..5b06798 100644
368--- a/testcases/network/tcp_cmds/perf_lan/pingpong.c
369+++ b/testcases/network/tcp_cmds/perf_lan/pingpong.c
370@@ -182,7 +182,7 @@ int main(int argc, char *argv[])
371
372 /* Setup traps */
373 signal(SIGINT, finish);
374- signal(SIGCLD, finish);
375+ signal(SIGCHLD, finish);
376
377 /* Fork a child process to continue sending packets */
378 tst_resm(TINFO, "Create a child process to continue to send packets");
379diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong6.c b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
380index 9747f58..0a0fb1d 100644
381--- a/testcases/network/tcp_cmds/perf_lan/pingpong6.c
382+++ b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
383@@ -153,7 +153,7 @@ char *argv[];
384
385 /* Setup traps */
386 signal(SIGINT, finish);
387- signal(SIGCLD, finish);
388+ signal(SIGCHLD, finish);
389
390 /* Fork a child process to continue sending packets */
391 printf("Create a child process to continue to send packets \n");
392--
3932.7.0
394
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
new file mode 100644
index 0000000000..59e169e99c
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
@@ -0,0 +1,279 @@
1From 714024e4699b28eed866d775f4c715b0e55b76f7 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 08/32] 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---
11 testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++++-
12 testcases/kernel/syscalls/getcpu/getcpu01.c | 31 ++++++++++++++++++++++
13 .../sched_getaffinity/sched_getaffinity01.c | 26 ++++++++++++++++++
14 3 files changed, 65 insertions(+), 1 deletion(-)
15
16diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c
17index 6072bfa..2b090cb 100644
18--- a/testcases/kernel/syscalls/accept4/accept4_01.c
19+++ b/testcases/kernel/syscalls/accept4/accept4_01.c
20@@ -64,6 +64,7 @@ static void cleanup(void)
21 tst_rmdir();
22 }
23
24+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
25 #if !(__GLIBC_PREREQ(2, 10))
26 static int
27 accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
28@@ -82,7 +83,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
29 }
30 tst_resm(TINFO, "\n");
31 #endif
32-
33 #if USE_SOCKETCALL
34 long args[6];
35
36@@ -97,6 +97,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
37 #endif
38 }
39 #endif
40+#endif
41
42 static void
43 do_test(int lfd, struct sockaddr_in *conn_addr,
44@@ -119,9 +120,15 @@ do_test(int lfd, struct sockaddr_in *conn_addr,
45 die("Connect Error");
46
47 addrlen = sizeof(struct sockaddr_in);
48+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
49 #if !(__GLIBC_PREREQ(2, 10))
50 acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen,
51 closeonexec_flag | nonblock_flag);
52+
53+#else
54+ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
55+ closeonexec_flag | nonblock_flag);
56+#endif
57 #else
58 acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
59 closeonexec_flag | nonblock_flag);
60diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c
61index c927512..6de6362 100644
62--- a/testcases/kernel/syscalls/getcpu/getcpu01.c
63+++ b/testcases/kernel/syscalls/getcpu/getcpu01.c
64@@ -62,6 +62,7 @@
65 #include <dirent.h>
66
67 #if defined(__i386__) || defined(__x86_64__)
68+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
69 #if __GLIBC_PREREQ(2,6)
70 #if defined(__x86_64__)
71 #include <utmpx.h>
72@@ -72,13 +73,16 @@ int sys_support = 1;
73 #else
74 int sys_support = 0;
75 #endif
76+#endif
77 #else
78 int sys_support = 0;
79 #endif
80
81+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
82 #if !(__GLIBC_PREREQ(2, 7))
83 #define CPU_FREE(ptr) free(ptr)
84 #endif
85+#endif
86
87 void cleanup(void);
88 void setup(void);
89@@ -164,9 +168,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
90 {
91 #if defined(__i386__)
92 return syscall(318, cpu_id, node_id, cache_struct);
93+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
94 #elif __GLIBC_PREREQ(2,6)
95 *cpu_id = sched_getcpu();
96 #endif
97+#endif
98 return 0;
99 }
100
101@@ -191,15 +197,20 @@ unsigned int set_cpu_affinity(void)
102 cpu_set_t *set;
103 size_t size;
104 int nrcpus = 1024;
105+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
106 #if __GLIBC_PREREQ(2, 7)
107 realloc:
108 set = CPU_ALLOC(nrcpus);
109 #else
110 set = malloc(sizeof(cpu_set_t));
111 #endif
112+#else
113+ set = malloc(sizeof(cpu_set_t));
114+#endif
115 if (set == NULL) {
116 tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno);
117 }
118+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
119 #if __GLIBC_PREREQ(2, 7)
120 size = CPU_ALLOC_SIZE(nrcpus);
121 CPU_ZERO_S(size, set);
122@@ -207,8 +218,13 @@ realloc:
123 size = sizeof(cpu_set_t);
124 CPU_ZERO(set);
125 #endif
126+#else
127+ size = sizeof(cpu_set_t);
128+ CPU_ZERO(set);
129+#endif
130 if (sched_getaffinity(0, size, set) < 0) {
131 CPU_FREE(set);
132+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
133 #if __GLIBC_PREREQ(2, 7)
134 if (errno == EINVAL && nrcpus < (1024 << 8)) {
135 nrcpus = nrcpus << 2;
136@@ -220,10 +236,17 @@ realloc:
137 "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)");
138 else
139 #endif
140+#else
141+ if (errno == EINVAL)
142+ tst_resm(TFAIL,
143+ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)");
144+ else
145+#endif
146 tst_resm(TFAIL, "sched_getaffinity:errno:%d", errno);
147 tst_exit();
148 }
149 cpu_max = max_cpuid(size, set);
150+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
151 #if __GLIBC_PREREQ(2, 7)
152 CPU_ZERO_S(size, set);
153 CPU_SET_S(cpu_max, size, set);
154@@ -231,6 +254,10 @@ realloc:
155 CPU_ZERO(set);
156 CPU_SET(cpu_max, set);
157 #endif
158+#else
159+ CPU_ZERO(set);
160+ CPU_SET(cpu_max, set);
161+#endif
162 if (sched_setaffinity(0, size, set) < 0) {
163 CPU_FREE(set);
164 tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno);
165@@ -247,11 +274,15 @@ unsigned int max_cpuid(size_t size, cpu_set_t * set)
166 {
167 unsigned int index, max = 0;
168 for (index = 0; index < size * BITS_PER_BYTE; index++)
169+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
170 #if __GLIBC_PREREQ(2, 7)
171 if (CPU_ISSET_S(index, size, set))
172 #else
173 if (CPU_ISSET(index, set))
174 #endif
175+#else
176+ if (CPU_ISSET(index, set))
177+#endif
178 max = index;
179 return max;
180 }
181diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
182index 9d6a81a..4ed13b2 100644
183--- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
184+++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
185@@ -66,9 +66,11 @@ do { \
186 tst_resm((TEST_RETURN == -1 ? TPASS : TFAIL) | TTERRNO, #t); \
187 } while (0)
188
189+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
190 #if !(__GLIBC_PREREQ(2, 7))
191 #define CPU_FREE(ptr) free(ptr)
192 #endif
193+#endif
194
195 int main(int ac, char **av)
196 {
197@@ -95,14 +97,19 @@ static void do_test(void)
198 pid_t unused_pid;
199 unsigned len;
200
201+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
202 #if __GLIBC_PREREQ(2, 7)
203 realloc:
204 mask = CPU_ALLOC(nrcpus);
205 #else
206 mask = malloc(sizeof(cpu_set_t));
207 #endif
208+#else
209+ mask = malloc(sizeof(cpu_set_t));
210+#endif
211 if (mask == NULL)
212 tst_brkm(TFAIL | TTERRNO, cleanup, "fail to get enough memory");
213+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
214 #if __GLIBC_PREREQ(2, 7)
215 len = CPU_ALLOC_SIZE(nrcpus);
216 CPU_ZERO_S(len, mask);
217@@ -110,10 +117,15 @@ realloc:
218 len = sizeof(cpu_set_t);
219 CPU_ZERO(mask);
220 #endif
221+#else
222+ len = sizeof(cpu_set_t);
223+ CPU_ZERO(mask);
224+#endif
225 /* positive test */
226 TEST(sched_getaffinity(0, len, mask));
227 if (TEST_RETURN == -1) {
228 CPU_FREE(mask);
229+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
230 #if __GLIBC_PREREQ(2, 7)
231 if (errno == EINVAL && nrcpus < (1024 << 8)) {
232 nrcpus = nrcpus << 2;
233@@ -125,17 +137,27 @@ realloc:
234 "newer glibc(>= 2.7)");
235 else
236 #endif
237+#else
238+ if (errno == EINVAL)
239+ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a "
240+ "newer glibc(>= 2.7)");
241+ else
242+#endif
243 tst_resm(TFAIL | TTERRNO, "fail to get cpu affinity");
244 cleanup();
245 } else {
246 tst_resm(TINFO, "cpusetsize is %d", len);
247 tst_resm(TINFO, "mask.__bits[0] = %lu ", mask->__bits[0]);
248 for (i = 0; i < num; i++) {
249+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
250 #if __GLIBC_PREREQ(2, 7)
251 TEST(CPU_ISSET_S(i, len, mask));
252 #else
253 TEST(CPU_ISSET(i, mask));
254 #endif
255+#else
256+ TEST(CPU_ISSET(i, mask));
257+#endif
258 if (TEST_RETURN != -1)
259 tst_resm(TPASS, "sched_getaffinity() succeed, "
260 "this process %d is running "
261@@ -143,11 +165,15 @@ realloc:
262 }
263 }
264
265+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
266 #if __GLIBC_PREREQ(2, 7)
267 CPU_ZERO_S(len, mask);
268 #else
269 CPU_ZERO(mask);
270 #endif
271+#else
272+ CPU_ZERO(mask);
273+#endif
274 /* negative tests */
275 QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1));
276 QUICK_TEST(sched_getaffinity(0, 0, mask));
277--
2782.7.0
279
diff --git a/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch b/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
new file mode 100644
index 0000000000..e58e5a96b0
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
@@ -0,0 +1,270 @@
1From 4ba19d64e95a874995d0b554b891b5ec35bd9495 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:45:35 +0000
4Subject: [PATCH 09/32] Guard error.h with __GLIBC__
5
6error API is specific to glibc so use the guard to make it conditional
7on glibc
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/syscalls/faccessat/faccessat01.c | 2 ++
12 testcases/kernel/syscalls/fallocate/fallocate01.c | 2 ++
13 testcases/kernel/syscalls/fchmodat/fchmodat01.c | 2 ++
14 testcases/kernel/syscalls/fchownat/fchownat01.c | 2 ++
15 testcases/kernel/syscalls/fchownat/fchownat02.c | 2 ++
16 testcases/kernel/syscalls/fstatat/fstatat01.c | 2 ++
17 testcases/kernel/syscalls/futimesat/futimesat01.c | 2 ++
18 testcases/kernel/syscalls/linkat/linkat01.c | 2 ++
19 testcases/kernel/syscalls/linkat/linkat02.c | 2 ++
20 testcases/kernel/syscalls/mkdirat/mkdirat01.c | 2 ++
21 testcases/kernel/syscalls/mknodat/mknodat01.c | 2 ++
22 testcases/kernel/syscalls/mknodat/mknodat02.c | 2 ++
23 testcases/kernel/syscalls/openat/openat01.c | 2 ++
24 testcases/kernel/syscalls/readlinkat/readlinkat01.c | 2 ++
25 testcases/kernel/syscalls/renameat/renameat01.c | 2 ++
26 testcases/kernel/syscalls/symlinkat/symlinkat01.c | 2 ++
27 testcases/kernel/syscalls/unlinkat/unlinkat01.c | 2 ++
28 17 files changed, 34 insertions(+)
29
30diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
31index 7f0e87a..c72dcf0 100644
32--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
33+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
34@@ -37,7 +37,9 @@
35 #include <sys/stat.h>
36 #include <fcntl.h>
37 #include <unistd.h>
38+#ifdef __GLIBC__
39 #include <error.h>
40+#endif
41 #include <stdlib.h>
42 #include <errno.h>
43 #include <string.h>
44diff --git a/testcases/kernel/syscalls/fallocate/fallocate01.c b/testcases/kernel/syscalls/fallocate/fallocate01.c
45index e72b123..643c0e2 100644
46--- a/testcases/kernel/syscalls/fallocate/fallocate01.c
47+++ b/testcases/kernel/syscalls/fallocate/fallocate01.c
48@@ -96,7 +96,9 @@
49 #include <fcntl.h>
50 #include <sys/syscall.h>
51 #include <unistd.h>
52+#ifdef __GLIBC__
53 #include <error.h>
54+#endif
55 #include <inttypes.h>
56 #include <sys/utsname.h>
57
58diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
59index 19e9ad5..ae6d807 100644
60--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
61+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
62@@ -37,7 +37,9 @@
63 #include <sys/stat.h>
64 #include <fcntl.h>
65 #include <unistd.h>
66+#ifdef __GLIBC__
67 #include <error.h>
68+#endif
69 #include <stdlib.h>
70 #include <errno.h>
71 #include <string.h>
72diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c b/testcases/kernel/syscalls/fchownat/fchownat01.c
73index b361253..a5218af 100644
74--- a/testcases/kernel/syscalls/fchownat/fchownat01.c
75+++ b/testcases/kernel/syscalls/fchownat/fchownat01.c
76@@ -28,7 +28,9 @@
77 #include <sys/stat.h>
78 #include <fcntl.h>
79 #include <unistd.h>
80+#ifdef __GLIBC__
81 #include <error.h>
82+#endif
83 #include <stdlib.h>
84 #include <errno.h>
85 #include <string.h>
86diff --git a/testcases/kernel/syscalls/fchownat/fchownat02.c b/testcases/kernel/syscalls/fchownat/fchownat02.c
87index 6b0304c..8d2863f 100644
88--- a/testcases/kernel/syscalls/fchownat/fchownat02.c
89+++ b/testcases/kernel/syscalls/fchownat/fchownat02.c
90@@ -26,7 +26,9 @@
91 #include <sys/stat.h>
92 #include <fcntl.h>
93 #include <unistd.h>
94+#ifdef __GLIBC__
95 #include <error.h>
96+#endif
97 #include <stdlib.h>
98 #include <errno.h>
99 #include <string.h>
100diff --git a/testcases/kernel/syscalls/fstatat/fstatat01.c b/testcases/kernel/syscalls/fstatat/fstatat01.c
101index 61531c6..e99fbd2 100644
102--- a/testcases/kernel/syscalls/fstatat/fstatat01.c
103+++ b/testcases/kernel/syscalls/fstatat/fstatat01.c
104@@ -48,7 +48,9 @@
105 #include <sys/stat.h>
106 #include <sys/time.h>
107 #include <fcntl.h>
108+#ifdef __GLIBC__
109 #include <error.h>
110+#endif
111 #include <stdlib.h>
112 #include <errno.h>
113 #include <string.h>
114diff --git a/testcases/kernel/syscalls/futimesat/futimesat01.c b/testcases/kernel/syscalls/futimesat/futimesat01.c
115index ae8d4fe..316dd78 100644
116--- a/testcases/kernel/syscalls/futimesat/futimesat01.c
117+++ b/testcases/kernel/syscalls/futimesat/futimesat01.c
118@@ -37,7 +37,9 @@
119 #include <sys/stat.h>
120 #include <sys/time.h>
121 #include <fcntl.h>
122+#ifdef __GLIBC__
123 #include <error.h>
124+#endif
125 #include <stdlib.h>
126 #include <errno.h>
127 #include <string.h>
128diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c
129index fc0687b..83cbfe7 100644
130--- a/testcases/kernel/syscalls/linkat/linkat01.c
131+++ b/testcases/kernel/syscalls/linkat/linkat01.c
132@@ -49,7 +49,9 @@
133 #include <sys/time.h>
134 #include <fcntl.h>
135 #include <unistd.h>
136+#ifdef __GLIBC__
137 #include <error.h>
138+#endif
139 #include <stdlib.h>
140 #include <errno.h>
141 #include <string.h>
142diff --git a/testcases/kernel/syscalls/linkat/linkat02.c b/testcases/kernel/syscalls/linkat/linkat02.c
143index e9a752a..8d7e431 100644
144--- a/testcases/kernel/syscalls/linkat/linkat02.c
145+++ b/testcases/kernel/syscalls/linkat/linkat02.c
146@@ -23,7 +23,9 @@
147 #include <sys/stat.h>
148 #include <fcntl.h>
149 #include <unistd.h>
150+#ifdef __GLIBC__
151 #include <error.h>
152+#endif
153 #include <stdlib.h>
154 #include <errno.h>
155 #include <string.h>
156diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
157index 7e15947..1dbc038 100644
158--- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c
159+++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
160@@ -30,7 +30,9 @@
161 #include <sys/types.h>
162 #include <sys/stat.h>
163 #include <fcntl.h>
164+#ifdef __GLIBC__
165 #include <error.h>
166+#endif
167 #include <stdlib.h>
168 #include <errno.h>
169 #include <string.h>
170diff --git a/testcases/kernel/syscalls/mknodat/mknodat01.c b/testcases/kernel/syscalls/mknodat/mknodat01.c
171index 26e5538..f034f05 100644
172--- a/testcases/kernel/syscalls/mknodat/mknodat01.c
173+++ b/testcases/kernel/syscalls/mknodat/mknodat01.c
174@@ -29,7 +29,9 @@
175 #include <sys/types.h>
176 #include <fcntl.h>
177 #include <sys/stat.h>
178+#ifdef __GLIBC__
179 #include <error.h>
180+#endif
181 #include <stdlib.h>
182 #include <errno.h>
183 #include <string.h>
184diff --git a/testcases/kernel/syscalls/mknodat/mknodat02.c b/testcases/kernel/syscalls/mknodat/mknodat02.c
185index f6368fa..7d0f7c0 100644
186--- a/testcases/kernel/syscalls/mknodat/mknodat02.c
187+++ b/testcases/kernel/syscalls/mknodat/mknodat02.c
188@@ -29,7 +29,9 @@
189 #include <sys/types.h>
190 #include <fcntl.h>
191 #include <sys/stat.h>
192+#ifdef __GLIBC__
193 #include <error.h>
194+#endif
195 #include <stdlib.h>
196 #include <errno.h>
197 #include <string.h>
198diff --git a/testcases/kernel/syscalls/openat/openat01.c b/testcases/kernel/syscalls/openat/openat01.c
199index 85f9a91..4ee0117 100644
200--- a/testcases/kernel/syscalls/openat/openat01.c
201+++ b/testcases/kernel/syscalls/openat/openat01.c
202@@ -29,7 +29,9 @@
203 #include <sys/types.h>
204 #include <sys/stat.h>
205 #include <fcntl.h>
206+#ifdef __GLIBC__
207 #include <error.h>
208+#endif
209 #include <stdlib.h>
210 #include <errno.h>
211 #include <string.h>
212diff --git a/testcases/kernel/syscalls/readlinkat/readlinkat01.c b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
213index 97a49e8..b162853 100644
214--- a/testcases/kernel/syscalls/readlinkat/readlinkat01.c
215+++ b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
216@@ -29,7 +29,9 @@
217 #include <sys/stat.h>
218 #include <sys/time.h>
219 #include <fcntl.h>
220+#ifdef __GLIBC__
221 #include <error.h>
222+#endif
223 #include <stdlib.h>
224 #include <errno.h>
225 #include <string.h>
226diff --git a/testcases/kernel/syscalls/renameat/renameat01.c b/testcases/kernel/syscalls/renameat/renameat01.c
227index f4cd51b..105a05b 100644
228--- a/testcases/kernel/syscalls/renameat/renameat01.c
229+++ b/testcases/kernel/syscalls/renameat/renameat01.c
230@@ -42,7 +42,9 @@
231 #include <sys/stat.h>
232 #include <sys/time.h>
233 #include <fcntl.h>
234+#ifdef __GLIBC__
235 #include <error.h>
236+#endif
237 #include <stdlib.h>
238 #include <errno.h>
239 #include <string.h>
240diff --git a/testcases/kernel/syscalls/symlinkat/symlinkat01.c b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
241index 5c238d8..cb7a7e8 100644
242--- a/testcases/kernel/syscalls/symlinkat/symlinkat01.c
243+++ b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
244@@ -37,7 +37,9 @@
245 #include <sys/stat.h>
246 #include <sys/time.h>
247 #include <fcntl.h>
248+#ifdef __GLIBC__
249 #include <error.h>
250+#endif
251 #include <stdlib.h>
252 #include <errno.h>
253 #include <string.h>
254diff --git a/testcases/kernel/syscalls/unlinkat/unlinkat01.c b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
255index 31fe4e7..26f6d9a 100644
256--- a/testcases/kernel/syscalls/unlinkat/unlinkat01.c
257+++ b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
258@@ -37,7 +37,9 @@
259 #include <sys/stat.h>
260 #include <sys/time.h>
261 #include <fcntl.h>
262+#ifdef __GLIBC__
263 #include <error.h>
264+#endif
265 #include <stdlib.h>
266 #include <errno.h>
267 #include <string.h>
268--
2692.7.0
270
diff --git a/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch b/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
new file mode 100644
index 0000000000..5b0c444be7
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
@@ -0,0 +1,73 @@
1From 0130f4146ced320aadb01b22e36b13d269a8ebba Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:48:14 +0000
4Subject: [PATCH 10/32] replace __BEGIN_DECLS and __END_DECLS
5
6They are not portable across libc implementations
7therefore replace them with expanded macros
8
9Include <asm-generic/types.h> to get __s32 definitions
10its not a generally available typedef
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 testcases/kernel/syscalls/epoll2/include/epoll.h | 8 ++++++--
15 utils/sctp/include/netinet/sctp.h | 9 +++++++--
16 2 files changed, 13 insertions(+), 4 deletions(-)
17
18diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h
19index be599c7..8cc5e7e 100644
20--- a/testcases/kernel/syscalls/epoll2/include/epoll.h
21+++ b/testcases/kernel/syscalls/epoll2/include/epoll.h
22@@ -85,7 +85,9 @@ struct epoll_event
23 } EPOLL_PACKED;
24
25
26-__BEGIN_DECLS
27+#ifdef __cplusplus
28+extern "C" {
29+#endif
30
31 /* Creates an epoll instance. Returns an fd for the new instance.
32 The "size" parameter is a hint specifying the number of file
33@@ -114,6 +116,8 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
34 extern int epoll_wait (int __epfd, struct epoll_event *__events,
35 int __maxevents, int __timeout) __THROW;
36
37-__END_DECLS
38+#ifdef __cplusplus
39+}
40+#endif
41
42 #endif /* sys/epoll.h */
43diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h
44index 51f5bfb..c61aef3 100644
45--- a/utils/sctp/include/netinet/sctp.h
46+++ b/utils/sctp/include/netinet/sctp.h
47@@ -35,9 +35,12 @@
48
49 #include <stdint.h>
50 #include <linux/types.h>
51+#include <asm-generic/types.h>
52 #include <sys/socket.h>
53
54-__BEGIN_DECLS
55+#ifdef __cplusplus
56+extern "C" {
57+#endif
58
59 typedef __s32 sctp_assoc_t;
60
61@@ -862,6 +865,8 @@ int sctp_recvmsg(int s, void *msg, size_t len, struct sockaddr *from,
62 /* Return the address length for an address family. */
63 int sctp_getaddrlen(sa_family_t family);
64
65-__END_DECLS
66+#ifdef __cplusplus
67+}
68+#endif
69
70 #endif /* __linux_sctp_h__ */
71--
722.7.0
73
diff --git a/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch b/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
new file mode 100644
index 0000000000..945280c627
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
@@ -0,0 +1,136 @@
1From aff0e2a8f011fa80b472355355a7e8cdacd50189 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:53:30 +0000
4Subject: [PATCH 11/32] Rename sigset variable to sigset1
5
6sigset API from signal.h is shadowed by this name conflict
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 testcases/kernel/mem/shmt/shmt04.c | 10 +++++-----
11 testcases/kernel/mem/shmt/shmt06.c | 10 +++++-----
12 testcases/kernel/syscalls/sigprocmask/sigprocmask01.c | 10 +++++-----
13 3 files changed, 15 insertions(+), 15 deletions(-)
14
15diff --git a/testcases/kernel/mem/shmt/shmt04.c b/testcases/kernel/mem/shmt/shmt04.c
16index 7203e9e..fce87d6 100644
17--- a/testcases/kernel/mem/shmt/shmt04.c
18+++ b/testcases/kernel/mem/shmt/shmt04.c
19@@ -56,7 +56,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */
20 /**************/
21
22 key_t key;
23-sigset_t sigset;
24+sigset_t sigset1;
25
26 #define SIZE 16*1024
27
28@@ -71,9 +71,9 @@ int main(void)
29
30 key = (key_t) getpid();
31
32- sigemptyset(&sigset);
33- sigaddset(&sigset, SIGUSR1);
34- sigprocmask(SIG_BLOCK, &sigset, NULL);
35+ sigemptyset(&sigset1);
36+ sigaddset(&sigset1, SIGUSR1);
37+ sigprocmask(SIG_BLOCK, &sigset1, NULL);
38
39 pid = fork();
40 switch (pid) {
41@@ -148,7 +148,7 @@ int child(void)
42 char *cp;
43 int sig;
44
45- sigwait(&sigset, &sig);
46+ sigwait(&sigset1, &sig);
47 chld_pid = getpid();
48 /*--------------------------------------------------------*/
49
50diff --git a/testcases/kernel/mem/shmt/shmt06.c b/testcases/kernel/mem/shmt/shmt06.c
51index a3c9ca3..77b0fc9 100644
52--- a/testcases/kernel/mem/shmt/shmt06.c
53+++ b/testcases/kernel/mem/shmt/shmt06.c
54@@ -57,7 +57,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */
55 /**************/
56
57 key_t key;
58-sigset_t sigset;
59+sigset_t sigset1;
60
61 int child();
62 static int rm_shm(int);
63@@ -70,9 +70,9 @@ int main(void)
64
65 key = (key_t) getpid();
66
67- sigemptyset(&sigset);
68- sigaddset(&sigset, SIGUSR1);
69- sigprocmask(SIG_BLOCK, &sigset, NULL);
70+ sigemptyset(&sigset1);
71+ sigaddset(&sigset1, SIGUSR1);
72+ sigprocmask(SIG_BLOCK, &sigset1, NULL);
73
74 pid = fork();
75 switch (pid) {
76@@ -147,7 +147,7 @@ int child(void)
77 char *cp;
78 int sig;
79
80- sigwait(&sigset, &sig);
81+ sigwait(&sigset1, &sig);
82 chld_pid = getpid();
83
84 if ((shmid = shmget(key, SIZE, 0)) < 0) {
85diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
86index 20fca52..6fb1d57 100644
87--- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
88+++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
89@@ -91,7 +91,7 @@ int TST_TOTAL = 1;
90 int sig_catch = 0; /* variable to blocked/unblocked signals */
91
92 struct sigaction sa_new; /* struct to hold signal info */
93-sigset_t sigset; /* signal set to hold signal lists */
94+sigset_t sigset1; /* signal set to hold signal lists */
95 sigset_t sigset2;
96
97 int main(int ac, char **av)
98@@ -112,7 +112,7 @@ int main(int ac, char **av)
99 * so that, signal will not be delivered to
100 * the test process.
101 */
102- TEST(sigprocmask(SIG_BLOCK, &sigset, 0));
103+ TEST(sigprocmask(SIG_BLOCK, &sigset1, 0));
104
105 /* Get the process id of test process */
106 my_pid = getpid();
107@@ -165,7 +165,7 @@ int main(int ac, char **av)
108 */
109 errno = 0;
110 if (sigprocmask(SIG_UNBLOCK,
111- &sigset, 0) == -1) {
112+ &sigset1, 0) == -1) {
113 tst_brkm(TFAIL, cleanup,
114 "sigprocmask() failed "
115 "to unblock signal, "
116@@ -212,7 +212,7 @@ void setup(void)
117 * Initialise the signal sets with the list that
118 * excludes/includes all system-defined signals.
119 */
120- if (sigemptyset(&sigset) == -1) {
121+ if (sigemptyset(&sigset1) == -1) {
122 tst_brkm(TFAIL, cleanup,
123 "sigemptyset() failed, errno=%d : %s",
124 errno, strerror(errno));
125@@ -235,7 +235,7 @@ void setup(void)
126 * Add specified signal (SIGINT) to the signal set
127 * which excludes system-defined signals.
128 */
129- if (sigaddset(&sigset, SIGINT) == -1) {
130+ if (sigaddset(&sigset1, SIGINT) == -1) {
131 tst_brkm(TFAIL, cleanup,
132 "sigaddset() failed, errno=%d : %s",
133 errno, strerror(errno));
134--
1352.7.0
136
diff --git a/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch b/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
new file mode 100644
index 0000000000..e1532c1fc9
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
@@ -0,0 +1,351 @@
1From 54e098a366a1d773c4d7d4124f2f5aab976681c3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:58:08 +0000
4Subject: [PATCH 12/32] fsstress.c: Replace __int64_t with int64_t
5
6int64_t is defined in ISO C99
7include limits.h to get defintions of PATH_MAX
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/fs/fsstress/fsstress.c | 31 +++++++++---------
12 testcases/network/nfs/nfs_fsstress/fsstress.c | 47 ++++++++++++++-------------
13 2 files changed, 40 insertions(+), 38 deletions(-)
14
15diff --git a/testcases/kernel/fs/fsstress/fsstress.c b/testcases/kernel/fs/fsstress/fsstress.c
16index 2f89903..89f0b19 100644
17--- a/testcases/kernel/fs/fsstress/fsstress.c
18+++ b/testcases/kernel/fs/fsstress/fsstress.c
19@@ -36,6 +36,7 @@
20 #ifdef HAVE_SYS_PRCTL_H
21 # include <sys/prctl.h>
22 #endif
23+#include <limits.h>
24
25 #define XFS_ERRTAG_MAX 17
26
27@@ -1572,7 +1573,7 @@ void bulkstat_f(int opno, long r)
28 __u64 last;
29 __s32 nent;
30 xfs_bstat_t *t;
31- __int64_t total;
32+ int64_t total;
33 xfs_fsop_bulkreq_t bsr;
34
35 last = 0;
36@@ -1764,14 +1765,14 @@ int setdirect(int fd)
37
38 void dread_f(int opno, long r)
39 {
40- __int64_t align;
41+ int64_t align;
42 char *buf = NULL;
43 struct dioattr diob;
44 int e;
45 pathname_t f;
46 int fd;
47 size_t len;
48- __int64_t lr;
49+ int64_t lr;
50 off64_t off;
51 struct stat64 stb;
52 int v;
53@@ -1835,8 +1836,8 @@ void dread_f(int opno, long r)
54 return;
55 }
56 #endif
57- align = (__int64_t) diob.d_miniosz;
58- lr = ((__int64_t) random() << 32) + random();
59+ align = (int64_t) diob.d_miniosz;
60+ lr = ((int64_t) random() << 32) + random();
61 off = (off64_t) (lr % stb.st_size);
62 off -= (off % align);
63 lseek64(fd, off, SEEK_SET);
64@@ -1865,14 +1866,14 @@ void dread_f(int opno, long r)
65
66 void dwrite_f(int opno, long r)
67 {
68- __int64_t align;
69+ int64_t align;
70 char *buf = NULL;
71 struct dioattr diob;
72 int e;
73 pathname_t f;
74 int fd;
75 size_t len;
76- __int64_t lr;
77+ int64_t lr;
78 off64_t off;
79 struct stat64 stb;
80 int v;
81@@ -1925,8 +1926,8 @@ void dwrite_f(int opno, long r)
82 return;
83 }
84 #endif
85- align = (__int64_t) diob.d_miniosz;
86- lr = ((__int64_t) random() << 32) + random();
87+ align = (int64_t) diob.d_miniosz;
88+ lr = ((int64_t) random() << 32) + random();
89 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
90 off -= (off % align);
91 lseek64(fd, off, SEEK_SET);
92@@ -2224,7 +2225,7 @@ void read_f(int opno, long r)
93 pathname_t f;
94 int fd;
95 size_t len;
96- __int64_t lr;
97+ int64_t lr;
98 off64_t off;
99 struct stat64 stb;
100 int v;
101@@ -2262,7 +2263,7 @@ void read_f(int opno, long r)
102 close(fd);
103 return;
104 }
105- lr = ((__int64_t) random() << 32) + random();
106+ lr = ((int64_t) random() << 32) + random();
107 off = (off64_t) (lr % stb.st_size);
108 lseek64(fd, off, SEEK_SET);
109 len = (random() % (getpagesize() * 32)) + 1;
110@@ -2509,7 +2510,7 @@ void truncate_f(int opno, long r)
111 {
112 int e;
113 pathname_t f;
114- __int64_t lr;
115+ int64_t lr;
116 off64_t off;
117 struct stat64 stb;
118 int v;
119@@ -2530,7 +2531,7 @@ void truncate_f(int opno, long r)
120 free_pathname(&f);
121 return;
122 }
123- lr = ((__int64_t) random() << 32) + random();
124+ lr = ((int64_t) random() << 32) + random();
125 off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
126 off %= maxfsize;
127 e = truncate64_path(&f, off) < 0 ? errno : 0;
128@@ -2626,7 +2627,7 @@ void write_f(int opno, long r)
129 pathname_t f;
130 int fd;
131 size_t len;
132- __int64_t lr;
133+ int64_t lr;
134 off64_t off;
135 struct stat64 stb;
136 int v;
137@@ -2656,7 +2657,7 @@ void write_f(int opno, long r)
138 close(fd);
139 return;
140 }
141- lr = ((__int64_t) random() << 32) + random();
142+ lr = ((int64_t) random() << 32) + random();
143 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
144 off %= maxfsize;
145 lseek64(fd, off, SEEK_SET);
146diff --git a/testcases/network/nfs/nfs_fsstress/fsstress.c b/testcases/network/nfs/nfs_fsstress/fsstress.c
147index ac91262..a34c416 100644
148--- a/testcases/network/nfs/nfs_fsstress/fsstress.c
149+++ b/testcases/network/nfs/nfs_fsstress/fsstress.c
150@@ -31,6 +31,7 @@
151 */
152
153 #include "global.h"
154+#include <limits.h>
155
156 #define XFS_ERRTAG_MAX 17
157
158@@ -1368,7 +1369,7 @@ void allocsp_f(int opno, long r)
159 pathname_t f;
160 int fd;
161 struct flock64 fl;
162- __int64_t lr;
163+ int64_t lr;
164 off64_t off;
165 struct stat64 stb;
166 int v;
167@@ -1398,7 +1399,7 @@ void allocsp_f(int opno, long r)
168 close(fd);
169 return;
170 }
171- lr = ((__int64_t) random() << 32) + random();
172+ lr = ((int64_t) random() << 32) + random();
173 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
174 off %= maxfsize;
175 fl.l_whence = SEEK_SET;
176@@ -1519,7 +1520,7 @@ void bulkstat_f(int opno, long r)
177 __uint64_t last;
178 int nent;
179 xfs_bstat_t *t;
180- __int64_t total;
181+ int64_t total;
182 xfs_fsop_bulkreq_t bsr;
183
184 last = 0;
185@@ -1708,14 +1709,14 @@ int setdirect(int fd)
186
187 void dread_f(int opno, long r)
188 {
189- __int64_t align;
190+ int64_t align;
191 char *buf;
192 struct dioattr diob;
193 int e;
194 pathname_t f;
195 int fd;
196 size_t len;
197- __int64_t lr;
198+ int64_t lr;
199 off64_t off;
200 struct stat64 stb;
201 int v;
202@@ -1775,8 +1776,8 @@ void dread_f(int opno, long r)
203 return;
204 }
205 #endif
206- align = (__int64_t) diob.d_miniosz;
207- lr = ((__int64_t) random() << 32) + random();
208+ align = (int64_t) diob.d_miniosz;
209+ lr = ((int64_t) random() << 32) + random();
210 off = (off64_t) (lr % stb.st_size);
211 off -= (off % align);
212 lseek64(fd, off, SEEK_SET);
213@@ -1798,14 +1799,14 @@ void dread_f(int opno, long r)
214
215 void dwrite_f(int opno, long r)
216 {
217- __int64_t align;
218+ int64_t align;
219 char *buf;
220 struct dioattr diob;
221 int e;
222 pathname_t f;
223 int fd;
224 size_t len;
225- __int64_t lr;
226+ int64_t lr;
227 off64_t off;
228 struct stat64 stb;
229 int v;
230@@ -1854,8 +1855,8 @@ void dwrite_f(int opno, long r)
231 return;
232 }
233 #endif
234- align = (__int64_t) diob.d_miniosz;
235- lr = ((__int64_t) random() << 32) + random();
236+ align = (int64_t) diob.d_miniosz;
237+ lr = ((int64_t) random() << 32) + random();
238 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
239 off -= (off % align);
240 lseek64(fd, off, SEEK_SET);
241@@ -1917,7 +1918,7 @@ void freesp_f(int opno, long r)
242 pathname_t f;
243 int fd;
244 struct flock64 fl;
245- __int64_t lr;
246+ int64_t lr;
247 off64_t off;
248 struct stat64 stb;
249 int v;
250@@ -1947,7 +1948,7 @@ void freesp_f(int opno, long r)
251 close(fd);
252 return;
253 }
254- lr = ((__int64_t) random() << 32) + random();
255+ lr = ((int64_t) random() << 32) + random();
256 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
257 off %= maxfsize;
258 fl.l_whence = SEEK_SET;
259@@ -2145,7 +2146,7 @@ void read_f(int opno, long r)
260 pathname_t f;
261 int fd;
262 size_t len;
263- __int64_t lr;
264+ int64_t lr;
265 off64_t off;
266 struct stat64 stb;
267 int v;
268@@ -2183,7 +2184,7 @@ void read_f(int opno, long r)
269 close(fd);
270 return;
271 }
272- lr = ((__int64_t) random() << 32) + random();
273+ lr = ((int64_t) random() << 32) + random();
274 off = (off64_t) (lr % stb.st_size);
275 lseek64(fd, off, SEEK_SET);
276 len = (random() % (getpagesize() * 32)) + 1;
277@@ -2281,7 +2282,7 @@ void resvsp_f(int opno, long r)
278 pathname_t f;
279 int fd;
280 struct flock64 fl;
281- __int64_t lr;
282+ int64_t lr;
283 off64_t off;
284 struct stat64 stb;
285 int v;
286@@ -2311,7 +2312,7 @@ void resvsp_f(int opno, long r)
287 close(fd);
288 return;
289 }
290- lr = ((__int64_t) random() << 32) + random();
291+ lr = ((int64_t) random() << 32) + random();
292 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
293 off %= maxfsize;
294 fl.l_whence = SEEK_SET;
295@@ -2428,7 +2429,7 @@ void truncate_f(int opno, long r)
296 {
297 int e;
298 pathname_t f;
299- __int64_t lr;
300+ int64_t lr;
301 off64_t off;
302 struct stat64 stb;
303 int v;
304@@ -2449,7 +2450,7 @@ void truncate_f(int opno, long r)
305 free_pathname(&f);
306 return;
307 }
308- lr = ((__int64_t) random() << 32) + random();
309+ lr = ((int64_t) random() << 32) + random();
310 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
311 off %= maxfsize;
312 e = truncate64_path(&f, off) < 0 ? errno : 0;
313@@ -2491,7 +2492,7 @@ void unresvsp_f(int opno, long r)
314 pathname_t f;
315 int fd;
316 struct flock64 fl;
317- __int64_t lr;
318+ int64_t lr;
319 off64_t off;
320 struct stat64 stb;
321 int v;
322@@ -2521,7 +2522,7 @@ void unresvsp_f(int opno, long r)
323 close(fd);
324 return;
325 }
326- lr = ((__int64_t) random() << 32) + random();
327+ lr = ((int64_t) random() << 32) + random();
328 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
329 off %= maxfsize;
330 fl.l_whence = SEEK_SET;
331@@ -2543,7 +2544,7 @@ void write_f(int opno, long r)
332 pathname_t f;
333 int fd;
334 size_t len;
335- __int64_t lr;
336+ int64_t lr;
337 off64_t off;
338 struct stat64 stb;
339 int v;
340@@ -2573,7 +2574,7 @@ void write_f(int opno, long r)
341 close(fd);
342 return;
343 }
344- lr = ((__int64_t) random() << 32) + random();
345+ lr = ((int64_t) random() << 32) + random();
346 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
347 off %= maxfsize;
348 lseek64(fd, off, SEEK_SET);
349--
3502.7.0
351
diff --git a/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch b/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
new file mode 100644
index 0000000000..4266e4fc3a
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
@@ -0,0 +1,67 @@
1From 1ef8c32317064438ec3b37a114f5d82957f4e0c6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:05:54 +0000
4Subject: [PATCH 13/32] include fcntl.h for getting O_* definitions
5
6musl exposes this issue, with glibc fcntl.h is included via some other
7header and this problem remained latent
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/ipc/ipc_stress/shmem_test_03.c | 1 +
12 testcases/kernel/syscalls/mq_notify/mq_notify01.c | 1 +
13 testcases/network/tcp_cmds/sendfile/testsf_c.c | 1 +
14 testcases/network/tcp_cmds/sendfile/testsf_s.c | 1 +
15 4 files changed, 4 insertions(+)
16
17diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
18index c1b11fd..8be156f 100644
19--- a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
20+++ b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
21@@ -72,6 +72,7 @@
22 #include <string.h>
23 #include <unistd.h>
24 #include <limits.h>
25+#include <fcntl.h>
26 #include <sys/file.h>
27 #include <sys/ipc.h>
28 #include <sys/mman.h>
29diff --git a/testcases/kernel/syscalls/mq_notify/mq_notify01.c b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
30index 4728c70..5c7846c 100644
31--- a/testcases/kernel/syscalls/mq_notify/mq_notify01.c
32+++ b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
33@@ -41,6 +41,7 @@
34 #include <mqueue.h>
35 #include <signal.h>
36 #include <stdlib.h>
37+#include <fcntl.h>
38
39 #include "../utils/include_j_h.h"
40
41diff --git a/testcases/network/tcp_cmds/sendfile/testsf_c.c b/testcases/network/tcp_cmds/sendfile/testsf_c.c
42index 449784f..38d3274 100644
43--- a/testcases/network/tcp_cmds/sendfile/testsf_c.c
44+++ b/testcases/network/tcp_cmds/sendfile/testsf_c.c
45@@ -9,6 +9,7 @@
46 #include <sys/types.h>
47 #include <stdlib.h>
48 #include <string.h>
49+#include <fcntl.h>
50 #include <sys/file.h>
51 #include <arpa/inet.h>
52 #include <netinet/in.h>
53diff --git a/testcases/network/tcp_cmds/sendfile/testsf_s.c b/testcases/network/tcp_cmds/sendfile/testsf_s.c
54index 17e98ad..bce8dd1 100644
55--- a/testcases/network/tcp_cmds/sendfile/testsf_s.c
56+++ b/testcases/network/tcp_cmds/sendfile/testsf_s.c
57@@ -6,6 +6,7 @@
58 #include <stdio.h>
59 #include <stdlib.h>
60 #include <unistd.h>
61+#include <fcntl.h>
62 #include <sys/file.h>
63 #include <errno.h>
64 #include <sys/signal.h>
65--
662.7.0
67
diff --git a/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch b/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
new file mode 100644
index 0000000000..84d81e9f94
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
@@ -0,0 +1,56 @@
1From d63fefa86dac437c47b9ebbea0a82a1240aaba2c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:09:56 +0000
4Subject: [PATCH 14/32] hyperthreading: Include sys/types.h for pid_t
5 definition
6
7If sys/types.h is not included then it will not define pid_t_needed
8and therefore typedef wont be included and we get errors about pid_t
9being not known
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h | 1 +
14 testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h | 1 +
15 testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h | 1 +
16 3 files changed, 3 insertions(+)
17
18diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
19index 1ec9794..9084aa7 100644
20--- a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
21+++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
22@@ -3,6 +3,7 @@
23 #define _HTUTILS_H_
24
25 #include <stdlib.h>
26+#include <sys/types.h>
27
28 int is_cmdline_para(const char *para);
29
30diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
31index 1ec9794..c03a124 100644
32--- a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
33+++ b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
34@@ -2,6 +2,7 @@
35 #ifndef _HTUTILS_H_
36 #define _HTUTILS_H_
37
38+#include <sys/types.h>
39 #include <stdlib.h>
40
41 int is_cmdline_para(const char *para);
42diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
43index 2977ad0..6b484e1 100644
44--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
45+++ b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
46@@ -3,6 +3,7 @@
47 #define _HTUTILS_H_
48
49 #include <stdlib.h>
50+#include <sys/types.h>
51
52 int is_cmdline_para(const char *para);
53
54--
552.7.0
56
diff --git a/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch b/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
new file mode 100644
index 0000000000..963536f993
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
@@ -0,0 +1,64 @@
1From f091839532f3afe0a58e8ba0b45615c899a43a47 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:12:09 +0000
4Subject: [PATCH 15/32] mincore01: Rename PAGESIZE to pagesize
5
6PAGESIZE conflicts with system headers on musl
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 testcases/kernel/syscalls/mincore/mincore01.c | 10 +++++-----
11 1 file changed, 5 insertions(+), 5 deletions(-)
12
13diff --git a/testcases/kernel/syscalls/mincore/mincore01.c b/testcases/kernel/syscalls/mincore/mincore01.c
14index 97a3d95..fa426d1 100644
15--- a/testcases/kernel/syscalls/mincore/mincore01.c
16+++ b/testcases/kernel/syscalls/mincore/mincore01.c
17@@ -45,7 +45,7 @@
18 #include "test.h"
19 #include "safe_macros.h"
20
21-static int PAGESIZE;
22+static int pagesize;
23 static rlim_t STACK_LIMIT = 10485760;
24
25 static void cleanup(void);
26@@ -146,7 +146,7 @@ static void setup4(struct test_case_t *tc)
27 }
28
29 tc->addr = global_pointer;
30- tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + PAGESIZE;
31+ tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + pagesize;
32 tc->vector = global_vec;
33
34 /*
35@@ -161,7 +161,7 @@ static void setup(void)
36 char *buf;
37 int fd;
38
39- PAGESIZE = getpagesize();
40+ pagesize = getpagesize();
41
42 tst_sig(NOFORK, DEF_HANDLER, cleanup);
43
44@@ -170,7 +170,7 @@ static void setup(void)
45 TEST_PAUSE;
46
47 /* global_pointer will point to a mmapped area of global_len bytes */
48- global_len = PAGESIZE * 2;
49+ global_len = pagesize * 2;
50
51 buf = SAFE_MALLOC(cleanup, global_len);
52 memset(buf, 42, global_len);
53@@ -186,7 +186,7 @@ static void setup(void)
54 PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
55
56 global_vec = SAFE_MALLOC(cleanup,
57- (global_len + PAGESIZE - 1) / PAGESIZE);
58+ (global_len + pagesize - 1) / pagesize);
59
60 SAFE_CLOSE(cleanup, fd);
61 }
62--
632.7.0
64
diff --git a/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch b/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
new file mode 100644
index 0000000000..1b5b93a4e6
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
@@ -0,0 +1,45 @@
1From 2b9be924bbad8a1f84ae553fdd1aa8391aa8d2f4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:15:07 +0000
4Subject: [PATCH 16/32] ustat: Change header from ustat.h to sys/ustat.h
5
6makes it portable for musl, on glibc ustat.h is just including
7sys/ustat.h too
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/syscalls/ustat/ustat01.c | 2 +-
12 testcases/kernel/syscalls/ustat/ustat02.c | 2 +-
13 2 files changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c
16index 01b7688..494647b 100644
17--- a/testcases/kernel/syscalls/ustat/ustat01.c
18+++ b/testcases/kernel/syscalls/ustat/ustat01.c
19@@ -20,8 +20,8 @@
20 */
21
22 #include <unistd.h>
23-#include <ustat.h>
24 #include <errno.h>
25+#include <sys/ustat.h>
26 #include <sys/types.h>
27 #include <sys/stat.h>
28 #include "test.h"
29diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c
30index 4e66236..edada31 100644
31--- a/testcases/kernel/syscalls/ustat/ustat02.c
32+++ b/testcases/kernel/syscalls/ustat/ustat02.c
33@@ -21,8 +21,8 @@
34 */
35
36 #include <unistd.h>
37-#include <ustat.h>
38 #include <errno.h>
39+#include <sys/ustat.h>
40 #include <sys/stat.h>
41 #include <sys/types.h>
42 #include "test.h"
43--
442.7.0
45
diff --git a/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch b/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
new file mode 100644
index 0000000000..ed25802a0c
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
@@ -0,0 +1,88 @@
1From c882bcd18820b44a685f0d5edd7aaff77a88c912 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:17:55 +0000
4Subject: [PATCH 17/32] replace sigval_t with union sigval
5
6This makes it compatible across musl and glibc
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c | 2 +-
11 testcases/kernel/syscalls/timer_gettime/timer_gettime01.c | 2 +-
12 testcases/kernel/timers/timer_create/timer_create02.c | 4 ++--
13 testcases/kernel/timers/timer_create/timer_create03.c | 4 ++--
14 4 files changed, 6 insertions(+), 6 deletions(-)
15
16diff --git a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
17index d186c1f..bc03544 100644
18--- a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
19+++ b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
20@@ -54,7 +54,7 @@ int main(int ac, char **av)
21
22 setup();
23
24- ev.sigev_value = (sigval_t) 0;
25+ ev.sigev_value = (union sigval) 0;
26 ev.sigev_signo = SIGALRM;
27 ev.sigev_notify = SIGEV_SIGNAL;
28 TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
29diff --git a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
30index b583aee..9371a6a 100644
31--- a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
32+++ b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
33@@ -55,7 +55,7 @@ int main(int ac, char **av)
34
35 setup();
36
37- ev.sigev_value = (sigval_t) 0;
38+ ev.sigev_value = (union sigval) 0;
39 ev.sigev_signo = SIGALRM;
40 ev.sigev_notify = SIGEV_SIGNAL;
41 TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
42diff --git a/testcases/kernel/timers/timer_create/timer_create02.c b/testcases/kernel/timers/timer_create/timer_create02.c
43index 7f528ed..1127400 100644
44--- a/testcases/kernel/timers/timer_create/timer_create02.c
45+++ b/testcases/kernel/timers/timer_create/timer_create02.c
46@@ -142,7 +142,7 @@ void setup_test(int option)
47 {
48 switch (option) {
49 case 0:
50- evp.sigev_value = (sigval_t) 0;
51+ evp.sigev_value = (union sigval) 0;
52 evp.sigev_signo = SIGALRM;
53 evp.sigev_notify = SIGEV_SIGNAL;
54 evp_ptr = &evp;
55@@ -151,7 +151,7 @@ void setup_test(int option)
56 evp_ptr = NULL;
57 break;
58 case 2:
59- evp.sigev_value = (sigval_t) 0;
60+ evp.sigev_value = (union sigval) 0;
61 evp.sigev_signo = SIGALRM; /* any will do */
62 evp.sigev_notify = SIGEV_NONE;
63 evp_ptr = &evp;
64diff --git a/testcases/kernel/timers/timer_create/timer_create03.c b/testcases/kernel/timers/timer_create/timer_create03.c
65index 291fcfa..8b01bf7 100644
66--- a/testcases/kernel/timers/timer_create/timer_create03.c
67+++ b/testcases/kernel/timers/timer_create/timer_create03.c
68@@ -129,7 +129,7 @@ void setup_test(int option)
69 {
70 switch (option) {
71 case 0:
72- evp.sigev_value = (sigval_t) 0;
73+ evp.sigev_value = (union sigval) 0;
74 evp.sigev_signo = SIGALRM;
75 evp.sigev_notify = SIGEV_SIGNAL;
76 evp_ptr = &evp;
77@@ -138,7 +138,7 @@ void setup_test(int option)
78 evp_ptr = NULL;
79 break;
80 case 2:
81- evp.sigev_value = (sigval_t) 0;
82+ evp.sigev_value = (union sigval) 0;
83 evp.sigev_signo = SIGALRM; /* any will do */
84 evp.sigev_notify = SIGEV_NONE;
85 evp_ptr = &evp;
86--
872.7.0
88
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
new file mode 100644
index 0000000000..5198fe9f47
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch
@@ -0,0 +1,32 @@
1From f42b060e80c9f40627c712d4d56d45221bd7d9fa Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 06:51:20 +0000
4Subject: [PATCH 18/32] guard mallocopt() with __GLIBC__
5
6mallocopt is not available on non glibc implementations
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/utils/benchmark/ebizzy-0.3/ebizzy.c b/utils/benchmark/ebizzy-0.3/ebizzy.c
14index 5bb8eff..934d951 100644
15--- a/utils/benchmark/ebizzy-0.3/ebizzy.c
16+++ b/utils/benchmark/ebizzy-0.3/ebizzy.c
17@@ -215,10 +215,10 @@ static void read_options(int argc, char *argv[])
18 "\"never mmap\" option specified\n");
19 usage();
20 }
21-
22+#ifdef __GLIBC__
23 if (never_mmap)
24 mallopt(M_MMAP_MAX, 0);
25-
26+#endif
27 if (chunk_size < record_size) {
28 fprintf(stderr, "Chunk size %u smaller than record size %u\n",
29 chunk_size, record_size);
30--
312.7.0
32
diff --git a/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch b/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
new file mode 100644
index 0000000000..0a4c5f0b3c
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
@@ -0,0 +1,32 @@
1From 721e94985b9cff3e2724af7ea5be7d005bc12dec Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 06:55:27 +0000
4Subject: [PATCH 19/32] tomoyo: Replace canonicalize_file_name() with
5 realpath()
6
7canonicalize_file_name() API is specific to glibc
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c | 4 ++--
12 1 file changed, 2 insertions(+), 2 deletions(-)
13
14diff --git a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
15index da4af0f..5c1a3ca 100644
16--- a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
17+++ b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
18@@ -274,9 +274,9 @@ int main(int argc, char *argv[])
19 /* Test mount(). */
20 {
21 static char buf[4096];
22- char *dev_ram_path = canonicalize_file_name("/dev/ram0");
23+ char *dev_ram_path = realpath("/dev/ram0", NULL);
24 if (!dev_ram_path)
25- dev_ram_path = canonicalize_file_name("/dev/ram");
26+ dev_ram_path = realpath("/dev/ram", NULL);
27 if (!dev_ram_path) {
28 dev_ram_path = "/dev/ram0";
29 mknod(dev_ram_path, S_IFBLK, MKDEV(1, 0));
30--
312.7.0
32
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
new file mode 100644
index 0000000000..0e4e4586ca
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
@@ -0,0 +1,48 @@
1From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 06:57:04 +0000
4Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc
5
6getdents/getdents64 are implemented in musl and when we define static
7functions with same name, it errors out.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/syscalls/getdents/getdents.h | 6 ++++--
12 1 file changed, 4 insertions(+), 2 deletions(-)
13
14diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h
15index abea655..db63d89 100644
16--- a/testcases/kernel/syscalls/getdents/getdents.h
17+++ b/testcases/kernel/syscalls/getdents/getdents.h
18@@ -34,12 +34,13 @@ struct linux_dirent {
19 char d_name[];
20 };
21
22+#ifdef __GLIBC__
23 static inline int
24 getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size)
25 {
26 return ltp_syscall(__NR_getdents, fd, dirp, size);
27 }
28-
29+#endif
30 struct linux_dirent64 {
31 uint64_t d_ino;
32 int64_t d_off;
33@@ -48,10 +49,11 @@ struct linux_dirent64 {
34 char d_name[];
35 };
36
37+#ifdef __GLIBC__
38 static inline int
39 getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size)
40 {
41 return ltp_syscall(__NR_getdents64, fd, dirp64, size);
42 }
43-
44+#endif
45 #endif /* GETDENTS_H */
46--
472.7.0
48
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
new file mode 100644
index 0000000000..c8cbe580c4
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
@@ -0,0 +1,71 @@
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---
14 testcases/kernel/syscalls/mremap/mremap01.c | 4 +++-
15 testcases/kernel/syscalls/mremap/mremap02.c | 2 ++
16 testcases/kernel/syscalls/mremap/mremap03.c | 2 ++
17 3 files changed, 7 insertions(+), 1 deletion(-)
18
19diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c
20index d63d1e4..24ca174 100644
21--- a/testcases/kernel/syscalls/mremap/mremap01.c
22+++ b/testcases/kernel/syscalls/mremap/mremap01.c
23@@ -76,10 +76,12 @@
24 */
25 #include <unistd.h>
26 #include <errno.h>
27+#include <fcntl.h>
28+#define _GNU_SOURCE
29 #define __USE_GNU
30 #include <sys/mman.h>
31 #undef __USE_GNU
32-#include <fcntl.h>
33+#undef _GNU_SOURCE
34
35 #include "test.h"
36
37diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c
38index 5a51b9a..a530a6b 100644
39--- a/testcases/kernel/syscalls/mremap/mremap02.c
40+++ b/testcases/kernel/syscalls/mremap/mremap02.c
41@@ -75,9 +75,11 @@
42 #include <errno.h>
43 #include <unistd.h>
44 #include <fcntl.h>
45+#define _GNU_SOURCE
46 #define __USE_GNU
47 #include <sys/mman.h>
48 #undef __USE_GNU
49+#undef _GNU_SOURCE
50
51 #include "test.h"
52
53diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
54index 12e3829..9b39f8b 100644
55--- a/testcases/kernel/syscalls/mremap/mremap03.c
56+++ b/testcases/kernel/syscalls/mremap/mremap03.c
57@@ -76,9 +76,11 @@
58 #include <errno.h>
59 #include <unistd.h>
60 #include <fcntl.h>
61+#define _GNU_SOURCE
62 #define __USE_GNU
63 #include <sys/mman.h>
64 #undef __USE_GNU
65+#undef _GNU_SOURCE
66
67 #include "test.h"
68
69--
702.7.0
71
diff --git a/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch b/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
new file mode 100644
index 0000000000..413b44ac71
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
@@ -0,0 +1,29 @@
1From 7ac6fd51991ac61d1d7594f601d87842060ee284 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:06:11 +0000
4Subject: [PATCH 22/32] include sys/types.h
5
6Fixes
7
8error: unknown type name 'uint'
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 testcases/kernel/ipc/ipc_stress/shmem_test_04.c | 1 +
13 1 file changed, 1 insertion(+)
14
15diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
16index 72c2e60..e7e5f61 100644
17--- a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
18+++ b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
19@@ -65,6 +65,7 @@
20 #include <signal.h>
21 #include <stdint.h>
22 #include <sys/mman.h>
23+#include <sys/types.h>
24
25 #ifdef _LINUX_
26 typedef unsigned long ulong_t;
27--
282.7.0
29
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
new file mode 100644
index 0000000000..4680c03d4e
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch
@@ -0,0 +1,48 @@
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---
10 testcases/kernel/syscalls/ptrace/ptrace03.c | 4 ++++
11 testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h | 4 ++++
12 2 files changed, 8 insertions(+)
13
14diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c
15index a4028fc..f1880cd 100644
16--- a/testcases/kernel/syscalls/ptrace/ptrace03.c
17+++ b/testcases/kernel/syscalls/ptrace/ptrace03.c
18@@ -102,7 +102,11 @@ static pid_t unused_pid;
19 static pid_t zero_pid;
20
21 struct test_case_t {
22+#ifdef __GLIBC__
23 enum __ptrace_request request;
24+#else
25+ int request;
26+#endif
27 pid_t *pid;
28 int exp_errno;
29 } test_cases[] = {
30diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
31index ae538e9..85aa89d 100644
32--- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
33+++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
34@@ -130,7 +130,11 @@ static char *strings[] = {
35 SPT(KILL)
36 SPT(SINGLESTEP)
37 };
38+#ifdef __GLIBC__
39 static inline char *strptrace(enum __ptrace_request request)
40+#else
41+static inline char *strptrace(int request)
42+#endif
43 {
44 return strings[request];
45 }
46--
472.7.0
48
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
new file mode 100644
index 0000000000..03c67a52fa
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch
@@ -0,0 +1,68 @@
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---
11 testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c | 1 +
12 testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +-
13 testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c | 1 +
14 testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c | 1 +
15 4 files changed, 4 insertions(+), 1 deletion(-)
16
17diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
18index 5cf89cc..bdcb91a 100644
19--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
20+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
21@@ -28,6 +28,7 @@
22 /* sigset_t type. */
23 /******************************************************************************/
24
25+#define _GNU_SOURCE
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <unistd.h>
29diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
30index a1da743..8a27a0f 100644
31--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
32+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
33@@ -23,7 +23,7 @@
34 /* Description: This tests the rt_sigaction() syscall */
35 /* rt_sigaction Expected EFAULT error check */
36 /******************************************************************************/
37-
38+#define _GNU_SOURCE
39 #include <stdio.h>
40 #include <stdlib.h>
41 #include <unistd.h>
42diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
43index 175d220..e7627cd 100644
44--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
45+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
46@@ -24,6 +24,7 @@
47 /* rt_sigaction Expected EINVAL error check */
48 /******************************************************************************/
49
50+#define _GNU_SOURCE
51 #include <stdio.h>
52 #include <stdlib.h>
53 #include <unistd.h>
54diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
55index 74e5a61..75c57fc 100644
56--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
57+++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
58@@ -39,6 +39,7 @@
59 /* sigsetsize should indicate the size of a sigset_t type. */
60 /******************************************************************************/
61
62+#define _GNU_SOURCE
63 #include <stdio.h>
64 #include <signal.h>
65 #include <errno.h>
66--
672.7.0
68
diff --git a/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch b/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch
new file mode 100644
index 0000000000..aad3cb0373
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch
@@ -0,0 +1,28 @@
1From 9d14edfc12eefac900dd54729a88b3ccf91c1c43 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:18:15 +0000
4Subject: [PATCH 25/32] mc_gethost: include sys/types.h
5
6Fix build on musl
7error: unknown type name 'u_char'
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/network/multicast/mc_gethost/mc_gethost.c | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c
15index 5b9a790..c799e2a 100644
16--- a/testcases/network/multicast/mc_gethost/mc_gethost.c
17+++ b/testcases/network/multicast/mc_gethost/mc_gethost.c
18@@ -6,6 +6,7 @@
19
20 #include <sys/param.h>
21 #include <sys/socket.h>
22+#include <sys/types.h>
23 #include <netinet/in.h>
24 #include <arpa/inet.h>
25 #include <arpa/nameser.h>
26--
272.7.0
28
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
new file mode 100644
index 0000000000..58b8ed4d42
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch
@@ -0,0 +1,29 @@
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---
11 testcases/misc/crash/crash01.c | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/testcases/misc/crash/crash01.c b/testcases/misc/crash/crash01.c
15index 0574521..08a02e7 100644
16--- a/testcases/misc/crash/crash01.c
17+++ b/testcases/misc/crash/crash01.c
18@@ -49,7 +49,7 @@ stress test at the same time you run other tests, like a multi-user
19 benchmark.
20
21 */
22-
23+#define _GNU_SOURCE
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27--
282.7.0
29
diff --git a/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch b/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
new file mode 100644
index 0000000000..b47d0977eb
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
@@ -0,0 +1,29 @@
1From 4a74b275acc8158850f2500928a1467c3482c986 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:23:11 +0000
4Subject: [PATCH 27/32] sysconf01: Use _SC_2_C_VERSION conditionally
5
6_SC_2_C_VERSION is not available on musl
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 testcases/kernel/syscalls/sysconf/sysconf01.c | 2 ++
11 1 file changed, 2 insertions(+)
12
13diff --git a/testcases/kernel/syscalls/sysconf/sysconf01.c b/testcases/kernel/syscalls/sysconf/sysconf01.c
14index 8542e77..e806943 100644
15--- a/testcases/kernel/syscalls/sysconf/sysconf01.c
16+++ b/testcases/kernel/syscalls/sysconf/sysconf01.c
17@@ -102,7 +102,9 @@ int main(void)
18 test_sysconf(_SC_ATEXIT_MAX);
19 test_sysconf(_SC_2_C_BIND);
20 test_sysconf(_SC_2_C_DEV);
21+#ifdef __GLIBC__
22 test_sysconf(_SC_2_C_VERSION);
23+#endif
24 /* 21 - 25 */
25 test_sysconf(_SC_2_CHAR_TERM);
26 test_sysconf(_SC_2_FORT_DEV);
27--
282.7.0
29
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
new file mode 100644
index 0000000000..fc82ff9239
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
@@ -0,0 +1,43 @@
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---
12 include/lapi/rt_sigaction.h | 2 +-
13 testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++
14 2 files changed, 4 insertions(+), 1 deletion(-)
15
16diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
17index 3a5a763..870918c 100644
18--- a/include/lapi/rt_sigaction.h
19+++ b/include/lapi/rt_sigaction.h
20@@ -34,7 +34,7 @@
21 #define INVAL_SA_PTR ((void *)-1)
22
23 struct kernel_sigaction {
24- __sighandler_t k_sa_handler;
25+ sighandler_t k_sa_handler;
26 unsigned long sa_flags;
27 void (*sa_restorer) (void);
28 sigset_t sa_mask;
29diff --git a/testcases/kernel/syscalls/rt_sigsuspend/Makefile b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
30index 37bc3a9..2ca7f7c 100644
31--- a/testcases/kernel/syscalls/rt_sigsuspend/Makefile
32+++ b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
33@@ -19,4 +19,7 @@
34 top_srcdir ?= ../../../..
35
36 include $(top_srcdir)/include/mk/testcases.mk
37+
38+CFLAGS += -D_GNU_SOURCE
39+
40 include $(top_srcdir)/include/mk/generic_leaf_target.mk
41--
422.7.0
43
diff --git a/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch b/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
new file mode 100644
index 0000000000..f7ece9e18e
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
@@ -0,0 +1,32 @@
1From 2f8a57f66a94210d34dd0361659a8297cf3d813f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:29:24 +0000
4Subject: [PATCH 29/32] trace_shed: Fix build with musl
5
6Errors on musl are
7
8trace_sched.c:425:16: error: invalid operands to binary & (have
9'thread_sched_t * {aka struct <anonymous> *}' and 'int')
10 thrd_ndx, WEXITSTATUS(status));
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 testcases/kernel/sched/tool/trace_sched.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/testcases/kernel/sched/tool/trace_sched.c b/testcases/kernel/sched/tool/trace_sched.c
18index 7815686..30dca5f 100644
19--- a/testcases/kernel/sched/tool/trace_sched.c
20+++ b/testcases/kernel/sched/tool/trace_sched.c
21@@ -422,7 +422,7 @@ int main(int argc, /* number of input parameters. */
22 if (status == (thread_sched_t *) - 1) {
23 fprintf(stderr,
24 "thread [%d] - process exited with errors %d\n",
25- thrd_ndx, WEXITSTATUS(status));
26+ thrd_ndx, WEXITSTATUS((int)status));
27 exit(-1);
28 } else {
29 exp_prio[thrd_ndx] = status->exp_prio;
30--
312.7.0
32
diff --git a/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch b/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
new file mode 100644
index 0000000000..d2d6d76fd7
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
@@ -0,0 +1,33 @@
1From 77c95dacffe90382a1f131c801ac569120d95949 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:32:24 +0000
4Subject: [PATCH 30/32] lib: Use PTHREAD_MUTEX_RECURSIVE in place of
5 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc
6
7e.g. musl does not implement the _NP mutex types
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 lib/tst_res.c | 5 ++++-
12 1 file changed, 4 insertions(+), 1 deletion(-)
13
14diff --git a/lib/tst_res.c b/lib/tst_res.c
15index 5c1c58c..3244b5e 100644
16--- a/lib/tst_res.c
17+++ b/lib/tst_res.c
18@@ -104,8 +104,11 @@ int TEST_ERRNO;
19 assert(strlen(buf) > 0); \
20 } while (0)
21
22+#ifdef __GLIBC__
23 static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
24-
25+#else
26+static pthread_mutex_t tmutex = { PTHREAD_MUTEX_RECURSIVE };
27+#endif
28 /*
29 * Define local function prototypes.
30 */
31--
322.7.0
33
diff --git a/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch b/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
index 905eafb991..473ca4c65e 100644
--- a/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch
+++ b/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
@@ -1,7 +1,7 @@
1From 243881d71d2d49027c3dc15fe27ebe7f4ee68700 Mon Sep 17 00:00:00 2001 1From 293ff1da06748ed4c69be6ece262d42e562e7298 Mon Sep 17 00:00:00 2001
2From: Chuang Dong <Chuang.Dong@windriver.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 10 Jun 2015 09:51:09 +0800 3Date: Fri, 8 Jan 2016 07:36:19 +0000
4Subject: [PATCH] ltp: vma03 fix the alginment of page size 4Subject: [PATCH 31/32] vma03: fix page size offset as per page size alignment
5 5
6the offset the param of mmap2() doesn't align the page size, but, 6the offset the param of mmap2() doesn't align the page size, but,
7this param allow must be a multiple of the page size as returned 7this param allow must be a multiple of the page size as returned
@@ -9,18 +9,17 @@ by sysconf(_SC_PAGE_SIZE).meanwhile offset * 4096 must be a
9multiple of the system page size, so modify the input param of offset 9multiple of the system page size, so modify the input param of offset
10pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12)); 10pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
11 11
12Upstream-Status: Submitted
13
14Signed-off-by: Chuang Dong <Chuang.Dong@windriver.com> 12Signed-off-by: Chuang Dong <Chuang.Dong@windriver.com>
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
15--- 14---
16 testcases/kernel/mem/vma/vma03.c | 2 +- 15 testcases/kernel/mem/vma/vma03.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
18 17
19diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c 18diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c
20index 6af9960..b86d7ce 100644 19index ad8a7b4..a539233 100644
21--- a/testcases/kernel/mem/vma/vma03.c 20--- a/testcases/kernel/mem/vma/vma03.c
22+++ b/testcases/kernel/mem/vma/vma03.c 21+++ b/testcases/kernel/mem/vma/vma03.c
23@@ -89,7 +89,7 @@ int main(int argc, char *argv[]) 22@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
24 if (fd == -1) 23 if (fd == -1)
25 tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE); 24 tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE);
26 25
@@ -30,5 +29,5 @@ index 6af9960..b86d7ce 100644
30 fd, pgoff); 29 fd, pgoff);
31 if (map == MAP_FAILED) 30 if (map == MAP_FAILED)
32-- 31--
331.8.5.2.233.g932f7e4 322.7.0
34 33
diff --git a/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch b/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
new file mode 100644
index 0000000000..5c6bf919f8
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
@@ -0,0 +1,30 @@
1From 4f1905ff09c730091674818bd1b48ee221347101 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 08:30:29 +0000
4Subject: [PATCH 32/32] regen.sh: Include asm/unistd.h explicitly
5
6on musl this is not included indirectly and it results in errors like
7testcases/kernel/include/linux_syscall_numbers.h:1035:25: error:
8'__NR_SYSCALL_BASE' undeclared (first use in this function)
9| # define __NR_readdir (__NR_SYSCALL_BASE+ 89)
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 testcases/kernel/include/regen.sh | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh
17index f93f49b..ee790af 100755
18--- a/testcases/kernel/include/regen.sh
19+++ b/testcases/kernel/include/regen.sh
20@@ -32,6 +32,7 @@ cat << EOF > "${output_pid}"
21
22 #include <errno.h>
23 #include <sys/syscall.h>
24+#include <asm/unistd.h>
25 #include "cleanup.c"
26
27 #define ltp_syscall(NR, ...) ({ \\
28--
292.7.0
30
diff --git a/meta/recipes-extended/ltp/ltp/add-knob-for-numa.patch b/meta/recipes-extended/ltp/ltp/add-knob-for-numa.patch
deleted file mode 100644
index 064f00ae3d..0000000000
--- a/meta/recipes-extended/ltp/ltp/add-knob-for-numa.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1[PATCH] add knob to control whether numa support should be checked
2
3Upstream-Status: Pending
4
5otherwise the random dependency will be generated
6
7Signed-off-by: Roy.Li <rongqing.li@windriver.com>
8---
9 configure.ac | 10 +-
10diff --git a/configure.ac b/configure.ac
11index 9f397e7..1357256 100644
12--- a/configure.ac
13+++ b/configure.ac
14@@ -142,6 +142,12 @@ else
15 AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
16 fi
17
18+AC_ARG_WITH([numa],
19+ AC_HELP_STRING([--without-numa],
20+ [without the numa support]),
21+ [],[with_numa=yes],
22+)
23+
24 AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2])
25
26 # END testsuites knobs
27@@ -159,7 +165,9 @@ LTP_CHECK_SIGNAL
28 LTP_CHECK_SYSCALL_EVENTFD
29 LTP_CHECK_SYSCALL_KEYCTL
30 LTP_CHECK_SYSCALL_MODIFY_LDT
31+if test "x$with_numa" = xyes; then
32 LTP_CHECK_SYSCALL_NUMA
33+fi
34 LTP_CHECK_SYSCALL_QUOTACTL
35 LTP_CHECK_SYSCALL_SIGNALFD
36 LTP_CHECK_SYSCALL_UNSHARE
37--
381.9.1
39
diff --git a/meta/recipes-extended/ltp/ltp/make-setregid02-work.patch b/meta/recipes-extended/ltp/ltp/make-setregid02-work.patch
deleted file mode 100644
index 4836010bdf..0000000000
--- a/meta/recipes-extended/ltp/ltp/make-setregid02-work.patch
+++ /dev/null
@@ -1,61 +0,0 @@
1[PATCH] make setregid02 work
2
3Upstream-Status: Inappropriate [configuration]
4
5there is no "nobody" group in oe-core, the user "nobody" belongs to
6"nogroup" group, so replace nobody with nogroup to make the test pass
7
8Signed-off-by: Roy.Li <rongqing.li@windriver.com>
9---
10 testcases/kernel/syscalls/setregid/setregid02.c | 16 ++++++++--------
11 1 file changed, 8 insertions(+), 8 deletions(-)
12
13diff --git a/testcases/kernel/syscalls/setregid/setregid02.c b/testcases/kernel/syscalls/setregid/setregid02.c
14index 8058627..866bee4 100644
15--- a/testcases/kernel/syscalls/setregid/setregid02.c
16+++ b/testcases/kernel/syscalls/setregid/setregid02.c
17@@ -41,7 +41,7 @@ static gid_t neg_one = -1;
18
19 static struct passwd *ltpuser;
20
21-static struct group nobody, root, bin;
22+static struct group nogroup, root, bin;
23
24 /*
25 * The following structure contains all test data. Each structure in the array
26@@ -57,17 +57,17 @@ struct test_data_t {
27 char *test_msg;
28 } test_data[] = {
29 {
30- &neg_one, &root.gr_gid, EPERM, &nobody, &nobody,
31+ &neg_one, &root.gr_gid, EPERM, &nogroup, &nogroup,
32 "After setregid(-1, root),"}, {
33- &neg_one, &bin.gr_gid, EPERM, &nobody, &nobody,
34+ &neg_one, &bin.gr_gid, EPERM, &nogroup, &nogroup,
35 "After setregid(-1, bin)"}, {
36- &root.gr_gid, &neg_one, EPERM, &nobody, &nobody,
37+ &root.gr_gid, &neg_one, EPERM, &nogroup, &nogroup,
38 "After setregid(root,-1),"}, {
39- &bin.gr_gid, &neg_one, EPERM, &nobody, &nobody,
40+ &bin.gr_gid, &neg_one, EPERM, &nogroup, &nogroup,
41 "After setregid(bin, -1),"}, {
42- &root.gr_gid, &bin.gr_gid, EPERM, &nobody, &nobody,
43+ &root.gr_gid, &bin.gr_gid, EPERM, &nogroup, &nogroup,
44 "After setregid(root, bin)"}, {
45- &bin.gr_gid, &root.gr_gid, EPERM, &nobody, &nobody,
46+ &bin.gr_gid, &root.gr_gid, EPERM, &nogroup, &nogroup,
47 "After setregid(bin, root),"}
48 };
49
50@@ -165,7 +165,7 @@ static void setup(void)
51 } while (0)
52
53 GET_GID(root);
54- GET_GID(nobody);
55+ GET_GID(nogroup);
56 GET_GID(bin);
57
58 TEST_PAUSE;
59--
601.9.1
61
diff --git a/meta/recipes-extended/ltp/ltp_20150903.bb b/meta/recipes-extended/ltp/ltp_20160126.bb
index f018dae307..ac1679382d 100644
--- a/meta/recipes-extended/ltp/ltp_20150903.bb
+++ b/meta/recipes-extended/ltp/ltp_20160126.bb
@@ -20,16 +20,45 @@ LIC_FILES_CHKSUM = "\
20" 20"
21 21
22DEPENDS = "attr libaio libcap acl openssl zip-native" 22DEPENDS = "attr libaio libcap acl openssl zip-native"
23SRCREV = "d19755a1deddd0268d7c29991afddab497da1823" 23DEPENDS_append_libc-musl = " fts "
24EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
25CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
26CFLAGS_append_mips64 = " -D__SANE_USERSPACE_TYPES__"
27SRCREV = "fce797676b14f50406718e7ef640b50da66c9b36"
24 28
25SRC_URI = "git://github.com/linux-test-project/ltp.git \ 29SRC_URI = "git://github.com/linux-test-project/ltp.git \
26 file://0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch \ 30 file://0001-ltp-Don-t-link-against-libfl.patch \
27 file://ltp-Do-not-link-against-libfl.patch \ 31 file://0002-Add-knob-to-control-whether-numa-support-should-be-c.patch \
28 file://make-setregid02-work.patch \ 32 file://0003-Add-knob-to-control-tirpc-support.patch \
29 file://add-knob-for-numa.patch \ 33 file://0004-build-Add-option-to-select-libc-implementation.patch \
30 file://add-knob-for-tirpc.patch \ 34 file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
31 file://0001-ltp-vma03-fix-the-alginment-of-page-size.patch \ 35 file://0006-sendfile-Use-off64_t-instead-of-__off64_t.patch \
32 file://0001-Fix-compilation-for-gcc-5.x.patch \ 36 file://0007-replace-SIGCLD-with-SIGCHLD.patch \
37 file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
38 file://0009-Guard-error.h-with-__GLIBC__.patch \
39 file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \
40 file://0011-Rename-sigset-variable-to-sigset1.patch \
41 file://0012-fsstress.c-Replace-__int64_t-with-int64_t.patch \
42 file://0013-include-fcntl.h-for-getting-O_-definitions.patch \
43 file://0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch \
44 file://0015-mincore01-Rename-PAGESIZE-to-pagesize.patch \
45 file://0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch \
46 file://0017-replace-sigval_t-with-union-sigval.patch \
47 file://0018-guard-mallocopt-with-__GLIBC__.patch \
48 file://0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch \
49 file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \
50 file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \
51 file://0022-include-sys-types.h.patch \
52 file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \
53 file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \
54 file://0025-mc_gethost-include-sys-types.h.patch \
55 file://0026-crash01-Define-_GNU_SOURCE.patch \
56 file://0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch \
57 file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \
58 file://0029-trace_shed-Fix-build-with-musl.patch \
59 file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch \
60 file://0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch \
61 file://0032-regen.sh-Include-asm-unistd.h-explicitly.patch \
33" 62"
34 63
35S = "${WORKDIR}/git" 64S = "${WORKDIR}/git"