From d17984eda9635f98d4472019d4af83f661b4dfe7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 12 Feb 2016 09:54:20 +0000 Subject: 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. Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- .../ltp/ltp/0001-Fix-compilation-for-gcc-5.x.patch | 79 ----- ...tests_noltp.sh-script-so-have-unique-name.patch | 202 ----------- .../ltp/0001-ltp-Don-t-link-against-libfl.patch | 30 ++ ...-ltp-vma03-fix-the-alginment-of-page-size.patch | 34 -- ...-control-whether-numa-support-should-be-c.patch | 43 +++ .../0003-Add-knob-to-control-tirpc-support.patch | 45 +++ ...-Add-option-to-select-libc-implementation.patch | 147 ++++++++ ...rollers-Link-with-libfts-explicitly-on-mu.patch | 45 +++ ...sendfile-Use-off64_t-instead-of-__off64_t.patch | 31 ++ .../ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch | 394 +++++++++++++++++++++ ...__GLIBC_PREREQ-is-defined-before-using-it.patch | 279 +++++++++++++++ .../ltp/0009-Guard-error.h-with-__GLIBC__.patch | 270 ++++++++++++++ ...010-replace-__BEGIN_DECLS-and-__END_DECLS.patch | 73 ++++ .../0011-Rename-sigset-variable-to-sigset1.patch | 136 +++++++ ...fsstress.c-Replace-__int64_t-with-int64_t.patch | 351 ++++++++++++++++++ ...nclude-fcntl.h-for-getting-O_-definitions.patch | 67 ++++ ...ing-Include-sys-types.h-for-pid_t-definit.patch | 56 +++ ...015-mincore01-Rename-PAGESIZE-to-pagesize.patch | 64 ++++ ...Change-header-from-ustat.h-to-sys-ustat.h.patch | 45 +++ .../0017-replace-sigval_t-with-union-sigval.patch | 88 +++++ .../ltp/0018-guard-mallocopt-with-__GLIBC__.patch | 32 ++ ...lace-canonicalize_file_name-with-realpath.patch | 32 ++ ...define-getdents-getdents64-only-for-glibc.patch | 48 +++ ..._GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch | 71 ++++ .../ltp/ltp/0022-include-sys-types.h.patch | 29 ++ ...-Use-int-instead-of-enum-__ptrace_request.patch | 48 +++ ...gaction-rt_sigprocmark-Define-_GNU_SOURCE.patch | 68 ++++ .../ltp/0025-mc_gethost-include-sys-types.h.patch | 28 ++ .../ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch | 29 ++ ...sconf01-Use-_SC_2_C_VERSION-conditionally.patch | 29 ++ ...n.h-Use-sighandler_t-instead-of-__sighand.patch | 43 +++ .../ltp/0029-trace_shed-Fix-build-with-musl.patch | 32 ++ ...READ_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch | 33 ++ ...age-size-offset-as-per-page-size-alignmen.patch | 33 ++ ...-regen.sh-Include-asm-unistd.h-explicitly.patch | 30 ++ .../ltp/ltp/add-knob-for-numa.patch | 39 -- .../ltp/ltp/add-knob-for-tirpc.patch | 37 -- .../ltp/ltp/ltp-Do-not-link-against-libfl.patch | 31 -- .../ltp/ltp/make-setregid02-work.patch | 61 ---- meta/recipes-extended/ltp/ltp_20150903.bb | 77 ---- meta/recipes-extended/ltp/ltp_20160126.bb | 106 ++++++ 41 files changed, 2855 insertions(+), 560 deletions(-) delete mode 100644 meta/recipes-extended/ltp/ltp/0001-Fix-compilation-for-gcc-5.x.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch create mode 100644 meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch delete mode 100644 meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch create mode 100644 meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch create mode 100644 meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch create mode 100644 meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch create mode 100644 meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch create mode 100644 meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch create mode 100644 meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch create mode 100644 meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch create mode 100644 meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch create mode 100644 meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch create mode 100644 meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch create mode 100644 meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch create mode 100644 meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch create mode 100644 meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch create mode 100644 meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch create mode 100644 meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch create mode 100644 meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch create mode 100644 meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch create mode 100644 meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch create mode 100644 meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch create mode 100644 meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch create mode 100644 meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch create mode 100644 meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch create mode 100644 meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch create mode 100644 meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch create mode 100644 meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch create mode 100644 meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch create mode 100644 meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch create mode 100644 meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch create mode 100644 meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch create mode 100644 meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch create mode 100644 meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch delete mode 100644 meta/recipes-extended/ltp/ltp/add-knob-for-numa.patch delete mode 100644 meta/recipes-extended/ltp/ltp/add-knob-for-tirpc.patch delete mode 100644 meta/recipes-extended/ltp/ltp/ltp-Do-not-link-against-libfl.patch delete mode 100644 meta/recipes-extended/ltp/ltp/make-setregid02-work.patch delete mode 100644 meta/recipes-extended/ltp/ltp_20150903.bb create mode 100644 meta/recipes-extended/ltp/ltp_20160126.bb 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 @@ -From 40a2457cb8ec42a05a2f96b0810057efdb2a55f5 Mon Sep 17 00:00:00 2001 -From: Kai Kang -Date: Wed, 16 Sep 2015 13:23:43 +0200 -Subject: [PATCH] Fix compilation for gcc-5.x - -The gcc-5.x defaults to -std=gnu11 instead of -std=gnu89 which causes -semantics for inline functions changes. - -GNU89 inline: Same as C99 extern inline. - -So the standalone 'inline' causes error such as: - -git/testcases/kernel/syscalls/kill/kill10.c:355: undefined reference to `k_sigaction' - -Replace inline with static inline to fix this issue. - -Ref: -https://gcc.gnu.org/gcc-5/porting_to.html - -Upstream-Status: Backport -Signed-off-by: Kai Kang -Acked-by: Cyril Hrubis ---- - testcases/kernel/controllers/libcontrollers/libcontrollers.c | 2 +- - testcases/kernel/controllers/libcontrollers/libcontrollers.h | 2 +- - testcases/kernel/syscalls/kill/kill10.c | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/testcases/kernel/controllers/libcontrollers/libcontrollers.c b/testcases/kernel/controllers/libcontrollers/libcontrollers.c -index 844c5bc..75766fc 100644 ---- a/testcases/kernel/controllers/libcontrollers/libcontrollers.c -+++ b/testcases/kernel/controllers/libcontrollers/libcontrollers.c -@@ -158,7 +158,7 @@ int read_file(char *filepath, int action, unsigned int *value) - * Prints error message and returns -1 - */ - --inline void error_function(char *msg1, char *msg2) -+static inline void error_function(char *msg1, char *msg2) - { - fprintf(stdout, "ERROR: %s ", msg1); - fprintf(stdout, "%s\n", msg2); -diff --git a/testcases/kernel/controllers/libcontrollers/libcontrollers.h b/testcases/kernel/controllers/libcontrollers/libcontrollers.h -index bd8e2d8..cdde9f9 100644 ---- a/testcases/kernel/controllers/libcontrollers/libcontrollers.h -+++ b/testcases/kernel/controllers/libcontrollers/libcontrollers.h -@@ -70,7 +70,7 @@ enum{ - GET_TASKS - }; - --inline void error_function(char *msg1, char *msg2); -+static inline void error_function(char *msg1, char *msg2); - - int read_shares_file(char *filepath); - -diff --git a/testcases/kernel/syscalls/kill/kill10.c b/testcases/kernel/syscalls/kill/kill10.c -index 982d9da..33dbcd3 100644 ---- a/testcases/kernel/syscalls/kill/kill10.c -+++ b/testcases/kernel/syscalls/kill/kill10.c -@@ -185,7 +185,7 @@ int child_checklist_total = 0; - int checklist_cmp(const void *a, const void *b); - void checklist_reset(int bit); - --inline int k_sigaction(int sig, struct sigaction *sa, struct sigaction *osa); -+static inline int k_sigaction(int sig, struct sigaction *sa, struct sigaction *osa); - - char *TCID = "kill10"; - int TST_TOTAL = 1; -@@ -756,7 +756,7 @@ void checklist_reset(int bit) - - } - --inline int k_sigaction(int sig, struct sigaction *sa, struct sigaction *osa) -+static inline int k_sigaction(int sig, struct sigaction *sa, struct sigaction *osa) - { - int ret; - if ((ret = sigaction(sig, sa, osa)) == -1) { --- -1.9.1 - 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 @@ -From 9751a6526cffcdf4e3dc2cb33641259a7be00e19 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Sat, 7 Dec 2013 18:24:32 +0100 -Subject: [PATCH] Rename runtests_noltp.sh script so have unique name - -* they are installed in the same target path - /opt/ltp/testcases/bin/runtests_noltp.sh - and overwrite each other in non-deterministic way - when multiple processes are used in "make install" - - ./temp/log.do_install:install -m 00775 - "ltp/20120903-r2/ltp-20120903/testcases/kernel/containers/sysvipc/runtests_noltp.sh" - "ltp/20120903-r2/image/opt/ltp/testcases/bin/runtests_noltp.sh" - ./temp/log.do_install:install -m 00775 - "ltp/20120903-r2/ltp-20120903/testcases/kernel/containers/utsname/runtests_noltp.sh" - "ltp/20120903-r2/image/opt/ltp/testcases/bin/runtests_noltp.sh" - -Upstream-Status: Pending - -Signed-off-by: Martin Jansa ---- - .../kernel/containers/sysvipc/runipctests_noltp.sh | 31 ++++++++++++++++ - .../kernel/containers/sysvipc/runtests_noltp.sh | 31 ---------------- - .../kernel/containers/utsname/runtests_noltp.sh | 41 ---------------------- - .../kernel/containers/utsname/runutstests_noltp.sh | 41 ++++++++++++++++++++++ - 4 files changed, 72 insertions(+), 72 deletions(-) - create mode 100644 testcases/kernel/containers/sysvipc/runipctests_noltp.sh - delete mode 100644 testcases/kernel/containers/sysvipc/runtests_noltp.sh - delete mode 100755 testcases/kernel/containers/utsname/runtests_noltp.sh - create mode 100755 testcases/kernel/containers/utsname/runutstests_noltp.sh - -diff --git a/testcases/kernel/containers/sysvipc/runipctests_noltp.sh b/testcases/kernel/containers/sysvipc/runipctests_noltp.sh -new file mode 100644 -index 0000000..84f398f ---- /dev/null -+++ b/testcases/kernel/containers/sysvipc/runipctests_noltp.sh -@@ -0,0 +1,31 @@ -+#!/bin/sh -+################################################################################ -+## ## -+## Copyright (c) International Business Machines Corp., 2007 ## -+## ## -+## This program is free software; you can redistribute it and#or modify ## -+## it under the terms of the GNU General Public License as published by ## -+## the Free Software Foundation; either version 2 of the License, or ## -+## (at your option) any later version. ## -+## ## -+## This program is distributed in the hope that it will be useful, but ## -+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## -+## for more details. ## -+## ## -+## You should have received a copy of the GNU General Public License ## -+## along with this program; if not, write to the Free Software ## -+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -+## ## -+################################################################################ -+ -+exit_code=0 -+echo "sysvipc tests" -+for type in none clone unshare; do -+ echo "**sysvipc $type" -+ ./shmnstest_noltp $type -+ if [ $? -ne 0 ]; then -+ exit_code=$? -+ fi -+done -+exit $exit_code -diff --git a/testcases/kernel/containers/sysvipc/runtests_noltp.sh b/testcases/kernel/containers/sysvipc/runtests_noltp.sh -deleted file mode 100644 -index 84f398f..0000000 ---- a/testcases/kernel/containers/sysvipc/runtests_noltp.sh -+++ /dev/null -@@ -1,31 +0,0 @@ --#!/bin/sh --################################################################################ --## ## --## Copyright (c) International Business Machines Corp., 2007 ## --## ## --## This program is free software; you can redistribute it and#or modify ## --## it under the terms of the GNU General Public License as published by ## --## the Free Software Foundation; either version 2 of the License, or ## --## (at your option) any later version. ## --## ## --## This program is distributed in the hope that it will be useful, but ## --## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## --## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## --## for more details. ## --## ## --## You should have received a copy of the GNU General Public License ## --## along with this program; if not, write to the Free Software ## --## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## --## ## --################################################################################ -- --exit_code=0 --echo "sysvipc tests" --for type in none clone unshare; do -- echo "**sysvipc $type" -- ./shmnstest_noltp $type -- if [ $? -ne 0 ]; then -- exit_code=$? -- fi --done --exit $exit_code -diff --git a/testcases/kernel/containers/utsname/runtests_noltp.sh b/testcases/kernel/containers/utsname/runtests_noltp.sh -deleted file mode 100755 -index 43cb7e2..0000000 ---- a/testcases/kernel/containers/utsname/runtests_noltp.sh -+++ /dev/null -@@ -1,41 +0,0 @@ --#!/bin/sh --################################################################################ --## ## --## Copyright (c) International Business Machines Corp., 2007 ## --## ## --## This program is free software; you can redistribute it and#or modify ## --## it under the terms of the GNU General Public License as published by ## --## the Free Software Foundation; either version 2 of the License, or ## --## (at your option) any later version. ## --## ## --## This program is distributed in the hope that it will be useful, but ## --## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## --## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## --## for more details. ## --## ## --## You should have received a copy of the GNU General Public License ## --## along with this program; if not, write to the Free Software ## --## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## --## ## --################################################################################ -- --oldhostname=`hostname` --exit_code=0 --echo "unshare tests" --for i in `seq 1 5`; do -- echo "test $i (unshare)" -- ./utstest_noltp unshare $i -- if [ $? -ne 0 ]; then -- exit_code=$? -- fi --done --echo "clone tests" --for i in `seq 1 5`; do -- echo "test $i (clone)" -- ./utstest_noltp clone $i -- if [ $? -ne 0 ]; then -- exit_code=$? -- fi --done --hostname "$oldhostname" --exit $exit_code -diff --git a/testcases/kernel/containers/utsname/runutstests_noltp.sh b/testcases/kernel/containers/utsname/runutstests_noltp.sh -new file mode 100755 -index 0000000..43cb7e2 ---- /dev/null -+++ b/testcases/kernel/containers/utsname/runutstests_noltp.sh -@@ -0,0 +1,41 @@ -+#!/bin/sh -+################################################################################ -+## ## -+## Copyright (c) International Business Machines Corp., 2007 ## -+## ## -+## This program is free software; you can redistribute it and#or modify ## -+## it under the terms of the GNU General Public License as published by ## -+## the Free Software Foundation; either version 2 of the License, or ## -+## (at your option) any later version. ## -+## ## -+## This program is distributed in the hope that it will be useful, but ## -+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## -+## for more details. ## -+## ## -+## You should have received a copy of the GNU General Public License ## -+## along with this program; if not, write to the Free Software ## -+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -+## ## -+################################################################################ -+ -+oldhostname=`hostname` -+exit_code=0 -+echo "unshare tests" -+for i in `seq 1 5`; do -+ echo "test $i (unshare)" -+ ./utstest_noltp unshare $i -+ if [ $? -ne 0 ]; then -+ exit_code=$? -+ fi -+done -+echo "clone tests" -+for i in `seq 1 5`; do -+ echo "test $i (clone)" -+ ./utstest_noltp clone $i -+ if [ $? -ne 0 ]; then -+ exit_code=$? -+ fi -+done -+hostname "$oldhostname" -+exit $exit_code --- -1.8.4.3 - diff --git a/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch b/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch new file mode 100644 index 0000000000..585b7cbc6a --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch @@ -0,0 +1,30 @@ +From 14985fccf7428eaa0b45decc22bfd20fd780f621 Mon Sep 17 00:00:00 2001 +From: Chong Lu +Date: Tue, 11 Mar 2014 14:47:22 +0800 +Subject: [PATCH 01/32] ltp: Don't link against libfl + +We have already defined yywrap function in scan.l file. After this, we no longer need to +link against libfl and so no longer get errors about undefined references to yylex. + +Signed-off-by: Chong Lu +Signed-off-by: Khem Raj +--- + pan/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pan/Makefile b/pan/Makefile +index 4cc6466..a4b575b 100644 +--- a/pan/Makefile ++++ b/pan/Makefile +@@ -31,7 +31,7 @@ CPPFLAGS += -Wno-error + + CPPFLAGS += -I$(abs_srcdir) + +-LDLIBS += -lm $(LEXLIB) ++LDLIBS += -lm + + LFLAGS += -l + +-- +2.7.0 + diff --git a/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch b/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch deleted file mode 100644 index 905eafb991..0000000000 --- a/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 243881d71d2d49027c3dc15fe27ebe7f4ee68700 Mon Sep 17 00:00:00 2001 -From: Chuang Dong -Date: Wed, 10 Jun 2015 09:51:09 +0800 -Subject: [PATCH] ltp: vma03 fix the alginment of page size - -the offset the param of mmap2() doesn't align the page size, but, -this param allow must be a multiple of the page size as returned -by sysconf(_SC_PAGE_SIZE).meanwhile offset * 4096 must be a -multiple of the system page size, so modify the input param of offset -pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12)); - -Upstream-Status: Submitted - -Signed-off-by: Chuang Dong ---- - testcases/kernel/mem/vma/vma03.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c -index 6af9960..b86d7ce 100644 ---- a/testcases/kernel/mem/vma/vma03.c -+++ b/testcases/kernel/mem/vma/vma03.c -@@ -89,7 +89,7 @@ int main(int argc, char *argv[]) - if (fd == -1) - tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE); - -- pgoff = ULONG_MAX - 1; -+ pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12)); - map = mmap2(NULL, pgsz, PROT_READ | PROT_WRITE, MAP_PRIVATE, - fd, pgoff); - if (map == MAP_FAILED) --- -1.8.5.2.233.g932f7e4 - 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 @@ +From 867ad5d5d64b9b27ee32148027532db0a00f6433 Mon Sep 17 00:00:00 2001 +From: "Roy.Li" +Date: Thu, 7 Jan 2016 17:33:26 +0000 +Subject: [PATCH 02/32] Add knob to control whether numa support should be + checked + +otherwise undeterministic dependency will be generated +during build depending upong numa being staged or not + +signed-off-by: Roy.Li +Signed-off-by: Khem Raj +--- + m4/ltp-numa.m4 | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4 +index 60ae07b..ed7078d 100644 +--- a/m4/ltp-numa.m4 ++++ b/m4/ltp-numa.m4 +@@ -24,7 +24,13 @@ dnl ---------------------------- + dnl + AC_DEFUN([LTP_CHECK_SYSCALL_NUMA], + [dnl +-AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[ ++AC_MSG_CHECKING([for numa]) ++AC_ARG_WITH( ++ [numa], ++ AC_HELP_STRING([--without-numa], ++ [without numa support]), ++ [], ++ [AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[ + LTP_SYSCALL_NUMA_HEADERS=yes + AC_CHECK_LIB(numa,numa_alloc_onnode,[have_numa_alloc_onnode="yes"]) + if test "x$have_numa_alloc_onnode" = "xyes"; then +@@ -48,3 +54,5 @@ if test "x$have_mpol_constants" = "xyes"; then + AC_DEFINE(HAVE_MPOL_CONSTANTS,1,[define to 1 if you have all constants required to use mbind tests]) + fi + )]) ++AC_MSG_RESULT([$with_numa]) ++]) +-- +2.7.0 + diff --git a/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch b/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch new file mode 100644 index 0000000000..bf1176fc41 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch @@ -0,0 +1,45 @@ +From b193011da301b3d944e8fddcf4817513c31c5b88 Mon Sep 17 00:00:00 2001 +From: Fathi Boudra +Date: Thu, 7 Jan 2016 17:36:19 +0000 +Subject: [PATCH 03/32] Add knob to control tirpc support + +allow to disable tirpc. Helps to disable it at top level for eg. musl it +does not yet work. + +Signed-off-by: Fathi Boudra +Signed-off-by: Khem Raj +--- + configure.ac | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/configure.ac b/configure.ac +index cc50397..9e2936b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -98,6 +98,13 @@ if test "x$with_python" = xyes; then + else + AC_SUBST([WITH_PYTHON],["no"]) + fi ++ ++# TI RPC ++AC_ARG_WITH([tirpc], ++ AC_HELP_STRING([--without-tirpc], ++ [without libtirpc support]), ++ [],[with_tirpc=yes], ++) + # END tools knobs + + # Testsuites knobs +@@ -169,7 +176,9 @@ LTP_CHECK_RENAMEAT2 + LTP_CHECK_FALLOCATE + LTP_CHECK_SYSCALL_FCNTL + LTP_CHECK_SYSCALL_PERF_EVENT_OPEN ++if test "x$with_tirpc" = xyes; then + LTP_CHECK_TIRPC ++fi + LTP_CHECK_TEE + LTP_CHECK_SPLICE + LTP_CHECK_VMSPLICE +-- +2.7.0 + diff --git a/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch 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 @@ +From 53acddddf1b324e06af886ee4639b774e5c8c8bc Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 18:19:03 +0000 +Subject: [PATCH 04/32] build: Add option to select libc implementation + +There are more than glibc for C library implementation available on +linux now a days, uclibc cloaked like glibc but musl e.g. is very +different and does not implement all GNU extentions + +Disable tests specifically not building _yet_ on musl based systems + +Signed-off-by: Khem Raj +--- + Makefile | 5 +++++ + testcases/kernel/Makefile | 5 ++++- + testcases/kernel/sched/Makefile | 4 +++- + testcases/kernel/syscalls/Makefile | 5 +++++ + testcases/network/nfsv4/acl/Makefile | 4 ++++ + testcases/network/rpc/basic_tests/Makefile | 5 +++++ + testcases/realtime/func/pi-tests/Makefile | 4 ++++ + testcases/realtime/stress/pi-tests/Makefile | 5 +++++ + 8 files changed, 35 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 297f8e7..906b280 100644 +--- a/Makefile ++++ b/Makefile +@@ -49,6 +49,11 @@ SKIP_IDCHECK ?= 0 + UCLINUX ?= 0 + export UCLINUX + ++# System C library implementation (glibc,uclibc,musl etc.) ++# default to glibc if not set ++LIBC ?= glibc ++export LIBC ++ + # CLEAN_TARGETS: Targets which exist solely in clean. + # COMMON_TARGETS: Targets which exist in all, clean, and install. + # INSTALL_TARGETS: Targets which exist in clean and install (contains +diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile +index 50a12fa..4f1987f 100644 +--- a/testcases/kernel/Makefile ++++ b/testcases/kernel/Makefile +@@ -47,13 +47,16 @@ SUBDIRS += connectors \ + logging \ + mem \ + numa \ +- pty \ + sched \ + security \ + timers \ + tracing \ + module \ + ++ifneq ($(LIBC),musl) ++SUBDIRS += pty ++endif ++ + ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes) + SUBDIRS += power_management + endif +diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile +index 6245ed0..aa4eb7f 100644 +--- a/testcases/kernel/sched/Makefile ++++ b/testcases/kernel/sched/Makefile +@@ -23,5 +23,7 @@ + top_srcdir ?= ../../.. + + include $(top_srcdir)/include/mk/env_pre.mk +- ++ifeq ($(LIBC),musl) ++ FILTER_OUT_DIRS += process_stress ++endif + include $(top_srcdir)/include/mk/generic_trunk_target.mk +diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile +index 8acb395..b749126 100644 +--- a/testcases/kernel/syscalls/Makefile ++++ b/testcases/kernel/syscalls/Makefile +@@ -28,5 +28,10 @@ ifeq ($(UCLINUX),1) + FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \ + mincore mprotect nftw profil remap_file_pages sbrk + endif ++ifeq ($(LIBC),musl) ++FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \ ++ rt_sigsuspend setdomainname sethostname sigsuspend \ ++ ustat ++endif + + include $(top_srcdir)/include/mk/generic_trunk_target.mk +diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile +index 8bc78c2..c36cf50 100644 +--- a/testcases/network/nfsv4/acl/Makefile ++++ b/testcases/network/nfsv4/acl/Makefile +@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk + + LDLIBS += $(ACL_LIBS) + ++ifeq ($(LIBC),musl) ++FILTER_OUT_MAKE_TARGETS := acl1 ++endif ++ + include $(top_srcdir)/include/mk/generic_leaf_target.mk +diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile +index 3160813..9bdf5d0 100644 +--- a/testcases/network/rpc/basic_tests/Makefile ++++ b/testcases/network/rpc/basic_tests/Makefile +@@ -23,4 +23,9 @@ + top_srcdir ?= ../../../.. + + include $(top_srcdir)/include/mk/env_pre.mk ++ ++ifeq ($(LIBC),musl) ++FILTER_OUT_DIRS += rpc01 ++endif ++ + include $(top_srcdir)/include/mk/generic_trunk_target.mk +diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile +index 7a7a57a..5808866 100644 +--- a/testcases/realtime/func/pi-tests/Makefile ++++ b/testcases/realtime/func/pi-tests/Makefile +@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk + include $(abs_srcdir)/../../config.mk + + MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex ++ifeq ($(LIBC),musl) ++FILTER_OUT_MAKE_TARGETS := testpi-5 testpi-6 sbrk_mutex ++endif ++ + + include $(top_srcdir)/include/mk/generic_leaf_target.mk +diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile +index 5edc3b4..aa5987a 100644 +--- a/testcases/realtime/stress/pi-tests/Makefile ++++ b/testcases/realtime/stress/pi-tests/Makefile +@@ -24,4 +24,9 @@ top_srcdir ?= ../../../.. + + include $(top_srcdir)/include/mk/env_pre.mk + include $(abs_srcdir)/../../config.mk ++ ++ifeq ($(LIBC),musl) ++FILTER_OUT_MAKE_TARGETS := testpi-3 ++endif ++ + include $(top_srcdir)/include/mk/generic_leaf_target.mk +-- +2.7.0 + diff --git a/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch 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 @@ +From 6e3058521b50d91d4b0569c4d491c5af5ff798b2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 18:22:38 +0000 +Subject: [PATCH 05/32] kernel/controllers: Link with libfts explicitly on musl + +musl does not implement fts like glibc and therefore it depends on +external implementation for all fts APIs + +Signed-off-by: Khem Raj +--- + testcases/kernel/controllers/Makefile.inc | 3 +++ + testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc +index b106283..ef5fc0c 100644 +--- a/testcases/kernel/controllers/Makefile.inc ++++ b/testcases/kernel/controllers/Makefile.inc +@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB) + CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR) + + LDFLAGS += -L$(abs_builddir)/../$(LIBDIR) ++ifeq ($(LIBC),musl) ++LDLIBS += -lfts ++endif + + INSTALL_TARGETS ?= *.sh + +diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc +index 9e002f4..e0fcb9c 100644 +--- a/testcases/kernel/controllers/cpuset/Makefile.inc ++++ b/testcases/kernel/controllers/cpuset/Makefile.inc +@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET) + LDFLAGS += -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR) + + LDLIBS += -lcpu_set -lcontrollers -lltp ++ifeq ($(LIBC),musl) ++LDLIBS += -lfts ++endif + + INSTALL_TARGETS ?= *.sh + +-- +2.7.0 + diff --git a/meta/recipes-extended/ltp/ltp/0006-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 @@ +From fb8b895385a641d74f2186fe5f20a872209692ed Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 18:24:20 +0000 +Subject: [PATCH 06/32] sendfile: Use off64_t instead of __off64_t + +__off64_t is specific to glibc where as off64_t is widely available +Add _GNU_SOURCE for off64_t defines from sys/types.h +Fixes +:0:7: error: unknown type name 'off64_t' +sendfile02.c:97:18: note: in expansion of macro 'OFF_T' + +Signed-off-by: Khem Raj +--- + testcases/kernel/syscalls/sendfile/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/sendfile/Makefile b/testcases/kernel/syscalls/sendfile/Makefile +index df7b63f..1bd1b57 100644 +--- a/testcases/kernel/syscalls/sendfile/Makefile ++++ b/testcases/kernel/syscalls/sendfile/Makefile +@@ -21,6 +21,6 @@ top_srcdir ?= ../../../.. + include $(top_srcdir)/include/mk/testcases.mk + include $(abs_srcdir)/../utils/newer_64.mk + +-%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t ++%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=off64_t -D_GNU_SOURCE + + include $(top_srcdir)/include/mk/generic_leaf_target.mk +-- +2.7.0 + 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 @@ +From 405c03171e4bf0edd698cb602cf7bd7fe1d0401a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 19:33:53 +0000 +Subject: [PATCH 07/32] replace SIGCLD with SIGCHLD + +its defined to use SIGCHLD anyway in + +bits/signum.h:#define SIGCLD SIGCHLD /* Same as SIGCHLD +(System V). */ + +plus it helps these tests compile with musl which adheres to posix + +Signed-off-by: Khem Raj +--- + lib/tst_sig.c | 8 ++++---- + testcases/kernel/connectors/pec/pec_listener.c | 1 + + testcases/kernel/fs/doio/doio.c | 4 ++-- + testcases/kernel/fs/doio/growfiles.c | 2 +- + testcases/kernel/syscalls/fcntl/fcntl11.c | 8 ++++---- + testcases/kernel/syscalls/fcntl/fcntl17.c | 8 ++++---- + testcases/kernel/syscalls/fcntl/fcntl19.c | 8 ++++---- + testcases/kernel/syscalls/fcntl/fcntl20.c | 8 ++++---- + testcases/kernel/syscalls/fcntl/fcntl21.c | 8 ++++---- + testcases/kernel/syscalls/kill/kill02.c | 6 +++--- + testcases/kernel/syscalls/kill/kill12.c | 8 ++++---- + testcases/kernel/syscalls/mkdir/mkdir09.c | 12 ++++++------ + testcases/kernel/syscalls/sighold/sighold02.c | 2 +- + testcases/network/tcp_cmds/perf_lan/pingpong.c | 2 +- + testcases/network/tcp_cmds/perf_lan/pingpong6.c | 2 +- + 15 files changed, 44 insertions(+), 43 deletions(-) + +diff --git a/lib/tst_sig.c b/lib/tst_sig.c +index 3af5ffd..36565e1 100644 +--- a/lib/tst_sig.c ++++ b/lib/tst_sig.c +@@ -49,7 +49,7 @@ + fork_flag - set to FORK or NOFORK depending upon whether the + calling program executes a fork() system call. It + is normally the case that the calling program treats +- SIGCLD as an expected signal if fork() is being used. ++ SIGCHLD as an expected signal if fork() is being used. + + handler - a pointer to the unexpected signal handler to + be executed after an unexpected signal has been +@@ -82,7 +82,7 @@ static void (*tst_setup_signal(int, void (*)(int))) (int); + + /**************************************************************************** + * tst_sig() : set-up to catch unexpected signals. fork_flag is set to NOFORK +- * if SIGCLD is to be an "unexpected signal", otherwise it is set to ++ * if SIGCHLD is to be an "unexpected signal", otherwise it is set to + * FORK. cleanup points to a cleanup routine to be executed before + * tst_exit is called (cleanup is set to NULL if no cleanup is desired). + * handler is a pointer to the signal handling routine (if handler is +@@ -117,7 +117,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ()) + for (sig = 1; sig < NSIG; sig++) { + /* + * SIGKILL is never unexpected. +- * SIGCLD is only unexpected when ++ * SIGCHLD is only unexpected when + * no forking is being done. + * SIGINFO is used for file quotas and should be expected + */ +@@ -205,7 +205,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ()) + #endif + break; + +- case SIGCLD: ++ case SIGCHLD: + if (fork_flag == FORK) + continue; + +diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c +index a1beb13..002750a 100644 +--- a/testcases/kernel/connectors/pec/pec_listener.c ++++ b/testcases/kernel/connectors/pec/pec_listener.c +@@ -20,6 +20,7 @@ + /* */ + /******************************************************************************/ + ++#define _GNU_SOURCE + #include + #include + #include +diff --git a/testcases/kernel/fs/doio/doio.c b/testcases/kernel/fs/doio/doio.c +index 4b0dec5..5f65ef9 100644 +--- a/testcases/kernel/fs/doio/doio.c ++++ b/testcases/kernel/fs/doio/doio.c +@@ -573,7 +573,7 @@ int main(int argc, char **argv) + case SIGTSTP: + case SIGSTOP: + case SIGCONT: +- case SIGCLD: ++ case SIGCHLD: + case SIGBUS: + case SIGSEGV: + case SIGQUIT: +@@ -615,7 +615,7 @@ int main(int argc, char **argv) + } + + sigemptyset(&block_mask); +- sigaddset(&block_mask, SIGCLD); ++ sigaddset(&block_mask, SIGCHLD); + sigprocmask(SIG_BLOCK, &block_mask, &omask); + + /* +diff --git a/testcases/kernel/fs/doio/growfiles.c b/testcases/kernel/fs/doio/growfiles.c +index 09e7f35..bbad230 100644 +--- a/testcases/kernel/fs/doio/growfiles.c ++++ b/testcases/kernel/fs/doio/growfiles.c +@@ -1640,7 +1640,7 @@ int set_sig(void) + #ifdef SIGRESTART + case SIGRESTART: + #endif /* SIGRESTART */ +- case SIGCLD: ++ case SIGCHLD: + break; + + default: +diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c +index fa6ce53..2de2b6c 100644 +--- a/testcases/kernel/syscalls/fcntl/fcntl11.c ++++ b/testcases/kernel/syscalls/fcntl/fcntl11.c +@@ -105,10 +105,10 @@ void setup(void) + memset(&act, 0, sizeof(act)); + act.sa_handler = catch_child; + sigemptyset(&act.sa_mask); +- sigaddset(&act.sa_mask, SIGCLD); +- if ((sigaction(SIGCLD, &act, NULL)) < 0) ++ sigaddset(&act.sa_mask, SIGCHLD); ++ if ((sigaction(SIGCHLD, &act, NULL)) < 0) + tst_brkm(TBROK | TERRNO, cleanup, +- "sigaction(SIGCLD, ..) failed"); ++ "sigaction(SIGCHLD, ..) failed"); + } + + void do_child(void) +@@ -227,7 +227,7 @@ void stop_child(void) + { + struct flock fl; + +- signal(SIGCLD, SIG_DFL); ++ signal(SIGCHLD, SIG_DFL); + fl.l_type = STOP; + parent_put(&fl); + wait(0); +diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c +index 5b03e39..6598b20 100644 +--- a/testcases/kernel/syscalls/fcntl/fcntl17.c ++++ b/testcases/kernel/syscalls/fcntl/fcntl17.c +@@ -150,9 +150,9 @@ int setup(void) + memset(&act, 0, sizeof(act)); + act.sa_handler = catch_child; + sigemptyset(&act.sa_mask); +- sigaddset(&act.sa_mask, SIGCLD); +- if (sigaction(SIGCLD, &act, NULL) < 0) { +- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno); ++ sigaddset(&act.sa_mask, SIGCHLD); ++ if (sigaction(SIGCHLD, &act, NULL) < 0) { ++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno); + return 1; + } + return 0; +@@ -381,7 +381,7 @@ void stop_children(void) + { + int arg; + +- signal(SIGCLD, SIG_DFL); ++ signal(SIGCHLD, SIG_DFL); + arg = STOP; + child_free(child_pipe1[1], arg); + child_free(child_pipe2[1], arg); +diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c +index a542cfc..88c91d6 100644 +--- a/testcases/kernel/syscalls/fcntl/fcntl19.c ++++ b/testcases/kernel/syscalls/fcntl/fcntl19.c +@@ -112,9 +112,9 @@ void setup(void) + memset(&act, 0, sizeof(act)); + act.sa_handler = catch_child; + sigemptyset(&act.sa_mask); +- sigaddset(&act.sa_mask, SIGCLD); +- if ((sigaction(SIGCLD, &act, NULL)) < 0) { +- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno); ++ sigaddset(&act.sa_mask, SIGCHLD); ++ if ((sigaction(SIGCHLD, &act, NULL)) < 0) { ++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno); + fail = 1; + } + } +@@ -265,7 +265,7 @@ void stop_child(void) + { + struct flock fl; + +- signal(SIGCLD, SIG_DFL); ++ signal(SIGCHLD, SIG_DFL); + fl.l_type = STOP; + parent_put(&fl); + wait(0); +diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c +index aa06bab..99fd783 100644 +--- a/testcases/kernel/syscalls/fcntl/fcntl20.c ++++ b/testcases/kernel/syscalls/fcntl/fcntl20.c +@@ -109,9 +109,9 @@ void setup(void) + memset(&act, 0, sizeof(act)); + act.sa_handler = catch_child; + sigemptyset(&act.sa_mask); +- sigaddset(&act.sa_mask, SIGCLD); +- if (sigaction(SIGCLD, &act, NULL) == -1) +- tst_brkm(TFAIL | TERRNO, cleanup, "SIGCLD signal setup failed"); ++ sigaddset(&act.sa_mask, SIGCHLD); ++ if (sigaction(SIGCHLD, &act, NULL) == -1) ++ tst_brkm(TFAIL | TERRNO, cleanup, "SIGCHLD signal setup failed"); + } + + void cleanup(void) +@@ -264,7 +264,7 @@ void stop_child(void) + { + struct flock fl; + +- signal(SIGCLD, SIG_DFL); ++ signal(SIGCHLD, SIG_DFL); + fl.l_type = STOP; + parent_put(&fl); + wait(0); +diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c +index 5307021..8f1a67c 100644 +--- a/testcases/kernel/syscalls/fcntl/fcntl21.c ++++ b/testcases/kernel/syscalls/fcntl/fcntl21.c +@@ -110,9 +110,9 @@ void setup(void) + memset(&act, 0, sizeof(act)); + act.sa_handler = catch_child; + sigemptyset(&act.sa_mask); +- sigaddset(&act.sa_mask, SIGCLD); +- if ((sigaction(SIGCLD, &act, NULL)) < 0) { +- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno); ++ sigaddset(&act.sa_mask, SIGCHLD); ++ if ((sigaction(SIGCHLD, &act, NULL)) < 0) { ++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno); + fail = 1; + } + } +@@ -272,7 +272,7 @@ void stop_child(void) + { + struct flock fl; + +- signal(SIGCLD, SIG_DFL); ++ signal(SIGCHLD, SIG_DFL); + fl.l_type = STOP; + parent_put(&fl); + wait(0); +diff --git a/testcases/kernel/syscalls/kill/kill02.c b/testcases/kernel/syscalls/kill/kill02.c +index 9d6cc68..08360dd 100644 +--- a/testcases/kernel/syscalls/kill/kill02.c ++++ b/testcases/kernel/syscalls/kill/kill02.c +@@ -701,7 +701,7 @@ void setup(void) + + /* + * Set to catch unexpected signals. +- * SIGCLD is set to be ignored because we do not wait for termination status. ++ * SIGCHLD is set to be ignored because we do not wait for termination status. + * SIGUSR1 is set to be ignored because this is the signal we are using for + * the test and we are not concerned with the parent getting it. + */ +@@ -713,9 +713,9 @@ void setup(void) + "signal(SIGUSR1, SIG_IGN) failed"); + } + +- if (signal(SIGCLD, SIG_IGN) == SIG_ERR) { ++ if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) { + tst_brkm(TBROK | TERRNO, NULL, +- "signal(SIGCLD, SIG_IGN) failed"); ++ "signal(SIGCHLD, SIG_IGN) failed"); + } + + TEST_PAUSE; +diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c +index 7a47a4a..d7c4147 100644 +--- a/testcases/kernel/syscalls/kill/kill12.c ++++ b/testcases/kernel/syscalls/kill/kill12.c +@@ -98,7 +98,7 @@ int main(int argc, char **argv) + + exno = 1; + +- if (sigset(SIGCLD, chsig) == SIG_ERR) { ++ if (sigset(SIGCHLD, chsig) == SIG_ERR) { + fprintf(temp, "\tsigset failed, errno = %d\n", errno); + fail_exit(); + } +@@ -128,7 +128,7 @@ int main(int argc, char **argv) + sleep(1); + + kill(pid, sig); /* child should ignroe this sig */ +- kill(pid, SIGCLD); /* child should exit */ ++ kill(pid, SIGCHLD); /* child should exit */ + + #ifdef BCS + while ((npid = wait(&status)) != pid +@@ -222,14 +222,14 @@ void do_child(void) + int exno = 1; + + #ifdef UCLINUX +- if (sigset(SIGCLD, chsig) == SIG_ERR) { ++ if (sigset(SIGCHLD, chsig) == SIG_ERR) { + fprintf(temp, "\tsigset failed, errno = %d\n", errno); + fail_exit(); + } + #endif + + sigset(sig, SIG_IGN); /* set to ignore signal */ +- kill(getppid(), SIGCLD); /* tell parent we are ready */ ++ kill(getppid(), SIGCHLD); /* tell parent we are ready */ + while (!chflag) + sleep(1); /* wait for parent */ + +diff --git a/testcases/kernel/syscalls/mkdir/mkdir09.c b/testcases/kernel/syscalls/mkdir/mkdir09.c +index 41c20e9..07b4fb8 100644 +--- a/testcases/kernel/syscalls/mkdir/mkdir09.c ++++ b/testcases/kernel/syscalls/mkdir/mkdir09.c +@@ -122,10 +122,10 @@ int main(int argc, char *argv[]) + + } + +- /* Set up to catch SIGCLD signal */ +- if (signal(SIGCLD, chld) == SIG_ERR) { ++ /* Set up to catch SIGCHLD signal */ ++ if (signal(SIGCHLD, chld) == SIG_ERR) { + tst_brkm(TFAIL, cleanup, +- "Error setting up SIGCLD signal, ERRNO = %d", errno); ++ "Error setting up SIGCHLD signal, ERRNO = %d", errno); + + } + +@@ -236,9 +236,9 @@ int runtest(void) + tst_brkm(TFAIL, cleanup, + "Error resetting SIGTERM signal, ERRNO = %d", errno); + } +- if (signal(SIGCLD, SIG_DFL) == SIG_ERR) { ++ if (signal(SIGCHLD, SIG_DFL) == SIG_ERR) { + tst_brkm(TFAIL, cleanup, +- "Error resetting SIGCLD signal, ERRNO = %d", errno); ++ "Error resetting SIGCHLD signal, ERRNO = %d", errno); + } + + if (test_time) { +@@ -372,7 +372,7 @@ void term(int sig) + + void chld(int sig) + { +- /* Routine to handle SIGCLD signal. */ ++ /* Routine to handle SIGCHLD signal. */ + + sigchld++; + if (jump) { +diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c +index e3076fb..be01874 100644 +--- a/testcases/kernel/syscalls/sighold/sighold02.c ++++ b/testcases/kernel/syscalls/sighold/sighold02.c +@@ -77,7 +77,7 @@ static int sigs_map[NUMSIGS]; + static int skip_sig(int sig) + { + switch (sig) { +- case SIGCLD: ++ case SIGCHLD: + case SIGKILL: + case SIGALRM: + case SIGSTOP: +diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong.c b/testcases/network/tcp_cmds/perf_lan/pingpong.c +index 1196312..5b06798 100644 +--- a/testcases/network/tcp_cmds/perf_lan/pingpong.c ++++ b/testcases/network/tcp_cmds/perf_lan/pingpong.c +@@ -182,7 +182,7 @@ int main(int argc, char *argv[]) + + /* Setup traps */ + signal(SIGINT, finish); +- signal(SIGCLD, finish); ++ signal(SIGCHLD, finish); + + /* Fork a child process to continue sending packets */ + tst_resm(TINFO, "Create a child process to continue to send packets"); +diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong6.c b/testcases/network/tcp_cmds/perf_lan/pingpong6.c +index 9747f58..0a0fb1d 100644 +--- a/testcases/network/tcp_cmds/perf_lan/pingpong6.c ++++ b/testcases/network/tcp_cmds/perf_lan/pingpong6.c +@@ -153,7 +153,7 @@ char *argv[]; + + /* Setup traps */ + signal(SIGINT, finish); +- signal(SIGCLD, finish); ++ signal(SIGCHLD, finish); + + /* Fork a child process to continue sending packets */ + printf("Create a child process to continue to send packets \n"); +-- +2.7.0 + diff --git a/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch 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 @@ +From 714024e4699b28eed866d775f4c715b0e55b76f7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 19:40:08 +0000 +Subject: [PATCH 08/32] Check if __GLIBC_PREREQ is defined before using it + +__GLIBC_PREREQ is specific to glibc so it should be checked if it is +defined or not. + +Signed-off-by: Khem Raj +--- + testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++++- + testcases/kernel/syscalls/getcpu/getcpu01.c | 31 ++++++++++++++++++++++ + .../sched_getaffinity/sched_getaffinity01.c | 26 ++++++++++++++++++ + 3 files changed, 65 insertions(+), 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c +index 6072bfa..2b090cb 100644 +--- a/testcases/kernel/syscalls/accept4/accept4_01.c ++++ b/testcases/kernel/syscalls/accept4/accept4_01.c +@@ -64,6 +64,7 @@ static void cleanup(void) + tst_rmdir(); + } + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 10)) + static int + accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) +@@ -82,7 +83,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) + } + tst_resm(TINFO, "\n"); + #endif +- + #if USE_SOCKETCALL + long args[6]; + +@@ -97,6 +97,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) + #endif + } + #endif ++#endif + + static void + do_test(int lfd, struct sockaddr_in *conn_addr, +@@ -119,9 +120,15 @@ do_test(int lfd, struct sockaddr_in *conn_addr, + die("Connect Error"); + + addrlen = sizeof(struct sockaddr_in); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 10)) + acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen, + closeonexec_flag | nonblock_flag); ++ ++#else ++ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, ++ closeonexec_flag | nonblock_flag); ++#endif + #else + acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, + closeonexec_flag | nonblock_flag); +diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c +index c927512..6de6362 100644 +--- a/testcases/kernel/syscalls/getcpu/getcpu01.c ++++ b/testcases/kernel/syscalls/getcpu/getcpu01.c +@@ -62,6 +62,7 @@ + #include + + #if defined(__i386__) || defined(__x86_64__) ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2,6) + #if defined(__x86_64__) + #include +@@ -72,13 +73,16 @@ int sys_support = 1; + #else + int sys_support = 0; + #endif ++#endif + #else + int sys_support = 0; + #endif + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 7)) + #define CPU_FREE(ptr) free(ptr) + #endif ++#endif + + void cleanup(void); + void setup(void); +@@ -164,9 +168,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id, + { + #if defined(__i386__) + return syscall(318, cpu_id, node_id, cache_struct); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #elif __GLIBC_PREREQ(2,6) + *cpu_id = sched_getcpu(); + #endif ++#endif + return 0; + } + +@@ -191,15 +197,20 @@ unsigned int set_cpu_affinity(void) + cpu_set_t *set; + size_t size; + int nrcpus = 1024; ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + realloc: + set = CPU_ALLOC(nrcpus); + #else + set = malloc(sizeof(cpu_set_t)); + #endif ++#else ++ set = malloc(sizeof(cpu_set_t)); ++#endif + if (set == NULL) { + tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno); + } ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + size = CPU_ALLOC_SIZE(nrcpus); + CPU_ZERO_S(size, set); +@@ -207,8 +218,13 @@ realloc: + size = sizeof(cpu_set_t); + CPU_ZERO(set); + #endif ++#else ++ size = sizeof(cpu_set_t); ++ CPU_ZERO(set); ++#endif + if (sched_getaffinity(0, size, set) < 0) { + CPU_FREE(set); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + if (errno == EINVAL && nrcpus < (1024 << 8)) { + nrcpus = nrcpus << 2; +@@ -220,10 +236,17 @@ realloc: + "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); + else + #endif ++#else ++ if (errno == EINVAL) ++ tst_resm(TFAIL, ++ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); ++ else ++#endif + tst_resm(TFAIL, "sched_getaffinity:errno:%d", errno); + tst_exit(); + } + cpu_max = max_cpuid(size, set); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + CPU_ZERO_S(size, set); + CPU_SET_S(cpu_max, size, set); +@@ -231,6 +254,10 @@ realloc: + CPU_ZERO(set); + CPU_SET(cpu_max, set); + #endif ++#else ++ CPU_ZERO(set); ++ CPU_SET(cpu_max, set); ++#endif + if (sched_setaffinity(0, size, set) < 0) { + CPU_FREE(set); + tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno); +@@ -247,11 +274,15 @@ unsigned int max_cpuid(size_t size, cpu_set_t * set) + { + unsigned int index, max = 0; + for (index = 0; index < size * BITS_PER_BYTE; index++) ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + if (CPU_ISSET_S(index, size, set)) + #else + if (CPU_ISSET(index, set)) + #endif ++#else ++ if (CPU_ISSET(index, set)) ++#endif + max = index; + return max; + } +diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c +index 9d6a81a..4ed13b2 100644 +--- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c ++++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c +@@ -66,9 +66,11 @@ do { \ + tst_resm((TEST_RETURN == -1 ? TPASS : TFAIL) | TTERRNO, #t); \ + } while (0) + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 7)) + #define CPU_FREE(ptr) free(ptr) + #endif ++#endif + + int main(int ac, char **av) + { +@@ -95,14 +97,19 @@ static void do_test(void) + pid_t unused_pid; + unsigned len; + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + realloc: + mask = CPU_ALLOC(nrcpus); + #else + mask = malloc(sizeof(cpu_set_t)); + #endif ++#else ++ mask = malloc(sizeof(cpu_set_t)); ++#endif + if (mask == NULL) + tst_brkm(TFAIL | TTERRNO, cleanup, "fail to get enough memory"); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + len = CPU_ALLOC_SIZE(nrcpus); + CPU_ZERO_S(len, mask); +@@ -110,10 +117,15 @@ realloc: + len = sizeof(cpu_set_t); + CPU_ZERO(mask); + #endif ++#else ++ len = sizeof(cpu_set_t); ++ CPU_ZERO(mask); ++#endif + /* positive test */ + TEST(sched_getaffinity(0, len, mask)); + if (TEST_RETURN == -1) { + CPU_FREE(mask); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + if (errno == EINVAL && nrcpus < (1024 << 8)) { + nrcpus = nrcpus << 2; +@@ -125,17 +137,27 @@ realloc: + "newer glibc(>= 2.7)"); + else + #endif ++#else ++ if (errno == EINVAL) ++ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a " ++ "newer glibc(>= 2.7)"); ++ else ++#endif + tst_resm(TFAIL | TTERRNO, "fail to get cpu affinity"); + cleanup(); + } else { + tst_resm(TINFO, "cpusetsize is %d", len); + tst_resm(TINFO, "mask.__bits[0] = %lu ", mask->__bits[0]); + for (i = 0; i < num; i++) { ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + TEST(CPU_ISSET_S(i, len, mask)); + #else + TEST(CPU_ISSET(i, mask)); + #endif ++#else ++ TEST(CPU_ISSET(i, mask)); ++#endif + if (TEST_RETURN != -1) + tst_resm(TPASS, "sched_getaffinity() succeed, " + "this process %d is running " +@@ -143,11 +165,15 @@ realloc: + } + } + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + CPU_ZERO_S(len, mask); + #else + CPU_ZERO(mask); + #endif ++#else ++ CPU_ZERO(mask); ++#endif + /* negative tests */ + QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1)); + QUICK_TEST(sched_getaffinity(0, 0, mask)); +-- +2.7.0 + 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 @@ +From 4ba19d64e95a874995d0b554b891b5ec35bd9495 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 7 Jan 2016 19:45:35 +0000 +Subject: [PATCH 09/32] Guard error.h with __GLIBC__ + +error API is specific to glibc so use the guard to make it conditional +on glibc + +Signed-off-by: Khem Raj +--- + testcases/kernel/syscalls/faccessat/faccessat01.c | 2 ++ + testcases/kernel/syscalls/fallocate/fallocate01.c | 2 ++ + testcases/kernel/syscalls/fchmodat/fchmodat01.c | 2 ++ + testcases/kernel/syscalls/fchownat/fchownat01.c | 2 ++ + testcases/kernel/syscalls/fchownat/fchownat02.c | 2 ++ + testcases/kernel/syscalls/fstatat/fstatat01.c | 2 ++ + testcases/kernel/syscalls/futimesat/futimesat01.c | 2 ++ + testcases/kernel/syscalls/linkat/linkat01.c | 2 ++ + testcases/kernel/syscalls/linkat/linkat02.c | 2 ++ + testcases/kernel/syscalls/mkdirat/mkdirat01.c | 2 ++ + testcases/kernel/syscalls/mknodat/mknodat01.c | 2 ++ + testcases/kernel/syscalls/mknodat/mknodat02.c | 2 ++ + testcases/kernel/syscalls/openat/openat01.c | 2 ++ + testcases/kernel/syscalls/readlinkat/readlinkat01.c | 2 ++ + testcases/kernel/syscalls/renameat/renameat01.c | 2 ++ + testcases/kernel/syscalls/symlinkat/symlinkat01.c | 2 ++ + testcases/kernel/syscalls/unlinkat/unlinkat01.c | 2 ++ + 17 files changed, 34 insertions(+) + +diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c +index 7f0e87a..c72dcf0 100644 +--- a/testcases/kernel/syscalls/faccessat/faccessat01.c ++++ b/testcases/kernel/syscalls/faccessat/faccessat01.c +@@ -37,7 +37,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/syscalls/fallocate/fallocate01.c b/testcases/kernel/syscalls/fallocate/fallocate01.c +index e72b123..643c0e2 100644 +--- a/testcases/kernel/syscalls/fallocate/fallocate01.c ++++ b/testcases/kernel/syscalls/fallocate/fallocate01.c +@@ -96,7 +96,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + +diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c +index 19e9ad5..ae6d807 100644 +--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c ++++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c +@@ -37,7 +37,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c b/testcases/kernel/syscalls/fchownat/fchownat01.c +index b361253..a5218af 100644 +--- a/testcases/kernel/syscalls/fchownat/fchownat01.c ++++ b/testcases/kernel/syscalls/fchownat/fchownat01.c +@@ -28,7 +28,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/syscalls/fchownat/fchownat02.c b/testcases/kernel/syscalls/fchownat/fchownat02.c +index 6b0304c..8d2863f 100644 +--- a/testcases/kernel/syscalls/fchownat/fchownat02.c ++++ b/testcases/kernel/syscalls/fchownat/fchownat02.c +@@ -26,7 +26,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/syscalls/fstatat/fstatat01.c b/testcases/kernel/syscalls/fstatat/fstatat01.c +index 61531c6..e99fbd2 100644 +--- a/testcases/kernel/syscalls/fstatat/fstatat01.c ++++ b/testcases/kernel/syscalls/fstatat/fstatat01.c +@@ -48,7 +48,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/syscalls/futimesat/futimesat01.c b/testcases/kernel/syscalls/futimesat/futimesat01.c +index ae8d4fe..316dd78 100644 +--- a/testcases/kernel/syscalls/futimesat/futimesat01.c ++++ b/testcases/kernel/syscalls/futimesat/futimesat01.c +@@ -37,7 +37,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c +index fc0687b..83cbfe7 100644 +--- a/testcases/kernel/syscalls/linkat/linkat01.c ++++ b/testcases/kernel/syscalls/linkat/linkat01.c +@@ -49,7 +49,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/syscalls/linkat/linkat02.c b/testcases/kernel/syscalls/linkat/linkat02.c +index e9a752a..8d7e431 100644 +--- a/testcases/kernel/syscalls/linkat/linkat02.c ++++ b/testcases/kernel/syscalls/linkat/linkat02.c +@@ -23,7 +23,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c +index 7e15947..1dbc038 100644 +--- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c ++++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c +@@ -30,7 +30,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +diff --git a/testcases/kernel/sys