diff options
3 files changed, 48 insertions, 33 deletions
diff --git a/recipes-devtools/clang/clang/0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch b/recipes-devtools/clang/clang/0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch deleted file mode 100644 index a339caa..0000000 --- a/recipes-devtools/clang/clang/0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | From c7e8baa12d20683d2e824d4ea2193d26ba46e9d2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 11 Sep 2022 16:15:36 -0700 | ||
4 | Subject: [PATCH] Revert "[MIPS][compiler-rt] Fix stat struct's size for O32 | ||
5 | ABI" | ||
6 | |||
7 | This reverts commit 2bfb0fcb51510f22723c8cdfefe2a796a0a5ab25. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | .../lib/sanitizer_common/sanitizer_platform_limits_posix.h | 7 +++---- | ||
13 | 1 file changed, 3 insertions(+), 4 deletions(-) | ||
14 | |||
15 | diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
16 | index bd5692ed511b..a6091307bdce 100644 | ||
17 | --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
18 | +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
19 | @@ -98,10 +98,9 @@ const unsigned struct_kernel_stat64_sz = 104; | ||
20 | const unsigned struct_kernel_stat_sz = 144; | ||
21 | const unsigned struct_kernel_stat64_sz = 104; | ||
22 | #elif defined(__mips__) | ||
23 | -const unsigned struct_kernel_stat_sz = | ||
24 | - SANITIZER_ANDROID | ||
25 | - ? FIRST_32_SECOND_64(104, 128) | ||
26 | - : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216); | ||
27 | +const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID | ||
28 | + ? FIRST_32_SECOND_64(104, 128) | ||
29 | + : FIRST_32_SECOND_64(160, 216); | ||
30 | const unsigned struct_kernel_stat64_sz = 104; | ||
31 | #elif defined(__s390__) && !defined(__s390x__) | ||
32 | const unsigned struct_kernel_stat_sz = 64; | ||
diff --git a/recipes-devtools/clang/clang/0034-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch b/recipes-devtools/clang/clang/0034-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch new file mode 100644 index 0000000..f723bb3 --- /dev/null +++ b/recipes-devtools/clang/clang/0034-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From abebd2f8fd9b78e4fa3403fd93d926f8cc16a001 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 3 Jan 2023 18:44:34 -0800 | ||
4 | Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI | ||
5 | |||
6 | stat struct size differs on glibc based on ABI choices e.g. 64bit off_t | ||
7 | and/or 64bit time_t will make this size different. Therefore separate | ||
8 | out the O32 case out, makes it more readable. | ||
9 | |||
10 | Upstream-Status: Submitted [https://reviews.llvm.org/D140948] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | .../sanitizer_platform_limits_posix.h | 13 +++++++++++++ | ||
14 | 1 file changed, 13 insertions(+) | ||
15 | |||
16 | diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
17 | index bd5692ed511b..08d1ac8ab51b 100644 | ||
18 | --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
19 | +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
20 | @@ -98,11 +98,24 @@ const unsigned struct_kernel_stat64_sz = 104; | ||
21 | const unsigned struct_kernel_stat_sz = 144; | ||
22 | const unsigned struct_kernel_stat64_sz = 104; | ||
23 | #elif defined(__mips__) | ||
24 | +#if defined(__mips_o32) // O32 ABI | ||
25 | +#if _TIME_BITS == 64 | ||
26 | +const unsigned struct_kernel_stat_sz = 112; | ||
27 | +const unsigned struct_kernel_stat64_sz = 112; | ||
28 | +#elif _FILE_OFFSET_BITS == 64 | ||
29 | +const unsigned struct_kernel_stat_sz = 160; | ||
30 | +const unsigned struct_kernel_stat64_sz = 160; | ||
31 | +#else | ||
32 | +const unsigned struct_kernel_stat_sz = 144; | ||
33 | +const unsigned struct_kernel_stat64_sz = 160; | ||
34 | +#endif | ||
35 | +#else // __mips_o32 | ||
36 | const unsigned struct_kernel_stat_sz = | ||
37 | SANITIZER_ANDROID | ||
38 | ? FIRST_32_SECOND_64(104, 128) | ||
39 | : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216); | ||
40 | const unsigned struct_kernel_stat64_sz = 104; | ||
41 | +#endif | ||
42 | #elif defined(__s390__) && !defined(__s390x__) | ||
43 | const unsigned struct_kernel_stat_sz = 64; | ||
44 | const unsigned struct_kernel_stat64_sz = 104; | ||
45 | -- | ||
46 | 2.39.0 | ||
47 | |||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index fe27306..6e87145 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -43,7 +43,7 @@ SRC_URI = "\ | |||
43 | file://0031-clang-exclude-openembedded-distributions-from-settin.patch \ | 43 | file://0031-clang-exclude-openembedded-distributions-from-settin.patch \ |
44 | file://0032-compiler-rt-Enable-__int128-for-ppc32.patch \ | 44 | file://0032-compiler-rt-Enable-__int128-for-ppc32.patch \ |
45 | file://0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ | 45 | file://0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ |
46 | file://0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch \ | 46 | file://0034-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \ |
47 | file://0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch \ | 47 | file://0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch \ |
48 | file://0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ | 48 | file://0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ |
49 | " | 49 | " |