aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2012-09-20 10:10:01 +0000
committerAlexander Potapenko <glider@google.com>2012-09-20 10:10:01 +0000
commit087c65fb270d7f465f221b543731f89343032e90 (patch)
tree781803d4bda1a69d774e8095c510d7d40028966c /lib/Basic/Targets.cpp
parentb3278162bd6d34783607d4bfe8814df73e8ef8c1 (diff)
Disable source fortification on Darwin with AddressSanitizer.
ASan doesn't play well with -D_FORTIFY_SOURCE, which is enabled by default starting at OS X 10.7 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Targets.cpp')
-rw-r--r--lib/Basic/Targets.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 3720d47e55..d5cb514b03 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -92,6 +92,9 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
Builder.defineMacro("__APPLE__");
Builder.defineMacro("__MACH__");
Builder.defineMacro("OBJC_NEW_PROPERTIES");
+ // AddressSanitizer doesn't play well with source fortification, which is on
+ // by default on Darwin.
+ if (Opts.AddressSanitizer) Builder.defineMacro("_FORTIFY_SOURCE", "0");
if (!Opts.ObjCAutoRefCount) {
// __weak is always defined, for use in blocks and with objc pointers.