Skip to content

Commit f2d74ad

Browse files
committed
[UBSan] Disable -fsanitize=function for arm64e.
The function sanitizer broke for arm64e after ad31a2d. We are disabling it temporarily for arm64e until a fix has been decided. rdar://110075232
1 parent 7af2982 commit f2d74ad

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3444,6 +3444,8 @@ SanitizerMask Darwin::getSupportedSanitizers() const {
34443444
Res |= SanitizerKind::FuzzerNoLink;
34453445
Res |= SanitizerKind::ObjCCast;
34463446

3447+
if (getTriple().isArm64e())
3448+
Res &= ~SanitizerKind::Function;
34473449
// Apple-Clang: Don't support LSan. rdar://problem/45841334
34483450
Res &= ~SanitizerKind::Leak;
34493451

compiler-rt/test/ubsan/TestCases/TypeCheck/Function/c.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clang -g -fsanitize=function %s -o %t
22
// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --implicit-check-not='runtime error:'
3+
// XFAIL: arm64e-target-arch
34

45
void f(void (*fp)(int (*)[])) { fp(0); }
56

compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK
44
// Verify that we can disable symbolization if needed:
55
// RUN: %env_ubsan_opts=symbolize=0 %run %t 2>&1 | FileCheck %s --check-prefix=NOSYM
6+
// XFAIL: arm64e-target-arch
67

78
struct Shared {};
89
using FnShared = void (*)(Shared *);

0 commit comments

Comments
 (0)