diff options
author | Rainer Orth <ro@gcc.gnu.org> | 2019-07-30 20:04:53 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2019-07-30 20:04:53 +0000 |
commit | bb669c25ba573b1ae7ac93bd6467dc9854816f5d (patch) | |
tree | b1159150b82775a23fda7fefaf2df673660157b0 /clang/lib/Driver/ToolChains/Solaris.cpp | |
parent | 42c9f3c9116c85411d8c1ad3a4bb256f44f71794 (diff) | |
download | bcm5719-llvm-bb669c25ba573b1ae7ac93bd6467dc9854816f5d.tar.gz bcm5719-llvm-bb669c25ba573b1ae7ac93bd6467dc9854816f5d.zip |
[Driver] Support -fsanitize=function on Solaris/x86
UBSan-Standalone-x86_64 :: TestCases/TypeCheck/Function/function.cpp currently
FAILs on Solaris/x86_64:
clang-9: error: unsupported option '-fsanitize=function' for target 'x86_64-pc-solaris2.11'
AFAICS, there's nothing more to do then enable that sanitizer in the driver (for x86 only),
which is what this patch does, together with updating another testcase.
Tested on x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64488
llvm-svn: 367351
Diffstat (limited to 'clang/lib/Driver/ToolChains/Solaris.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Solaris.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Solaris.cpp b/clang/lib/Driver/ToolChains/Solaris.cpp index 38f24d4cf7e..86b9ba9542f 100644 --- a/clang/lib/Driver/ToolChains/Solaris.cpp +++ b/clang/lib/Driver/ToolChains/Solaris.cpp @@ -177,6 +177,7 @@ Solaris::Solaris(const Driver &D, const llvm::Triple &Triple, SanitizerMask Solaris::getSupportedSanitizers() const { const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64; SanitizerMask Res = ToolChain::getSupportedSanitizers(); // FIXME: Omit X86_64 until 64-bit support is figured out. if (IsX86) { @@ -184,6 +185,8 @@ SanitizerMask Solaris::getSupportedSanitizers() const { Res |= SanitizerKind::PointerCompare; Res |= SanitizerKind::PointerSubtract; } + if (IsX86 || IsX86_64) + Res |= SanitizerKind::Function; Res |= SanitizerKind::Vptr; return Res; } |