Blob Blame History Raw
2017-07-11  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/81066
	* sanitizer_common/sanitizer_linux.cc (internal_sigaltstack): Use void
	instead of struct sigaltstack.
	* sanitizer_common/sanitizer_linux.h (internal_sigaltstack): Likewise.
	(struct sigaltstack): Remove forward declaration.
	* sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
	(TracerThread): Use stack_t instead of struct sigaltstack.
	* tsan/tsan_platform_linux.cc (ExtractResolvFDs): Use struct
	__res_state instead of just __res_state.

--- libsanitizer/sanitizer_common/sanitizer_linux.cc.jj	2016-11-09 18:26:30.000000000 +0100
+++ libsanitizer/sanitizer_common/sanitizer_linux.cc	2017-07-11 13:02:10.440483783 +0200
@@ -605,8 +605,7 @@ uptr internal_prctl(int option, uptr arg
 }
 #endif
 
-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);
 }
 
--- libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc.jj	2016-11-09 18:26:30.322873896 +0100
+++ libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc	2017-07-11 13:02:50.027011510 +0200
@@ -273,7 +273,7 @@ static int TracerThread(void* argument)
 
   // Alternate stack for signal handling.
   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
-  struct sigaltstack handler_stack;
+  stack_t handler_stack;
   internal_memset(&handler_stack, 0, sizeof(handler_stack));
   handler_stack.ss_sp = handler_stack_memory.data();
   handler_stack.ss_size = kHandlerStackSize;
--- libsanitizer/sanitizer_common/sanitizer_linux.h.jj	2016-11-09 18:26:30.000000000 +0100
+++ libsanitizer/sanitizer_common/sanitizer_linux.h	2017-07-11 13:00:23.671757549 +0200
@@ -19,7 +19,6 @@
 #include "sanitizer_platform_limits_posix.h"
 
 struct link_map;  // Opaque type returned by dlopen().
-struct sigaltstack;
 
 namespace __sanitizer {
 // Dirent structure for getdents(). Note that this structure is different from
@@ -28,8 +27,7 @@ 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 void* ss, void* oss);
 uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
     __sanitizer_sigset_t *oldset);
 
--- libsanitizer/tsan/tsan_platform_linux.cc.jj	2016-11-09 18:26:31.000000000 +0100
+++ libsanitizer/tsan/tsan_platform_linux.cc	2017-07-11 13:03:39.944415988 +0200
@@ -287,7 +287,7 @@ void InitializePlatform() {
 int ExtractResolvFDs(void *state, int *fds, int nfd) {
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
   int cnt = 0;
-  __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];