]> granicus.if.org Git - clang/commitdiff
clang: do not add -pie for tsan
authorDmitry Vyukov <dvyukov@google.com>
Fri, 21 Nov 2014 12:19:01 +0000 (12:19 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 21 Nov 2014 12:19:01 +0000 (12:19 +0000)
Revision 220571 removes the requirement to use -pie for tsan binaries. So remove -pie from driver.
Also s/hasZeroBaseShadow/requiresPIE/ because that is what it is used for. Msan does not have zero-based shadow, but requires pie. And in general the relation between zero-based shadow and pie is unclear.

http://reviews.llvm.org/D6318

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

include/clang/Driver/SanitizerArgs.h
lib/Driver/SanitizerArgs.cpp
lib/Driver/ToolChains.cpp

index 32b2e8935efe214de09aeb3384049c17c7f760e7..0b165b45d197ff9f9602f4c4a367bd868e5350c9 100644 (file)
@@ -49,7 +49,7 @@ class SanitizerArgs {
   bool needsDfsanRt() const { return Sanitizers.has(SanitizerKind::DataFlow); }
 
   bool sanitizesVptr() const { return Sanitizers.has(SanitizerKind::Vptr); }
-  bool hasZeroBaseShadow() const;
+  bool requiresPIE() const;
   bool needsUnwindTables() const;
   bool linkCXXRuntimes() const { return LinkCXXRuntimes; }
   void addArgs(const llvm::opt::ArgList &Args,
index 4460f9fca57186de200981e8e27fbab61805fb5e..1e7487f7690f5fda682a7fc9b12996bb97865336 100644 (file)
@@ -42,7 +42,7 @@ ID = ALIAS, ID##Group = 1 << SO_##ID##Group,
 #include "clang/Basic/Sanitizers.def"
   NeedsUbsanRt = Undefined | Integer,
   NotAllowedWithTrap = Vptr,
-  HasZeroBaseShadow = Thread | Memory | DataFlow,
+  RequiresPIE = Memory | DataFlow,
   NeedsUnwindTables = Address | Thread | Memory | DataFlow
 };
 }
@@ -140,8 +140,8 @@ bool SanitizerArgs::needsUbsanRt() const {
   return !UbsanTrapOnError && hasOneOf(Sanitizers, NeedsUbsanRt);
 }
 
-bool SanitizerArgs::hasZeroBaseShadow() const {
-  return AsanZeroBaseShadow || hasOneOf(Sanitizers, HasZeroBaseShadow);
+bool SanitizerArgs::requiresPIE() const {
+  return AsanZeroBaseShadow || hasOneOf(Sanitizers, RequiresPIE);
 }
 
 bool SanitizerArgs::needsUnwindTables() const {
index 17ef1075092ea85bd1bdc2ca125ba88f4e03134d..10079cde4b887b484b11668ff722dfa20a2ac686 100644 (file)
@@ -2507,7 +2507,7 @@ bool FreeBSD::HasNativeLLVMSupport() const {
 }
 
 bool FreeBSD::isPIEDefault() const {
-  return getSanitizerArgs().hasZeroBaseShadow();
+  return getSanitizerArgs().requiresPIE();
 }
 
 /// NetBSD - NetBSD tool chain which can call as(1) and ld(1) directly.
@@ -3383,7 +3383,7 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
 }
 
 bool Linux::isPIEDefault() const {
-  return getSanitizerArgs().hasZeroBaseShadow();
+  return getSanitizerArgs().requiresPIE();
 }
 
 /// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.