diff options
Diffstat (limited to 'compiler-rt/lib/interception/interception_linux.cc')
-rw-r--r-- | compiler-rt/lib/interception/interception_linux.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler-rt/lib/interception/interception_linux.cc b/compiler-rt/lib/interception/interception_linux.cc index 5299c42d625..500243a3772 100644 --- a/compiler-rt/lib/interception/interception_linux.cc +++ b/compiler-rt/lib/interception/interception_linux.cc @@ -12,19 +12,20 @@ // Linux-specific interception methods. //===----------------------------------------------------------------------===// -#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) #include "interception.h" +#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD + #include <dlfcn.h> // for dlsym() and dlvsym() -#ifdef __NetBSD__ +#if SANITIZER_NETBSD #include "sanitizer_common/sanitizer_libc.h" #endif namespace __interception { bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, uptr real, uptr wrapper) { -#ifdef __NetBSD__ +#if SANITIZER_NETBSD // XXX: Find a better way to handle renames if (internal_strcmp(func_name, "sigaction") == 0) func_name = "__sigaction14"; #endif @@ -40,12 +41,12 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, return real == wrapper; } -#if !defined(__ANDROID__) // android does not have dlvsym +#if !SANITIZER_ANDROID // android does not have dlvsym void *GetFuncAddrVer(const char *func_name, const char *ver) { return dlvsym(RTLD_NEXT, func_name, ver); } -#endif // !defined(__ANDROID__) +#endif // !SANITIZER_ANDROID } // namespace __interception -#endif // __linux__ || __FreeBSD__ || __NetBSD__ +#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD |