Brad Bishop | 0011132 | 2018-04-01 22:23:53 -0400 | [diff] [blame] | 1 | From 0fa7102d76376b27ae4bbc10848600aac6ed71d2 Mon Sep 17 00:00:00 2001 |
| 2 | From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> |
| 3 | Date: Mon, 17 Jul 2017 19:41:08 +0000 |
| 4 | Subject: [PATCH] Backported from mainline 2017-07-14 Jakub |
| 5 | Jelinek <jakub@redhat.com> |
| 6 | |
| 7 | PR sanitizer/81066 |
| 8 | * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969. |
| 9 | * sanitizer_common/sanitizer_linux.cc: Likewise. |
| 10 | * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise. |
| 11 | * tsan/tsan_platform_linux.cc: Likewise. |
| 12 | |
| 13 | [Romain cherry-pick on gcc-6-branch from gcc-7-branch] |
| 14 | Signed-off-by: Romain Naour <romain.naour@gmail.com> |
| 15 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@250287 138bc75d-0d04-0410-961f-82ee72b054a4 |
| 16 | |
| 17 | Upstream-Status: Backport |
| 18 | |
| 19 | Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> |
| 20 | --- |
| 21 | libsanitizer/sanitizer_common/sanitizer_linux.cc | 3 +-- |
| 22 | libsanitizer/sanitizer_common/sanitizer_linux.h | 4 +--- |
| 23 | libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +- |
| 24 | libsanitizer/tsan/tsan_platform_linux.cc | 2 +- |
| 25 | 4 files changed, 4 insertions(+), 7 deletions(-) |
| 26 | |
| 27 | diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc |
| 28 | index 2cefa20..223d9c6 100644 |
| 29 | --- a/libsanitizer/sanitizer_common/sanitizer_linux.cc |
| 30 | +++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc |
| 31 | @@ -546,8 +546,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) { |
| 32 | } |
| 33 | #endif |
| 34 | |
| 35 | -uptr internal_sigaltstack(const struct sigaltstack *ss, |
| 36 | - struct sigaltstack *oss) { |
| 37 | +uptr internal_sigaltstack(const void *ss, void *oss) { |
| 38 | return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); |
| 39 | } |
| 40 | |
| 41 | diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h |
| 42 | index 4497702..1594058 100644 |
| 43 | --- a/libsanitizer/sanitizer_common/sanitizer_linux.h |
| 44 | +++ b/libsanitizer/sanitizer_common/sanitizer_linux.h |
| 45 | @@ -19,7 +19,6 @@ |
| 46 | #include "sanitizer_platform_limits_posix.h" |
| 47 | |
| 48 | struct link_map; // Opaque type returned by dlopen(). |
| 49 | -struct sigaltstack; |
| 50 | |
| 51 | namespace __sanitizer { |
| 52 | // Dirent structure for getdents(). Note that this structure is different from |
| 53 | @@ -28,8 +27,7 @@ struct linux_dirent; |
| 54 | |
| 55 | // Syscall wrappers. |
| 56 | uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); |
| 57 | -uptr internal_sigaltstack(const struct sigaltstack* ss, |
| 58 | - struct sigaltstack* oss); |
| 59 | +uptr internal_sigaltstack(const void* ss, void* oss); |
| 60 | uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, |
| 61 | __sanitizer_sigset_t *oldset); |
| 62 | void internal_sigfillset(__sanitizer_sigset_t *set); |
| 63 | diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc |
| 64 | index c919e4f..014162af 100644 |
| 65 | --- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc |
| 66 | +++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc |
| 67 | @@ -267,7 +267,7 @@ static int TracerThread(void* argument) { |
| 68 | |
| 69 | // Alternate stack for signal handling. |
| 70 | InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize); |
| 71 | - struct sigaltstack handler_stack; |
| 72 | + stack_t handler_stack; |
| 73 | internal_memset(&handler_stack, 0, sizeof(handler_stack)); |
| 74 | handler_stack.ss_sp = handler_stack_memory.data(); |
| 75 | handler_stack.ss_size = kHandlerStackSize; |
| 76 | diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc |
| 77 | index 09cec5f..908f4fe 100644 |
| 78 | --- a/libsanitizer/tsan/tsan_platform_linux.cc |
| 79 | +++ b/libsanitizer/tsan/tsan_platform_linux.cc |
| 80 | @@ -291,7 +291,7 @@ bool IsGlobalVar(uptr addr) { |
| 81 | int ExtractResolvFDs(void *state, int *fds, int nfd) { |
| 82 | #if SANITIZER_LINUX |
| 83 | int cnt = 0; |
| 84 | - __res_state *statp = (__res_state*)state; |
| 85 | + struct __res_state *statp = (struct __res_state*)state; |
| 86 | for (int i = 0; i < MAXNS && cnt < nfd; i++) { |
| 87 | if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) |
| 88 | fds[cnt++] = statp->_u._ext.nssocks[i]; |
| 89 | -- |
| 90 | 2.9.4 |