diff options
Diffstat (limited to 'meta/recipes-extended')
3 files changed, 138 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch b/meta/recipes-extended/ltp/ltp/0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch new file mode 100644 index 0000000000..7b662294f3 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From e79652a3839869b1983d65999e5d5dcb50bc9cd7 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Hongzhi.Song" <hongzhi.song@windriver.com> | ||
3 | Date: Mon, 15 Jul 2019 03:39:06 -0400 | ||
4 | Subject: [PATCH] getrlimit03: adjust a bit of code to compatiable with mips32 | ||
5 | |||
6 | Error info: | ||
7 | getrlimit03.c:104: FAIL: __NR_prlimit64(0) had rlim_cur = | ||
8 | ffffffffffffffff but __NR_getrlimit(0) had rlim_cur = 7fffffff | ||
9 | |||
10 | According to kernel code: [arch/mips/include/uapi/asm/resource.h] | ||
11 | RLIM_INFINITY is set to 0x7fffffffUL instead of ULONG_MAX on mips32. | ||
12 | |||
13 | /* | ||
14 | * SuS says limits have to be unsigned. | ||
15 | * Which makes a ton more sense anyway, | ||
16 | * but we keep the old value on MIPS32, | ||
17 | * for compatibility: | ||
18 | */ | ||
19 | #ifndef __mips64 | ||
20 | # define RLIM_INFINITY 0x7fffffffUL | ||
21 | #endif | ||
22 | |||
23 | Adding conditional statement about mips to fix this. | ||
24 | |||
25 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
26 | Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
27 | |||
28 | Upstream-Status: Backport | ||
29 | Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
30 | --- | ||
31 | testcases/kernel/syscalls/getrlimit/getrlimit03.c | 8 +++++++- | ||
32 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
33 | |||
34 | diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit03.c b/testcases/kernel/syscalls/getrlimit/getrlimit03.c | ||
35 | index e4d56c4..03bd821 100644 | ||
36 | --- a/testcases/kernel/syscalls/getrlimit/getrlimit03.c | ||
37 | +++ b/testcases/kernel/syscalls/getrlimit/getrlimit03.c | ||
38 | @@ -26,6 +26,7 @@ | ||
39 | |||
40 | #include "tst_test.h" | ||
41 | #include "lapi/syscalls.h" | ||
42 | +#include "lapi/abisize.h" | ||
43 | |||
44 | /** | ||
45 | * Linux provides an "old" getrlimit syscall handler that uses signed long, | ||
46 | @@ -61,7 +62,12 @@ struct rlimit_ulong { | ||
47 | unsigned long rlim_cur; | ||
48 | unsigned long rlim_max; | ||
49 | }; | ||
50 | -const unsigned long RLIM_INFINITY_UL = ULONG_MAX; | ||
51 | + | ||
52 | +#if defined(__mips__) && defined(TST_ABI32) | ||
53 | + const unsigned long RLIM_INFINITY_UL = 0x7fffffffUL; | ||
54 | +#else | ||
55 | + const unsigned long RLIM_INFINITY_UL = ULONG_MAX; | ||
56 | +#endif | ||
57 | |||
58 | static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim) | ||
59 | { | ||
60 | -- | ||
61 | 2.8.1 | ||
62 | |||
diff --git a/meta/recipes-extended/ltp/ltp/0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch b/meta/recipes-extended/ltp/ltp/0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch new file mode 100644 index 0000000000..a6129d3b94 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch | |||
@@ -0,0 +1,74 @@ | |||
1 | From d5293d73b760268a6b200ab7d9323e37700e6a8c Mon Sep 17 00:00:00 2001 | ||
2 | From: Petr Vorel <petr.vorel@gmail.com> | ||
3 | Date: Thu, 28 Mar 2019 07:11:25 +0100 | ||
4 | Subject: [PATCH] lapi: Define TST_ABI{,32,64} to detect target type | ||
5 | |||
6 | This is meant to be a replacement of __WORDSIZE definition. | ||
7 | |||
8 | Motivation was instead of finding, where all libc define | ||
9 | __WORDSIZE, which is usually used for detecting target type | ||
10 | (at least MUSL defines it in different place than other libc) | ||
11 | we define our own constant. | ||
12 | |||
13 | Suggested-by: Cyril Hrubis <chrubis@suse.cz> | ||
14 | Signed-off-by: Petr Vorel <petr.vorel@gmail.com> | ||
15 | |||
16 | Upstream-Status: Backport | ||
17 | Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> | ||
18 | --- | ||
19 | include/lapi/abisize.h | 29 +++++++++++++---------------- | ||
20 | 1 file changed, 13 insertions(+), 16 deletions(-) | ||
21 | |||
22 | diff --git a/include/lapi/abisize.h b/include/lapi/abisize.h | ||
23 | index 897bdfd..9e6622c 100644 | ||
24 | --- a/include/lapi/abisize.h | ||
25 | +++ b/include/lapi/abisize.h | ||
26 | @@ -1,25 +1,22 @@ | ||
27 | +// SPDX-License-Identifier: GPL-2.0-or-later | ||
28 | /* | ||
29 | - * Copyright (c) 2014 Linux Test Project | ||
30 | + * Copyright (c) 2014-2019 Linux Test Project | ||
31 | * Cyril Hrubis <chrubis@suse.cz> | ||
32 | - * | ||
33 | - * This program is free software; you can redistribute it and/or | ||
34 | - * modify it under the terms of the GNU General Public License as | ||
35 | - * published by the Free Software Foundation; either version 2 of | ||
36 | - * the License, or (at your option) any later version. | ||
37 | - * | ||
38 | - * This program is distributed in the hope that it would be useful, | ||
39 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
40 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
41 | - * GNU General Public License for more details. | ||
42 | - * | ||
43 | - * You should have received a copy of the GNU General Public License | ||
44 | - * along with this program; if not, write the Free Software Foundation, | ||
45 | - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
46 | + * Petr Vorel <petr.vorel@gmail.com> | ||
47 | */ | ||
48 | |||
49 | #ifndef ABISIZE_H__ | ||
50 | #define ABISIZE_H__ | ||
51 | |||
52 | +/* __WORDSIZE replacement */ | ||
53 | +#if defined(__LP64__) || defined(_LP64) | ||
54 | +# define TST_ABI64 | ||
55 | +# define TST_ABI 64 | ||
56 | +#else | ||
57 | +# define TST_ABI32 | ||
58 | +# define TST_ABI 32 | ||
59 | +#endif | ||
60 | + | ||
61 | /* | ||
62 | * Determines if we have to split up 64 bit arguments or not | ||
63 | * | ||
64 | @@ -29,6 +26,6 @@ | ||
65 | (defined(__mips__) && _MIPS_SIM == _ABIN32) || \ | ||
66 | (defined(__x86_64__) && defined(__ILP32__)) || \ | ||
67 | (defined(__aarch64__) && defined(__ILP32__)) || \ | ||
68 | - __WORDSIZE == 64 | ||
69 | + defined(TST_ABI64) | ||
70 | |||
71 | #endif /* ABISIZE_H__ */ | ||
72 | -- | ||
73 | 2.8.1 | ||
74 | |||
diff --git a/meta/recipes-extended/ltp/ltp_20190115.bb b/meta/recipes-extended/ltp/ltp_20190115.bb index b7b581f65a..f208b712dd 100644 --- a/meta/recipes-extended/ltp/ltp_20190115.bb +++ b/meta/recipes-extended/ltp/ltp_20190115.bb | |||
@@ -53,6 +53,8 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
53 | file://0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch \ | 53 | file://0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch \ |
54 | file://0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch \ | 54 | file://0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch \ |
55 | file://0001-file01.sh-Fix-in-was-not-recognized.patch \ | 55 | file://0001-file01.sh-Fix-in-was-not-recognized.patch \ |
56 | file://0001-lapi-Define-TST_ABI-32-64-to-detect-target-type.patch \ | ||
57 | file://0001-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch \ | ||
56 | " | 58 | " |
57 | 59 | ||
58 | S = "${WORKDIR}/git" | 60 | S = "${WORKDIR}/git" |