[compiler-rt] removed memory access callback from asan interface for darwin
authorEmily Shi <yue_shi2@apple.com>
Thu, 16 Dec 2021 21:02:47 +0000 (13:02 -0800)
committerEmily Shi <code@emi.sh>
Thu, 16 Dec 2021 21:03:47 +0000 (13:03 -0800)
These symbols were introduced in https://reviews.llvm.org/D114558 but were not properly guarded for mac which caused downstream CI failures

Reviewed By: kubamracek, yln

Differential Revision: https://reviews.llvm.org/D115837

compiler-rt/lib/asan/asan_interface.inc
compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp

index d849997..54ddfe5 100644 (file)
@@ -181,8 +181,7 @@ INTERFACE_WEAK_FUNCTION(__asan_default_options)
 INTERFACE_WEAK_FUNCTION(__asan_default_suppressions)
 INTERFACE_WEAK_FUNCTION(__asan_on_error)
 
-#if defined(__x86_64__) && \
-    !(defined(SANITIZER_MAC) || defined(SANITIZER_WINDOWS))
+#if defined(__x86_64__) && !defined(__APPLE__) && !defined(SANITIZER_WINDOWS)
 
 #  define ASAN_MEMORY_ACCESS_CALLBACK_ADD(s, reg, op) \
     INTERFACE_FUNCTION(__asan_check_##op##_add_##s##_##reg)
index a8e2bcb..c4c40ca 100644 (file)
@@ -2,6 +2,10 @@
 // If you're changing this file, please also change
 // ../Linux/interface_symbols.c
 
+// This is needed to run the preprocessor to exclude symbols guarded by platform
+// RUN: %clangxx -x c++-header -o - -E %p/../../../../lib/asan/asan_interface.inc  \
+// RUN:  | sed "s/INTERFACE_FUNCTION/\nINTERFACE_FUNCTION/g" >  %t.asan_interface.inc
+
 // RUN: %clangxx_asan -dead_strip -O2 %s -o %t.exe
 //
 // note: we can not use -D on Darwin.
@@ -16,7 +20,7 @@
 // RUN:  > %t.exports
 //
 // RUN: grep -e "INTERFACE_\(WEAK_\)\?FUNCTION"                                \
-// RUN:  %p/../../../../lib/asan/asan_interface.inc                            \
+// RUN:  %t.asan_interface.inc                                                 \
 // RUN:  %p/../../../../lib/ubsan/ubsan_interface.inc                          \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc    \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_common_interface_posix.inc \