Skip to content

Commit 7cabb54

Browse files
committed
[Darwin][StableABI][ASan] Remove version mismatch check from stable abi shim
By its nature the stable abi does not require a version check symbol. This patch sets -asan-guard-against-version-mismatch=0 for stable abi. And updates tests to reflect this rdar://114208627 Differential Revision: https://reviews.llvm.org/D158570
1 parent 6579021 commit 7cabb54

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

clang/lib/Driver/SanitizerArgs.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,8 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
12871287
CmdArgs.push_back("-asan-instrumentation-with-call-threshold=0");
12881288
CmdArgs.push_back("-mllvm");
12891289
CmdArgs.push_back("-asan-max-inline-poisoning-size=0");
1290+
CmdArgs.push_back("-mllvm");
1291+
CmdArgs.push_back("-asan-guard-against-version-mismatch=0");
12901292
}
12911293

12921294
// Only pass the option to the frontend if the user requested,

compiler-rt/lib/asan_abi/asan_abi_shim.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void __asan_init(void) {
4949

5050
__asan_abi_init();
5151
}
52-
void __asan_version_mismatch_check_v8(void) {}
52+
5353
void __asan_handle_no_return(void) { __asan_abi_handle_no_return(); }
5454

5555
// Variables concerning RTL state. These provisionally exist for completeness

compiler-rt/test/asan_abi/TestCases/Darwin/llvm_interface_symbols.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// RUN: | grep " [TU] " \
88
// RUN: | grep -o "\(__asan\)[^ ]*" \
99
// RUN: | grep -v "\(__asan_abi\)[^ ]*" \
10-
// RUN: | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \
1110
// RUN: > %t.exports
1211
// RUN: sed -e ':a' -e 'N' -e '$!ba' \
1312
// RUN: -e 's/ //g' \
@@ -17,7 +16,9 @@
1716
// RUN: | grep -v -f %p/../../../../lib/asan_abi/asan_abi_tbd.txt \
1817
// RUN: | grep -e "INTERFACE_\(WEAK_\)\?FUNCTION" \
1918
// RUN: | grep -v "__sanitizer[^ ]*" \
20-
// RUN: | sed -e "s/.*(//" -e "s/).*//" > %t.imports
19+
// RUN: | sed -e "s/.*(//" -e "s/).*//" \
20+
// RUN: | sed -e "/^__asan_version_mismatch_check/d" \
21+
// RUN: > %t.imports
2122
// RUN: sort %t.imports | uniq > %t.imports-sorted
2223
// RUN: sort %t.exports | uniq > %t.exports-sorted
2324
// RUN: diff %t.imports-sorted %t.exports-sorted

0 commit comments

Comments
 (0)