[PATCH] D30238: [Driver] Enable SafeStack for Fuchsia targets
Petr Hosek via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 23 19:29:27 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL296082: [Driver] Enable SafeStack for Fuchsia targets (authored by phosek).
Changed prior to commit:
https://reviews.llvm.org/D30238?vs=89393&id=89607#toc
Repository:
rL LLVM
https://reviews.llvm.org/D30238
Files:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/test/Driver/fuchsia.c
Index: cfe/trunk/test/Driver/fuchsia.c
===================================================================
--- cfe/trunk/test/Driver/fuchsia.c
+++ cfe/trunk/test/Driver/fuchsia.c
@@ -38,3 +38,8 @@
// CHECK-RELOCATABLE-NOT: "-pie"
// CHECK-RELOCATABLE-NOT: "--build-id"
// CHECK-RELOCATABLE: "-r"
+
+// RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
+// RUN: -fsanitize=safe-stack 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-SAFESTACK
+// CHECK-SAFESTACK: "-fsanitize=safe-stack"
Index: cfe/trunk/lib/Driver/ToolChains.h
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.h
+++ cfe/trunk/lib/Driver/ToolChains.h
@@ -1095,6 +1095,8 @@
return llvm::DebuggerKind::GDB;
}
+ SanitizerMask getSupportedSanitizers() const override;
+
RuntimeLibType
GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
CXXStdlibType
Index: cfe/trunk/lib/Driver/ToolChains.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -4860,6 +4860,12 @@
CmdArgs.push_back("-lunwind");
}
+SanitizerMask Fuchsia::getSupportedSanitizers() const {
+ SanitizerMask Res = ToolChain::getSupportedSanitizers();
+ Res |= SanitizerKind::SafeStack;
+ return Res;
+}
+
/// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.
DragonFly::DragonFly(const Driver &D, const llvm::Triple &Triple,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30238.89607.patch
Type: text/x-patch
Size: 1493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170224/99b43f82/attachment.bin>
More information about the cfe-commits
mailing list