1 |
commit: 591e569f5896eefcfe2094b4f6e444d73dea6359 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 17 18:44:36 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 18 22:04:43 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=591e569f |
7 |
|
8 |
sys-libs/compiler-rt-sanitizers: Backport fix for sys/ustat.h |
9 |
|
10 |
Closes: https://bugs.gentoo.org/675654 |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
.../compiler-rt-sanitizers-4.0.1.ebuild | 4 ++ |
14 |
.../compiler-rt-sanitizers-5.0.2.ebuild | 4 ++ |
15 |
...se-pre-computed-size-of-struct-ustat-for-.patch | 61 ++++++++++++++++++++++ |
16 |
3 files changed, 69 insertions(+) |
17 |
|
18 |
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild |
19 |
index 00662c398d6..b57164e921d 100644 |
20 |
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild |
21 |
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild |
22 |
@@ -68,6 +68,10 @@ src_prepare() { |
23 |
eapply "${WORKDIR}/${P}-patchset" |
24 |
cmake-utils_src_prepare |
25 |
|
26 |
+ # sys/ustat.h removed in glibc 2.28 |
27 |
+ # https://bugs.gentoo.org/675654 |
28 |
+ eapply "${FILESDIR}"/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch |
29 |
+ |
30 |
if use test; then |
31 |
# remove tests that are broken by new glibc |
32 |
# (disabled in 6.0.0+, r313069) |
33 |
|
34 |
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild |
35 |
index d8168a231aa..2862cd5c871 100644 |
36 |
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild |
37 |
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild |
38 |
@@ -72,6 +72,10 @@ src_unpack() { |
39 |
src_prepare() { |
40 |
cmake-utils_src_prepare |
41 |
|
42 |
+ # sys/ustat.h removed in glibc 2.28 |
43 |
+ # https://bugs.gentoo.org/675654 |
44 |
+ eapply "${FILESDIR}"/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch |
45 |
+ |
46 |
if use test; then |
47 |
# remove tests that are broken by new glibc |
48 |
# (disabled in 6.0.0+, r313069) |
49 |
|
50 |
diff --git a/sys-libs/compiler-rt-sanitizers/files/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch b/sys-libs/compiler-rt-sanitizers/files/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch |
51 |
new file mode 100644 |
52 |
index 00000000000..5a9aa2327b8 |
53 |
--- /dev/null |
54 |
+++ b/sys-libs/compiler-rt-sanitizers/files/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch |
55 |
@@ -0,0 +1,61 @@ |
56 |
+From 2e8240309f5ce36eae8f1f9dfcd8c060c040ca5c Mon Sep 17 00:00:00 2001 |
57 |
+From: Craig Topper <craig.topper@×××××.com> |
58 |
+Date: Thu, 24 May 2018 17:59:47 +0000 |
59 |
+Subject: [PATCH] sanitizer: Use pre-computed size of struct ustat for Linux |
60 |
+ |
61 |
+<sys/ustat.h> has been removed from glibc 2.28 by: |
62 |
+ |
63 |
+commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7 |
64 |
+Author: Adhemerval Zanella <adhemerval.zanella@××××××.org> |
65 |
+Date: Sun Mar 18 11:28:59 2018 +0800 |
66 |
+ |
67 |
+Deprecate ustat syscall interface |
68 |
+This patch uses pre-computed size of struct ustat for Linux to fix |
69 |
+ |
70 |
+https://bugs.llvm.org/show_bug.cgi?id=37418 |
71 |
+ |
72 |
+Patch by H.J. Lu. |
73 |
+ |
74 |
+Differential Revision: https://reviews.llvm.org/D47281 |
75 |
+ |
76 |
+git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333213 91177308-0d34-0410-b5e6-96231b3b80d8 |
77 |
+--- |
78 |
+ .../sanitizer_platform_limits_posix.cc | 15 +++++++++++++-- |
79 |
+ 1 file changed, 13 insertions(+), 2 deletions(-) |
80 |
+ |
81 |
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc |
82 |
+index 83f4fd22f..804abd9e4 100644 |
83 |
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc |
84 |
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc |
85 |
+@@ -159,7 +159,6 @@ typedef struct user_fpregs elf_fpregset_t; |
86 |
+ # include <sys/procfs.h> |
87 |
+ #endif |
88 |
+ #include <sys/user.h> |
89 |
+-#include <sys/ustat.h> |
90 |
+ #include <linux/cyclades.h> |
91 |
+ #include <linux/if_eql.h> |
92 |
+ #include <linux/if_plip.h> |
93 |
+@@ -252,7 +251,19 @@ namespace __sanitizer { |
94 |
+ #endif // SANITIZER_LINUX || SANITIZER_FREEBSD |
95 |
+ |
96 |
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID |
97 |
+- unsigned struct_ustat_sz = sizeof(struct ustat); |
98 |
++ // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which |
99 |
++ // has been removed from glibc 2.28. |
100 |
++#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \ |
101 |
++ || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \ |
102 |
++ || defined(__x86_64__) |
103 |
++#define SIZEOF_STRUCT_USTAT 32 |
104 |
++#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \ |
105 |
++ || defined(__powerpc__) || defined(__s390__) |
106 |
++#define SIZEOF_STRUCT_USTAT 20 |
107 |
++#else |
108 |
++#error Unknown size of struct ustat |
109 |
++#endif |
110 |
++ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT; |
111 |
+ unsigned struct_rlimit64_sz = sizeof(struct rlimit64); |
112 |
+ unsigned struct_statvfs64_sz = sizeof(struct statvfs64); |
113 |
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID |
114 |
+-- |
115 |
+2.20.1 |
116 |
+ |