From bb9c116165644db4f61b6cca67af050dda91f838 Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Mon, 5 Oct 2015 12:43:47 +0000 Subject: [PATCH] [asan][mips] Fix ABI incompatibility crash in pthread_create() following r248325. Like i386, Mips needs a versioned interceptor but must select GLIBC_2.2. llvm-svn: 249307 --- compiler-rt/lib/asan/asan_interceptors.cc | 2 ++ compiler-rt/test/asan/TestCases/Linux/pthread_create_version.cc | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/asan/asan_interceptors.cc b/compiler-rt/lib/asan/asan_interceptors.cc index 5a7a91b8f948..86879e424aea 100644 --- a/compiler-rt/lib/asan/asan_interceptors.cc +++ b/compiler-rt/lib/asan/asan_interceptors.cc @@ -29,6 +29,8 @@ #if defined(__i386) && SANITIZER_LINUX #define ASAN_PTHREAD_CREATE_VERSION "GLIBC_2.1" +#elif defined(__mips__) && SANITIZER_LINUX +#define ASAN_PTHREAD_CREATE_VERSION "GLIBC_2.2" #endif namespace __asan { diff --git a/compiler-rt/test/asan/TestCases/Linux/pthread_create_version.cc b/compiler-rt/test/asan/TestCases/Linux/pthread_create_version.cc index 394e3df222e9..efdb8ca97c4f 100644 --- a/compiler-rt/test/asan/TestCases/Linux/pthread_create_version.cc +++ b/compiler-rt/test/asan/TestCases/Linux/pthread_create_version.cc @@ -3,7 +3,6 @@ // pthread_attr_init is not intercepted and binds to the new abi // pthread_create is intercepted; dlsym always returns the oldest version. // This results in a crash inside pthread_create in libc. -// UNSUPPORTED: mips #include #include