diff options
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-7.1/0049-libsanitizer-Use-stack_t-instead-of-struct-sigaltsta.patch | 135 |
1 files changed, 28 insertions, 107 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.1/0049-libsanitizer-Use-stack_t-instead-of-struct-sigaltsta.patch b/meta/recipes-devtools/gcc/gcc-7.1/0049-libsanitizer-Use-stack_t-instead-of-struct-sigaltsta.patch index ee15c6cac8..165258b5d3 100644 --- a/meta/recipes-devtools/gcc/gcc-7.1/0049-libsanitizer-Use-stack_t-instead-of-struct-sigaltsta.patch +++ b/meta/recipes-devtools/gcc/gcc-7.1/0049-libsanitizer-Use-stack_t-instead-of-struct-sigaltsta.patch | |||
| @@ -3,6 +3,8 @@ From: Khem Raj <raj.khem@gmail.com> | |||
| 3 | Date: Sun, 11 Jun 2017 10:09:13 -0700 | 3 | Date: Sun, 11 Jun 2017 10:09:13 -0700 |
| 4 | Subject: [PATCH] libsanitizer: Use stack_t instead of struct sigaltstack | 4 | Subject: [PATCH] libsanitizer: Use stack_t instead of struct sigaltstack |
| 5 | 5 | ||
| 6 | https://reviews.llvm.org/D35246 | ||
| 7 | |||
| 6 | Upstream-Status: Submitted | 8 | Upstream-Status: Submitted |
| 7 | 9 | ||
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| @@ -12,83 +14,49 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
| 12 | .../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 3 ++- | 14 | .../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 3 ++- |
| 13 | 3 files changed, 7 insertions(+), 6 deletions(-) | 15 | 3 files changed, 7 insertions(+), 6 deletions(-) |
| 14 | 16 | ||
| 15 | Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc | 17 | |
| 16 | =================================================================== | ||
| 17 | --- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_linux.cc | ||
| 18 | +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc | ||
| 19 | @@ -14,6 +14,10 @@ | ||
| 20 | |||
| 21 | #if SANITIZER_FREEBSD || SANITIZER_LINUX | ||
| 22 | |||
| 23 | +#if !SANITIZER_ANDROID | ||
| 24 | +#include <sys/signal.h> | ||
| 25 | +#endif | ||
| 26 | + | ||
| 27 | #include "sanitizer_common.h" | ||
| 28 | #include "sanitizer_flags.h" | ||
| 29 | #include "sanitizer_internal_defs.h" | ||
| 30 | @@ -71,10 +75,6 @@ extern "C" { | ||
| 31 | extern char **environ; // provided by crt1 | ||
| 32 | #endif // SANITIZER_FREEBSD | ||
| 33 | |||
| 34 | -#if !SANITIZER_ANDROID | ||
| 35 | -#include <sys/signal.h> | ||
| 36 | -#endif | ||
| 37 | - | ||
| 38 | #if SANITIZER_LINUX | ||
| 39 | // <linux/time.h> | ||
| 40 | struct kernel_timeval { | ||
| 41 | @@ -605,8 +605,8 @@ uptr internal_prctl(int option, uptr arg | ||
| 42 | } | ||
| 43 | #endif | ||
| 44 | |||
| 45 | -uptr internal_sigaltstack(const struct sigaltstack *ss, | ||
| 46 | - struct sigaltstack *oss) { | ||
| 47 | +uptr internal_sigaltstack(const stack_t *ss, | ||
| 48 | + stack_t *oss) { | ||
| 49 | return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); | ||
| 50 | } | ||
| 51 | |||
| 52 | Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.h | 18 | Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.h |
| 53 | =================================================================== | 19 | =================================================================== |
| 54 | --- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_linux.h | 20 | --- gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.h |
| 55 | +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.h | 21 | +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.h |
| 56 | @@ -19,7 +19,10 @@ | 22 | @@ -21,17 +21,15 @@ |
| 57 | #include "sanitizer_platform_limits_posix.h" | 23 | #include "sanitizer_platform_limits_posix.h" |
| 58 | 24 | ||
| 59 | struct link_map; // Opaque type returned by dlopen(). | 25 | struct link_map; // Opaque type returned by dlopen(). |
| 60 | -struct sigaltstack; | 26 | -struct sigaltstack; |
| 61 | + | ||
| 62 | +#ifndef __stack_t_defined | ||
| 63 | +struct stack_t; | ||
| 64 | +#endif | ||
| 65 | 27 | ||
| 66 | namespace __sanitizer { | 28 | namespace __sanitizer { |
| 67 | // Dirent structure for getdents(). Note that this structure is different from | 29 | // Dirent structure for getdents(). Note that this structure is different from |
| 68 | @@ -28,8 +31,8 @@ struct linux_dirent; | 30 | // the one in <dirent.h>, which is used by readdir(). |
| 31 | struct linux_dirent; | ||
| 69 | 32 | ||
| 70 | // Syscall wrappers. | 33 | // Syscall wrappers. |
| 71 | uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); | 34 | uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); |
| 72 | -uptr internal_sigaltstack(const struct sigaltstack* ss, | 35 | -uptr internal_sigaltstack(const struct sigaltstack* ss, |
| 73 | - struct sigaltstack* oss); | 36 | - struct sigaltstack* oss); |
| 74 | +uptr internal_sigaltstack(const stack_t* ss, | 37 | +uptr internal_sigaltstack(const void* ss, void* oss); |
| 75 | + stack_t* oss); | ||
| 76 | uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, | 38 | uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, |
| 77 | __sanitizer_sigset_t *oldset); | 39 | __sanitizer_sigset_t *oldset); |
| 78 | 40 | ||
| 79 | Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 41 | Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc |
| 80 | =================================================================== | 42 | =================================================================== |
| 81 | --- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 43 | --- gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc |
| 82 | +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 44 | +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc |
| 83 | @@ -16,6 +16,7 @@ | 45 | @@ -631,8 +631,7 @@ |
| 84 | defined(__aarch64__) || defined(__powerpc64__) || \ | 46 | } |
| 85 | defined(__s390__)) | 47 | #endif |
| 86 | 48 | ||
| 87 | +#include <signal.h> | 49 | -uptr internal_sigaltstack(const struct sigaltstack *ss, |
| 88 | #include "sanitizer_stoptheworld.h" | 50 | - struct sigaltstack *oss) { |
| 51 | +uptr internal_sigaltstack(const void *ss, void *oss) { | ||
| 52 | return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); | ||
| 53 | } | ||
| 89 | 54 | ||
| 90 | #include "sanitizer_platform_limits_posix.h" | 55 | Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc |
| 91 | @@ -273,7 +274,7 @@ static int TracerThread(void* argument) | 56 | =================================================================== |
| 57 | --- gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | ||
| 58 | +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | ||
| 59 | @@ -287,7 +287,7 @@ | ||
| 92 | 60 | ||
| 93 | // Alternate stack for signal handling. | 61 | // Alternate stack for signal handling. |
| 94 | InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize); | 62 | InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize); |
| @@ -99,62 +67,15 @@ Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libc | |||
| 99 | handler_stack.ss_size = kHandlerStackSize; | 67 | handler_stack.ss_size = kHandlerStackSize; |
| 100 | Index: gcc-7.1.0/libsanitizer/tsan/tsan_platform_linux.cc | 68 | Index: gcc-7.1.0/libsanitizer/tsan/tsan_platform_linux.cc |
| 101 | =================================================================== | 69 | =================================================================== |
| 102 | --- gcc-7.1.0.orig/libsanitizer/tsan/tsan_platform_linux.cc | 70 | --- gcc-7.1.0/libsanitizer/tsan/tsan_platform_linux.cc |
| 103 | +++ gcc-7.1.0/libsanitizer/tsan/tsan_platform_linux.cc | 71 | +++ gcc-7.1.0/libsanitizer/tsan/tsan_platform_linux.cc |
| 104 | @@ -14,6 +14,7 @@ | 72 | @@ -288,7 +288,7 @@ |
| 105 | #include "sanitizer_common/sanitizer_platform.h" | ||
| 106 | #if SANITIZER_LINUX || SANITIZER_FREEBSD | ||
| 107 | |||
| 108 | +#include <signal.h> | ||
| 109 | #include "sanitizer_common/sanitizer_common.h" | ||
| 110 | #include "sanitizer_common/sanitizer_libc.h" | ||
| 111 | #include "sanitizer_common/sanitizer_linux.h" | ||
| 112 | @@ -28,7 +29,6 @@ | ||
| 113 | |||
| 114 | #include <fcntl.h> | ||
| 115 | #include <pthread.h> | ||
| 116 | -#include <signal.h> | ||
| 117 | #include <stdio.h> | ||
| 118 | #include <stdlib.h> | ||
| 119 | #include <string.h> | ||
| 120 | @@ -287,7 +287,7 @@ void InitializePlatform() { | ||
| 121 | int ExtractResolvFDs(void *state, int *fds, int nfd) { | 73 | int ExtractResolvFDs(void *state, int *fds, int nfd) { |
| 122 | #if SANITIZER_LINUX && !SANITIZER_ANDROID | 74 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
| 123 | int cnt = 0; | 75 | int cnt = 0; |
| 124 | - __res_state *statp = (__res_state*)state; | 76 | - __res_state *statp = (__res_state*)state; |
| 125 | + res_state statp = (res_state)state; | 77 | + struct __res_state *statp = (struct __res_state*)state; |
| 126 | for (int i = 0; i < MAXNS && cnt < nfd; i++) { | 78 | for (int i = 0; i < MAXNS && cnt < nfd; i++) { |
| 127 | if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) | 79 | if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) |
| 128 | fds[cnt++] = statp->_u._ext.nssocks[i]; | 80 | fds[cnt++] = statp->_u._ext.nssocks[i]; |
| 129 | Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc | 81 | |
| 130 | =================================================================== | ||
| 131 | --- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc | ||
| 132 | +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc | ||
| 133 | @@ -14,6 +14,7 @@ | ||
| 134 | |||
| 135 | #if SANITIZER_FREEBSD || SANITIZER_LINUX | ||
| 136 | |||
| 137 | +#include <signal.h> | ||
| 138 | #include "sanitizer_allocator_internal.h" | ||
| 139 | #include "sanitizer_atomic.h" | ||
| 140 | #include "sanitizer_common.h" | ||
| 141 | @@ -30,7 +31,6 @@ | ||
| 142 | |||
| 143 | #include <link.h> | ||
| 144 | #include <pthread.h> | ||
| 145 | -#include <signal.h> | ||
| 146 | #include <sys/resource.h> | ||
| 147 | #include <syslog.h> | ||
| 148 | |||
| 149 | Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc | ||
| 150 | =================================================================== | ||
| 151 | --- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc | ||
| 152 | +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc | ||
| 153 | @@ -12,6 +12,7 @@ | ||
| 154 | |||
| 155 | #include "sanitizer_platform.h" | ||
| 156 | #if SANITIZER_POSIX | ||
| 157 | +#include <signal.h> | ||
| 158 | #include "sanitizer_allocator_internal.h" | ||
| 159 | #include "sanitizer_common.h" | ||
| 160 | #include "sanitizer_flags.h" | ||
