summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-03-22 15:54:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-25 10:29:16 +0000
commit4aa08b897628ef43adc9c3aa86bdf32499c328c1 (patch)
treed284df1f9d1fac9fdaff77282c09e4584c8e0388 /meta
parent959b7f204ea009fcf4ff0de30522ecf17cb64488 (diff)
downloadpoky-4aa08b897628ef43adc9c3aa86bdf32499c328c1.tar.gz
ltp: Fix build on x86/musl
In last patch it covered out the non-glibc case well but did not define else case, when __GLIBC__ is not defined, as a result errors like | getcpu01.c:107:41: error: use of undeclared identifier 'sys_support' | if (((tst_kvercmp(2, 6, 20)) < 0) || !(sys_support)) { appeared, fixed it with this updated patch (From OE-Core rev: 04cbc4834076fef6b46af4c5c66046862de7634d) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch50
-rw-r--r--meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch41
-rw-r--r--meta/recipes-extended/ltp/ltp_20160126.bb3
3 files changed, 71 insertions, 23 deletions
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
index 59e169e99c..d123074207 100644
--- 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
@@ -1,17 +1,18 @@
1From 714024e4699b28eed866d775f4c715b0e55b76f7 Mon Sep 17 00:00:00 2001 1From a3cbee31daae2466bc8dcac36b33a01352693346 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:40:08 +0000 3Date: Thu, 7 Jan 2016 19:40:08 +0000
4Subject: [PATCH 08/32] Check if __GLIBC_PREREQ is defined before using it 4Subject: [PATCH 01/26] Check if __GLIBC_PREREQ is defined before using it
5 5
6__GLIBC_PREREQ is specific to glibc so it should be checked if it is 6__GLIBC_PREREQ is specific to glibc so it should be checked if it is
7defined or not. 7defined or not.
8 8
9Signed-off-by: Khem Raj <raj.khem@gmail.com> 9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
10--- 11---
11 testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++++- 12 testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++-
12 testcases/kernel/syscalls/getcpu/getcpu01.c | 31 ++++++++++++++++++++++ 13 testcases/kernel/syscalls/getcpu/getcpu01.c | 40 +++++++++++++++++++++-
13 .../sched_getaffinity/sched_getaffinity01.c | 26 ++++++++++++++++++ 14 .../sched_getaffinity/sched_getaffinity01.c | 26 ++++++++++++++
14 3 files changed, 65 insertions(+), 1 deletion(-) 15 3 files changed, 73 insertions(+), 2 deletions(-)
15 16
16diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c 17diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c
17index 6072bfa..2b090cb 100644 18index 6072bfa..2b090cb 100644
@@ -58,47 +59,52 @@ index 6072bfa..2b090cb 100644
58 acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, 59 acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
59 closeonexec_flag | nonblock_flag); 60 closeonexec_flag | nonblock_flag);
60diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c 61diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c
61index c927512..6de6362 100644 62index c927512..921b107 100644
62--- a/testcases/kernel/syscalls/getcpu/getcpu01.c 63--- a/testcases/kernel/syscalls/getcpu/getcpu01.c
63+++ b/testcases/kernel/syscalls/getcpu/getcpu01.c 64+++ b/testcases/kernel/syscalls/getcpu/getcpu01.c
64@@ -62,6 +62,7 @@ 65@@ -62,6 +62,7 @@
65 #include <dirent.h> 66 #include <dirent.h>
66 67
67 #if defined(__i386__) || defined(__x86_64__) 68 #if defined(__i386__) || defined(__x86_64__)
68+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) 69+#if defined(__GLIBC__)
69 #if __GLIBC_PREREQ(2,6) 70 #if __GLIBC_PREREQ(2,6)
70 #if defined(__x86_64__) 71 #if defined(__x86_64__)
71 #include <utmpx.h> 72 #include <utmpx.h>
72@@ -72,13 +73,16 @@ int sys_support = 1; 73@@ -75,10 +76,17 @@ int sys_support = 0;
73 #else 74 #else
74 int sys_support = 0; 75 int sys_support = 0;
75 #endif 76 #endif
77+#else
78+int sys_support = 0;
76+#endif 79+#endif
77 #else
78 int sys_support = 0;
79 #endif
80 80
81+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) 81+#if defined(__GLIBC__)
82 #if !(__GLIBC_PREREQ(2, 7)) 82 #if !(__GLIBC_PREREQ(2, 7))
83 #define CPU_FREE(ptr) free(ptr) 83 #define CPU_FREE(ptr) free(ptr)
84 #endif 84 #endif
85+#else
86+#define CPU_FREE(ptr) free(ptr)
85+#endif 87+#endif
86 88
87 void cleanup(void); 89 void cleanup(void);
88 void setup(void); 90 void setup(void);
89@@ -164,9 +168,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id, 91@@ -164,9 +172,14 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
90 { 92 {
91 #if defined(__i386__) 93 #if defined(__i386__)
92 return syscall(318, cpu_id, node_id, cache_struct); 94 return syscall(318, cpu_id, node_id, cache_struct);
93+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) 95-#elif __GLIBC_PREREQ(2,6)
94 #elif __GLIBC_PREREQ(2,6) 96+#if defined(__GLIBC__)
97+#if __GLIBC_PREREQ(2,6)
98+ *cpu_id = sched_getcpu();
99+#endif
100+#else
95 *cpu_id = sched_getcpu(); 101 *cpu_id = sched_getcpu();
96 #endif 102 #endif
97+#endif 103+#endif
98 return 0; 104 return 0;
99 } 105 }
100 106
101@@ -191,15 +197,20 @@ unsigned int set_cpu_affinity(void) 107@@ -191,15 +204,20 @@ unsigned int set_cpu_affinity(void)
102 cpu_set_t *set; 108 cpu_set_t *set;
103 size_t size; 109 size_t size;
104 int nrcpus = 1024; 110 int nrcpus = 1024;
@@ -119,7 +125,7 @@ index c927512..6de6362 100644
119 #if __GLIBC_PREREQ(2, 7) 125 #if __GLIBC_PREREQ(2, 7)
120 size = CPU_ALLOC_SIZE(nrcpus); 126 size = CPU_ALLOC_SIZE(nrcpus);
121 CPU_ZERO_S(size, set); 127 CPU_ZERO_S(size, set);
122@@ -207,8 +218,13 @@ realloc: 128@@ -207,8 +225,13 @@ realloc:
123 size = sizeof(cpu_set_t); 129 size = sizeof(cpu_set_t);
124 CPU_ZERO(set); 130 CPU_ZERO(set);
125 #endif 131 #endif
@@ -133,7 +139,7 @@ index c927512..6de6362 100644
133 #if __GLIBC_PREREQ(2, 7) 139 #if __GLIBC_PREREQ(2, 7)
134 if (errno == EINVAL && nrcpus < (1024 << 8)) { 140 if (errno == EINVAL && nrcpus < (1024 << 8)) {
135 nrcpus = nrcpus << 2; 141 nrcpus = nrcpus << 2;
136@@ -220,10 +236,17 @@ realloc: 142@@ -220,10 +243,17 @@ realloc:
137 "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); 143 "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)");
138 else 144 else
139 #endif 145 #endif
@@ -151,7 +157,7 @@ index c927512..6de6362 100644
151 #if __GLIBC_PREREQ(2, 7) 157 #if __GLIBC_PREREQ(2, 7)
152 CPU_ZERO_S(size, set); 158 CPU_ZERO_S(size, set);
153 CPU_SET_S(cpu_max, size, set); 159 CPU_SET_S(cpu_max, size, set);
154@@ -231,6 +254,10 @@ realloc: 160@@ -231,6 +261,10 @@ realloc:
155 CPU_ZERO(set); 161 CPU_ZERO(set);
156 CPU_SET(cpu_max, set); 162 CPU_SET(cpu_max, set);
157 #endif 163 #endif
@@ -162,7 +168,7 @@ index c927512..6de6362 100644
162 if (sched_setaffinity(0, size, set) < 0) { 168 if (sched_setaffinity(0, size, set) < 0) {
163 CPU_FREE(set); 169 CPU_FREE(set);
164 tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno); 170 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) 171@@ -247,11 +281,15 @@ unsigned int max_cpuid(size_t size, cpu_set_t * set)
166 { 172 {
167 unsigned int index, max = 0; 173 unsigned int index, max = 0;
168 for (index = 0; index < size * BITS_PER_BYTE; index++) 174 for (index = 0; index < size * BITS_PER_BYTE; index++)
@@ -275,5 +281,5 @@ index 9d6a81a..4ed13b2 100644
275 QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1)); 281 QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1));
276 QUICK_TEST(sched_getaffinity(0, 0, mask)); 282 QUICK_TEST(sched_getaffinity(0, 0, mask));
277-- 283--
2782.7.0 2841.9.1
279 285
diff --git a/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch b/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch
new file mode 100644
index 0000000000..868e1cf1fa
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch
@@ -0,0 +1,41 @@
1From 5e3dea669e5b0b769f322d54a3bb9f320b5327da Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 22 Mar 2016 15:47:14 +0000
4Subject: [PATCH 26/26] shmat1: Cover GNU specific code under __USE_GNU
5
6on x86, we use uc_mcontext element from sigcontext
7which is marked gnu-specific in glibc, this patch
8adds this condition around the code
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12Upstream-Status: Pending
13
14 testcases/kernel/mem/mtest06/shmat1.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/testcases/kernel/mem/mtest06/shmat1.c b/testcases/kernel/mem/mtest06/shmat1.c
18index 0d6d7a4..bee69f6 100644
19--- a/testcases/kernel/mem/mtest06/shmat1.c
20+++ b/testcases/kernel/mem/mtest06/shmat1.c
21@@ -111,7 +111,7 @@ int done_shmat = 0; /* disallow read and writes before shmat */
22 static void sig_handler(int signal, /* signal number, set to handle SIGALRM */
23 int code, struct ucontext *ut)
24 { /* contains pointer to sigcontext structure */
25-#ifdef __i386__
26+#if defined(__i386__) && defined(__USE_GNU)
27 unsigned long except; /* exception type. */
28 int ret = 0; /* exit code from signal handler. */
29 struct sigcontext *scp = /* pointer to sigcontext structure */
30@@ -122,7 +122,7 @@ static void sig_handler(int signal, /* signal number, set to handle SIGALRM
31 fprintf(stdout, "Test ended, success\n");
32 exit(0);
33 }
34-#ifdef __i386__
35+#if defined(__i386__) && defined(__USE_GNU)
36 else {
37 except = scp->trapno;
38 fprintf(stderr, "signal caught - [%d] ", signal);
39--
401.9.1
41
diff --git a/meta/recipes-extended/ltp/ltp_20160126.bb b/meta/recipes-extended/ltp/ltp_20160126.bb
index ac1679382d..720a569ae5 100644
--- a/meta/recipes-extended/ltp/ltp_20160126.bb
+++ b/meta/recipes-extended/ltp/ltp_20160126.bb
@@ -59,7 +59,8 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
59 file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.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 \ 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 \ 61 file://0032-regen.sh-Include-asm-unistd.h-explicitly.patch \
62" 62 file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \
63 "
63 64
64S = "${WORKDIR}/git" 65S = "${WORKDIR}/git"
65 66