r188068 - Fixup for r188058: assume hasAsanZeroBaseShadow() is false if ASan is not needed
Alexey Samsonov
samsonov at google.com
Fri Aug 9 03:56:43 PDT 2013
Author: samsonov
Date: Fri Aug 9 05:56:42 2013
New Revision: 188068
URL: http://llvm.org/viewvc/llvm-project?rev=188068&view=rev
Log:
Fixup for r188058: assume hasAsanZeroBaseShadow() is false if ASan is not needed
Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp
cfe/trunk/test/Driver/fsanitize.c
Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=188068&r1=188067&r2=188068&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Fri Aug 9 05:56:42 2013
@@ -193,6 +193,8 @@ void SanitizerArgs::addArgs(const ToolCh
}
bool SanitizerArgs::hasAsanZeroBaseShadow(const ToolChain &TC) const {
+ if (!needsAsanRt())
+ return false;
if (AsanZeroBaseShadow != AZBSK_Default)
return AsanZeroBaseShadow == AZBSK_On;
// Zero-base shadow is used by default only on Android.
Modified: cfe/trunk/test/Driver/fsanitize.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fsanitize.c?rev=188068&r1=188067&r2=188068&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fsanitize.c (original)
+++ cfe/trunk/test/Driver/fsanitize.c Fri Aug 9 05:56:42 2013
@@ -120,6 +120,9 @@
// CHECK-ANDROID-ASAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
// CHECK-ANDROID-ASAN-NO-PIE: "-pie"
+// RUN: %clang -target arm-linux-androideabi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN
+// CHECK-ANDROID-NO-ASAN: "-mrelocation-model" "static"
+
// RUN: %clang -target arm-linux-androideabi -fsanitize=address -fsanitize-address-zero-base-shadow %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-ASAN-ZERO-BASE
// CHECK-ANDROID-ASAN-ZERO-BASE-NOT: argument unused during compilation
More information about the cfe-commits
mailing list