From 87f2328fb271ee34d5102cfdb6d66f97fd5188bd Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 11 Jul 2017 09:02:33 -0700 Subject: gcc-7.1: Update the libsanitize stack_t patch to upstreamed version (From OE-Core rev: 979888c39684097086353dfd39eac60c4a66f776) Signed-off-by: Khem Raj Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- ...r-Use-stack_t-instead-of-struct-sigaltsta.patch | 135 +++++---------------- 1 file changed, 28 insertions(+), 107 deletions(-) (limited to 'meta/recipes-devtools/gcc') 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 Date: Sun, 11 Jun 2017 10:09:13 -0700 Subject: [PATCH] libsanitizer: Use stack_t instead of struct sigaltstack +https://reviews.llvm.org/D35246 + Upstream-Status: Submitted Signed-off-by: Khem Raj @@ -12,83 +14,49 @@ Signed-off-by: Khem Raj .../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) -Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc -=================================================================== ---- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_linux.cc -+++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc -@@ -14,6 +14,10 @@ - - #if SANITIZER_FREEBSD || SANITIZER_LINUX - -+#if !SANITIZER_ANDROID -+#include -+#endif -+ - #include "sanitizer_common.h" - #include "sanitizer_flags.h" - #include "sanitizer_internal_defs.h" -@@ -71,10 +75,6 @@ extern "C" { - extern char **environ; // provided by crt1 - #endif // SANITIZER_FREEBSD - --#if !SANITIZER_ANDROID --#include --#endif -- - #if SANITIZER_LINUX - // - struct kernel_timeval { -@@ -605,8 +605,8 @@ uptr internal_prctl(int option, uptr arg - } - #endif - --uptr internal_sigaltstack(const struct sigaltstack *ss, -- struct sigaltstack *oss) { -+uptr internal_sigaltstack(const stack_t *ss, -+ stack_t *oss) { - return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); - } - + Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.h =================================================================== ---- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_linux.h +--- gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.h +++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.h -@@ -19,7 +19,10 @@ +@@ -21,17 +21,15 @@ #include "sanitizer_platform_limits_posix.h" struct link_map; // Opaque type returned by dlopen(). -struct sigaltstack; -+ -+#ifndef __stack_t_defined -+struct stack_t; -+#endif namespace __sanitizer { // Dirent structure for getdents(). Note that this structure is different from -@@ -28,8 +31,8 @@ struct linux_dirent; + // the one in , which is used by readdir(). + struct linux_dirent; // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); -uptr internal_sigaltstack(const struct sigaltstack* ss, - struct sigaltstack* oss); -+uptr internal_sigaltstack(const stack_t* ss, -+ stack_t* oss); ++uptr internal_sigaltstack(const void* ss, void* oss); uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); -Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc =================================================================== ---- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc -+++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc -@@ -16,6 +16,7 @@ - defined(__aarch64__) || defined(__powerpc64__) || \ - defined(__s390__)) +--- gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc ++++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux.cc +@@ -631,8 +631,7 @@ + } + #endif -+#include - #include "sanitizer_stoptheworld.h" +-uptr internal_sigaltstack(const struct sigaltstack *ss, +- struct sigaltstack *oss) { ++uptr internal_sigaltstack(const void *ss, void *oss) { + return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); + } - #include "sanitizer_platform_limits_posix.h" -@@ -273,7 +274,7 @@ static int TracerThread(void* argument) +Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +=================================================================== +--- gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc ++++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +@@ -287,7 +287,7 @@ // Alternate stack for signal handling. InternalScopedBuffer handler_stack_memory(kHandlerStackSize); @@ -99,62 +67,15 @@ Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libc handler_stack.ss_size = kHandlerStackSize; Index: gcc-7.1.0/libsanitizer/tsan/tsan_platform_linux.cc =================================================================== ---- gcc-7.1.0.orig/libsanitizer/tsan/tsan_platform_linux.cc +--- gcc-7.1.0/libsanitizer/tsan/tsan_platform_linux.cc +++ gcc-7.1.0/libsanitizer/tsan/tsan_platform_linux.cc -@@ -14,6 +14,7 @@ - #include "sanitizer_common/sanitizer_platform.h" - #if SANITIZER_LINUX || SANITIZER_FREEBSD - -+#include - #include "sanitizer_common/sanitizer_common.h" - #include "sanitizer_common/sanitizer_libc.h" - #include "sanitizer_common/sanitizer_linux.h" -@@ -28,7 +29,6 @@ - - #include - #include --#include - #include - #include - #include -@@ -287,7 +287,7 @@ void InitializePlatform() { +@@ -288,7 +288,7 @@ int ExtractResolvFDs(void *state, int *fds, int nfd) { #if SANITIZER_LINUX && !SANITIZER_ANDROID int cnt = 0; - __res_state *statp = (__res_state*)state; -+ res_state statp = (res_state)state; ++ struct __res_state *statp = (struct __res_state*)state; for (int i = 0; i < MAXNS && cnt < nfd; i++) { if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) fds[cnt++] = statp->_u._ext.nssocks[i]; -Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc -=================================================================== ---- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc -+++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc -@@ -14,6 +14,7 @@ - - #if SANITIZER_FREEBSD || SANITIZER_LINUX - -+#include - #include "sanitizer_allocator_internal.h" - #include "sanitizer_atomic.h" - #include "sanitizer_common.h" -@@ -30,7 +31,6 @@ - - #include - #include --#include - #include - #include - -Index: gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -=================================================================== ---- gcc-7.1.0.orig/libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -+++ gcc-7.1.0/libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -@@ -12,6 +12,7 @@ - - #include "sanitizer_platform.h" - #if SANITIZER_POSIX -+#include - #include "sanitizer_allocator_internal.h" - #include "sanitizer_common.h" - #include "sanitizer_flags.h" + -- cgit v1.2.3-54-g00ecf