--- gcc-4.9.4.old/libsanitizer/sanitizer_common/sanitizer_linux.cc +++ gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_linux.cc @@ -599,8 +599,7 @@ return internal_syscall(__NR_prctl, option, arg2, arg3, arg4, arg5); } -uptr internal_sigaltstack(const struct sigaltstack *ss, - struct sigaltstack *oss) { +uptr internal_sigaltstack (const stack_t *ss, stack_t *oss) { return internal_syscall(__NR_sigaltstack, (uptr)ss, (uptr)oss); } --- gcc-4.9.4.old/libsanitizer/sanitizer_common/sanitizer_linux.h +++ gcc-4.9.4/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; @@ -28,8 +29,9 @@ // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5); -uptr internal_sigaltstack(const struct sigaltstack* ss, - struct sigaltstack* oss); + +uptr internal_sigaltstack (const stack_t *ss, stack_t *oss); + uptr internal_sigaction(int signum, const __sanitizer_kernel_sigaction_t *act, __sanitizer_kernel_sigaction_t *oldact); uptr internal_sigprocmask(int how, __sanitizer_kernel_sigset_t *set, --- gcc-4.9.4.old/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +++ gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc @@ -238,7 +238,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-4.9.4.old/libsanitizer/tsan/tsan_platform_linux.cc +++ gcc-4.9.4/libsanitizer/tsan/tsan_platform_linux.cc @@ -42,7 +42,10 @@ #include #include #define __need_res_state -#include + +#include +// #include "bits/types/res_state.h" + #include #ifdef sa_handler @@ -351,7 +354,13 @@ // closes within glibc. The code is a pure hack. int ExtractResolvFDs(void *state, int *fds, int nfd) { 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];