--- gcc-5.3.0.old/libsanitizer/sanitizer_common/sanitizer_linux.cc +++ gcc-5.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cc @@ -514,8 +514,7 @@ } #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); } --- gcc-5.3.0.old/libsanitizer/sanitizer_common/sanitizer_linux.h +++ gcc-5.3.0/libsanitizer/sanitizer_common/sanitizer_linux.h @@ -16,6 +16,7 @@ #include "sanitizer_common.h" #include "sanitizer_internal_defs.h" #include "sanitizer_platform_limits_posix.h" +#include "bits/types/stack_t.h" struct link_map; // Opaque type returned by dlopen(). struct sigaltstack; @@ -27,8 +28,7 @@ // 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_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); void internal_sigfillset(__sanitizer_sigset_t *set); --- gcc-5.3.0.old/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +++ gcc-5.3.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc @@ -234,7 +234,7 @@ // Alternate stack for signal handling. InternalScopedBuffer 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; --- gcc-5.3.0.old/libsanitizer/tsan/tsan_platform_linux.cc +++ gcc-5.3.0/libsanitizer/tsan/tsan_platform_linux.cc @@ -377,7 +377,13 @@ int ExtractResolvFDs(void *state, int *fds, int nfd) { #if SANITIZER_LINUX int cnt = 0; - __res_state *statp = (__res_state*)state; + +#ifdef NOTDEF + __res_state *statp = (__res_state*) state; +#else + struct __res_state *statp = (struct __res_state*) state; +#endif + 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];