File tree Expand file tree Collapse file tree 4 files changed +13
-9
lines changed
test/Transforms/SafeStack/AArch64 Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -481,9 +481,11 @@ SanitizerMask Fuchsia::getSupportedSanitizers() const {
481481 Res |= SanitizerKind::Fuzzer;
482482 Res |= SanitizerKind::FuzzerNoLink;
483483 Res |= SanitizerKind::Leak;
484- Res |= SanitizerKind::SafeStack;
485484 Res |= SanitizerKind::Scudo;
486485 Res |= SanitizerKind::Thread;
486+ if (getTriple ().getArch () == llvm::Triple::x86_64) {
487+ Res |= SanitizerKind::SafeStack;
488+ }
487489 return Res;
488490}
489491
Original file line number Diff line number Diff line change 312312// RUN: | FileCheck %s -check-prefix=CHECK-NOSTDLIB-NOLIBC
313313// CHECK-NOSTDLIB-NOLIBC-NOT: "warning:"
314314// CHECK-NOSTDLIB-NOLIBC-NOT: "error:"
315+
316+ // RUN: not %clang -### %s --target=aarch64-unknown-fuchsia \
317+ // RUN: -fsanitize=safe-stack 2>&1 \
318+ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
319+ // RUN: | FileCheck %s -check-prefix=CHECK-NONX86-SAFESTACK
320+ // RUN: not %clang -### %s --target=riscv64-unknown-fuchsia \
321+ // RUN: -fsanitize=safe-stack 2>&1 \
322+ // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
323+ // RUN: | FileCheck %s -check-prefix=CHECK-NONX86-SAFESTACK
324+ // CHECK-NONX86-SAFESTACK: error: unsupported option '-fsanitize=safe-stack' for target '{{.*}}'
Original file line number Diff line number Diff line change @@ -29521,11 +29521,6 @@ AArch64TargetLowering::getSafeStackPointerLocation(IRBuilderBase &IRB) const {
2952129521 if (Subtarget->isTargetAndroid())
2952229522 return UseTlsOffset(IRB, 0x48);
2952329523
29524- // Fuchsia is similar.
29525- // <zircon/tls.h> defines ZX_TLS_UNSAFE_SP_OFFSET with this value.
29526- if (Subtarget->isTargetFuchsia())
29527- return UseTlsOffset(IRB, -0x8);
29528-
2952929524 return TargetLowering::getSafeStackPointerLocation(IRB);
2953029525}
2953129526
Original file line number Diff line number Diff line change 11; RUN: opt -safe-stack -S -mtriple=aarch64-linux-android < %s -o - | FileCheck --check-prefixes=TLS,ANDROID %s
2- ; RUN: opt -safe-stack -S -mtriple=aarch64-unknown-fuchsia < %s -o - | FileCheck --check-prefixes=TLS,FUCHSIA %s
32; RUN: opt -passes=safe-stack -S -mtriple=aarch64-linux-android < %s -o - | FileCheck --check-prefixes=TLS,ANDROID %s
4- ; RUN: opt -passes=safe-stack -S -mtriple=aarch64-unknown-fuchsia < %s -o - | FileCheck --check-prefixes=TLS,FUCHSIA %s
53
64define void @foo () nounwind uwtable safestack sspreq {
75entry:
108
119; TLS: %[[TP2:.*]] = call ptr @llvm.thread.pointer.p0()
1210; ANDROID: %[[B:.*]] = getelementptr i8, ptr %[[TP2]], i32 40
13- ; FUCHSIA: %[[B:.*]] = getelementptr i8, ptr %[[TP2]], i32 -16
1411; TLS: %[[StackGuard:.*]] = load ptr, ptr %[[B]]
1512; TLS: store ptr %[[StackGuard]], ptr %[[StackGuardSlot:.*]]
1613 %a = alloca i128 , align 16
You can’t perform that action at this time.
0 commit comments