]> granicus.if.org Git - clang/commitdiff
MemorySanitizer does not require PIE.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 21 Oct 2015 20:20:03 +0000 (20:20 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 21 Oct 2015 20:20:03 +0000 (20:20 +0000)
Since r249754 MemorySanitizer should work equally well for PIE and
non-PIE executables.

Beware, with this change -fsanitize=memory no longer adds implicit
-fPIE -pie compiler/linker flags, unless the target defaults to PIE.

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

lib/Driver/SanitizerArgs.cpp
test/Driver/fsanitize.c

index 8c417ef4324bac4280cb1d7071687e6bb3593ee1..e939ec3b6f76691e5534ff692c4782a8307d8ecc 100644 (file)
@@ -29,7 +29,7 @@ enum : SanitizerMask {
   NeedsUbsanRt = Undefined | Integer | CFI,
   NeedsUbsanCxxRt = Vptr | CFI,
   NotAllowedWithTrap = Vptr,
-  RequiresPIE = Memory | DataFlow,
+  RequiresPIE = DataFlow,
   NeedsUnwindTables = Address | Thread | Memory | DataFlow,
   SupportsCoverage = Address | Memory | Leak | Undefined | Integer | DataFlow,
   RecoverableByDefault = Undefined | Integer,
index b9e525239d37ba1a78f55a4e059287b6eece8e35..606c0bd75868574fad424bd24631ebcbf6760d35 100644 (file)
 // CHECK-TSAN-NO-PIE: "-mrelocation-model" "static"
 
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NO-PIE
-// CHECK-MSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
-// CHECK-MSAN-NO-PIE: "-pie"
+// CHECK-MSAN-NO-PIE-NOT: "-pie"
+// CHECK-MSAN-NO-PIE: "-mrelocation-model" "static"
+// CHECK-MSAN-NO-PIE-NOT: "-pie"
 
 // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-ASAN-NO-PIE
 // CHECK-ANDROID-ASAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"