]> granicus.if.org Git - clang/commitdiff
Driver: SCS is compatible with every other sanitizer.
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 20 Nov 2018 01:01:49 +0000 (01:01 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 20 Nov 2018 01:01:49 +0000 (01:01 +0000)
Because SCS relies on system-provided runtime support, we can use it
together with any other sanitizer simply by linking the runtime for
the other sanitizer.

Differential Revision: https://reviews.llvm.org/D54735

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347282 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/SanitizerArgs.cpp
test/Driver/sanitizer-ld.c

index 135adb519bd45fb0468fb78cf1c5fa8c10a96b9e..fe71b6c85ce9dcc8d3d2ee2bc8101bb04544131f 100644 (file)
@@ -376,12 +376,9 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
                                 KernelAddress | Efficiency),
       std::make_pair(SafeStack, Address | HWAddress | Leak | Thread | Memory |
                                     KernelAddress | Efficiency),
-      std::make_pair(ShadowCallStack, Address | HWAddress | Leak | Thread |
-                                          Memory | KernelAddress | Efficiency |
-                                          SafeStack),
       std::make_pair(KernelHWAddress, Address | HWAddress | Leak | Thread |
                                           Memory | KernelAddress | Efficiency |
-                                          SafeStack | ShadowCallStack),
+                                          SafeStack),
       std::make_pair(KernelMemory, Address | HWAddress | Leak | Thread |
                                        Memory | KernelAddress | Efficiency |
                                        Scudo | SafeStack)};
index ca16932f07397b487190478de31942bcd68f7579..9ce05996fdd37971bbfcd418eb584314f1a5745d 100644 (file)
 // RUN: %clang -fsanitize=shadow-call-stack %s -### -o %t.o 2>&1 \
 // RUN:     -fsanitize=safe-stack -target x86_64-unknown-linux -fuse-ld=ld \
 // RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-SAFESTACK %s
-// CHECK-SHADOWCALLSTACK-SAFESTACK: error: invalid argument '-fsanitize=shadow-call-stack' not allowed with '-fsanitize=safe-stack'
+// CHECK-SHADOWCALLSTACK-SAFESTACK-NOT: error:
 
 // RUN: %clang -fsanitize=cfi -fsanitize-stats %s -### -o %t.o 2>&1 \
 // RUN:     -target x86_64-unknown-linux -fuse-ld=ld \