[PATCH] If the user requested a zero-base-shadow sanitizer, infer -pie and -fPIC when appropriate.
Alexey Samsonov
samsonov at google.com
Thu Mar 7 06:07:15 PST 2013
================
Comment at: lib/Driver/SanitizerArgs.h:68
@@ +67,3 @@
+ bool hasZeroBaseShadow() const {
+ return (Kind & HasZeroBaseShadow) || AsanZeroBaseShadow;
+ }
----------------
Can you just return (needsTsanRt() || needsMsanRt() || (needsAsanRt && AsanZeroBaseShadow) w/o introducing new SanitizeKind?
================
Comment at: lib/Driver/ToolChains.h:499
@@ -498,2 +498,3 @@
ArgStringList &CC1Args) const;
+ virtual bool isPICDefault() const;
----------------
Out of curiosity - why do you need this?
================
Comment at: lib/Driver/ToolChains.h:503
@@ -501,2 +502,3 @@
std::vector<std::string> ExtraOpts;
+ bool HasZeroBaseShadow;
----------------
SanitizerHasZeroBaseShadow?
================
Comment at: lib/Driver/Tools.cpp:5666
@@ +5665,3 @@
+ SanitizerArgs Sanitize(getToolChain(), Args);
+ const bool isPIE =
+ !Args.hasArg(options::OPT_shared) &&
----------------
s/isPIE/IsPIE
http://llvm-reviews.chandlerc.com/D502
More information about the cfe-commits
mailing list