summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-09-09 09:56:30 -0400
committerKhem Raj <raj.khem@gmail.com>2018-09-09 07:44:27 -0700
commit9a0bd29eac2be5f88e3e198929181d3591dd7ec7 (patch)
tree9de043a62ef2596662b97db0aa1b69a8757968be /recipes-devtools
parent221dd5305327402d06276f6458c3f7a70b59a737 (diff)
downloadmeta-clang-9a0bd29eac2be5f88e3e198929181d3591dd7ec7.tar.gz
compiler-rt: Use pre-computed size of struct ustat for Linux
<sys/ustat.h> has been removed from glibc 2.28 by: commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7 author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Sun Mar 18 11:28:59 2018 +0800 Deprecate ustat syscall interface This patch uses pre-computed size of struct ustat for Linux to fix https://bugs.llvm.org/show_bug.cgi?id=37418 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/clang/compiler-rt/0005-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch64
-rw-r--r--recipes-devtools/clang/compiler-rt_git.bb1
2 files changed, 65 insertions, 0 deletions
diff --git a/recipes-devtools/clang/compiler-rt/0005-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch b/recipes-devtools/clang/compiler-rt/0005-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch
new file mode 100644
index 0000000..fa15d82
--- /dev/null
+++ b/recipes-devtools/clang/compiler-rt/0005-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch
@@ -0,0 +1,64 @@
1From 411c94c71d9569e8b9fa67b52987f19aded1ca15 Mon Sep 17 00:00:00 2001
2From: Craig Topper <craig.topper@intel.com>
3Date: Thu, 24 May 2018 17:59:47 +0000
4Subject: [PATCH] sanitizer: Use pre-computed size of struct ustat for Linux
5
6<sys/ustat.h> has been removed from glibc 2.28 by:
7
8commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7
9Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
10Date: Sun Mar 18 11:28:59 2018 +0800
11
12Deprecate ustat syscall interface
13This patch uses pre-computed size of struct ustat for Linux to fix
14
15https://bugs.llvm.org/show_bug.cgi?id=37418
16
17Patch by H.J. Lu.
18
19Differential Revision: https://reviews.llvm.org/D47281
20
21git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333213 91177308-0d34-0410-b5e6-96231b3b80d8
22Upstream-Status: Backport [git://github.com/llvm-mirror/compiler-rt.git]
23
24Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
25---
26 lib/sanitizer_common/sanitizer_platform_limits_posix.cc | 15 +++++++++++++--
27 1 file changed, 13 insertions(+), 2 deletions(-)
28
29diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
30index f12e820..feb7bad 100644
31--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
32+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
33@@ -159,7 +159,6 @@ typedef struct user_fpregs elf_fpregset_t;
34 # include <sys/procfs.h>
35 #endif
36 #include <sys/user.h>
37-#include <sys/ustat.h>
38 #include <linux/cyclades.h>
39 #include <linux/if_eql.h>
40 #include <linux/if_plip.h>
41@@ -253,7 +252,19 @@ namespace __sanitizer {
42 #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
43
44 #if SANITIZER_LINUX && !SANITIZER_ANDROID
45- unsigned struct_ustat_sz = sizeof(struct ustat);
46+ // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
47+ // has been removed from glibc 2.28.
48+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
49+ || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
50+ || defined(__x86_64__)
51+#define SIZEOF_STRUCT_USTAT 32
52+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
53+ || defined(__powerpc__) || defined(__s390__)
54+#define SIZEOF_STRUCT_USTAT 20
55+#else
56+#error Unknown size of struct ustat
57+#endif
58+ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
59 unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
60 unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
61 #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
62--
632.8.1
64
diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb
index 546575e..31e705a 100644
--- a/recipes-devtools/clang/compiler-rt_git.bb
+++ b/recipes-devtools/clang/compiler-rt_git.bb
@@ -20,6 +20,7 @@ SRC_URI = "\
20 file://0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch \ 20 file://0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch \
21 file://0003-Disable-tsan-on-OE-glibc.patch \ 21 file://0003-Disable-tsan-on-OE-glibc.patch \
22 file://0004-cmake-mips-Do-not-specify-target-with-OE.patch \ 22 file://0004-cmake-mips-Do-not-specify-target-with-OE.patch \
23 file://0005-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch \
23" 24"
24 25
25SRCREV_FORMAT = "compiler-rt" 26SRCREV_FORMAT = "compiler-rt"