[compiler-rt] r355041 - [sanitizer] Fix compilation errors in r355030.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 27 14:23:51 PST 2019
Author: eugenis
Date: Wed Feb 27 14:23:51 2019
New Revision: 355041
URL: http://llvm.org/viewvc/llvm-project?rev=355041&view=rev
Log:
[sanitizer] Fix compilation errors in r355030.
Disable hwasan interceptor on non-linux, non-x86-or-arm platforms.
Add @plt to the asm call that clang intergrated-as infers but gcc does
not.
Modified:
compiler-rt/trunk/lib/asan/CMakeLists.txt
compiler-rt/trunk/lib/asan/asan_interceptors.cc
compiler-rt/trunk/lib/asan/asan_interceptors.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S
Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=355041&r1=355040&r2=355041&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Wed Feb 27 14:23:51 2019
@@ -32,7 +32,7 @@ set(ASAN_SOURCES
asan_thread.cc
asan_win.cc)
-if (NOT WIN32)
+if (NOT WIN32 AND NOT APPLE)
list(APPEND ASAN_SOURCES asan_interceptors_vfork.S)
endif()
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=355041&r1=355040&r2=355041&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Wed Feb 27 14:23:51 2019
@@ -579,7 +579,7 @@ INTERCEPTOR(int, __cxa_atexit, void (*fu
}
#endif // ASAN_INTERCEPT___CXA_ATEXIT
-#if defined(__linux__)
+#if ASAN_INTERCEPT_VFORK
DEFINE_REAL(int, vfork);
DECLARE_EXTERN_INTERCEPTOR_AND_WRAPPER(int, vfork);
#endif
@@ -661,7 +661,7 @@ void InitializeAsanInterceptors() {
ASAN_INTERCEPT_FUNC(__cxa_atexit);
#endif
-#if defined(__linux__)
+#if ASAN_INTERCEPT_VFORK
ASAN_INTERCEPT_FUNC(vfork);
#endif
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.h?rev=355041&r1=355040&r2=355041&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.h (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.h Wed Feb 27 14:23:51 2019
@@ -105,6 +105,13 @@ void InitializePlatformInterceptors();
# define ASAN_INTERCEPT___STRDUP 0
#endif
+#if SANITIZER_LINUX && (defined(__arm__) || defined(__aarch64__) || \
+ defined(__i386__) || defined(__x86_64__))
+# define ASAN_INTERCEPT_VFORK 1
+#else
+# define ASAN_INTERCEPT_VFORK 0
+#endif
+
DECLARE_REAL(int, memcmp, const void *a1, const void *a2, uptr size)
DECLARE_REAL(char*, strchr, const char *str, int c)
DECLARE_REAL(SIZE_T, strlen, const char *s)
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S?rev=355041&r1=355040&r2=355041&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S Wed Feb 27 14:23:51 2019
@@ -31,7 +31,7 @@ ASM_WRAPPER_NAME(vfork):
lea 16(%esp), %ecx
mov %ecx, (%esp)
- call COMMON_INTERCEPTOR_HANDLE_VFORK
+ call COMMON_INTERCEPTOR_HANDLE_VFORK at PLT
.L_exit:
mov 4(%esp), %eax
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S?rev=355041&r1=355040&r2=355041&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S Wed Feb 27 14:23:51 2019
@@ -28,7 +28,7 @@ ASM_WRAPPER_NAME(vfork):
je .L_exit
lea 16(%rsp), %rdi
- call COMMON_INTERCEPTOR_HANDLE_VFORK
+ call COMMON_INTERCEPTOR_HANDLE_VFORK at PLT
.L_exit:
pop %rax
More information about the llvm-commits
mailing list