[compiler-rt] db38527 - [compiler-rt] removed memory access callback from asan interface for darwin
Emily Shi via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 16 13:03:53 PST 2021
Author: Emily Shi
Date: 2021-12-16T13:03:47-08:00
New Revision: db38527966c89a0cabf8703f8e5927c00ff19f23
URL: https://github.com/llvm/llvm-project/commit/db38527966c89a0cabf8703f8e5927c00ff19f23
DIFF: https://github.com/llvm/llvm-project/commit/db38527966c89a0cabf8703f8e5927c00ff19f23.diff
LOG: [compiler-rt] removed memory access callback from asan interface for darwin
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
Added:
Modified:
compiler-rt/lib/asan/asan_interface.inc
compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_interface.inc b/compiler-rt/lib/asan/asan_interface.inc
index d8499974e25ec..54ddfe5a26f04 100644
--- a/compiler-rt/lib/asan/asan_interface.inc
+++ b/compiler-rt/lib/asan/asan_interface.inc
@@ -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)
diff --git a/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp b/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp
index a8e2bcb3ebc8d..c4c40ca2f7542 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp
+++ b/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp
@@ -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 \
More information about the llvm-commits
mailing list