Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index ad947050cc52f88c4b1ea2e465d326ba03d22364..0e28e7da8be6dce3e5b5d93500416c894b8513cd 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -158,15 +158,15 @@ config("compiler") { |
] |
} |
- if (is_clang && !is_win && !is_nacl) { |
+ if (is_clang && !is_nacl) { |
# This is here so that all files get recompiled after a clang roll and |
# when turning clang on or off. (defines are passed via the command line, |
# and build system rebuild things when their commandline changes). Nothing |
# should ever read this define. |
- defines += [ "CR_CLANG_REVISION=" + |
- exec_script("//tools/clang/scripts/posix-print-revision.py", |
- [], |
- "trim string") ] |
+ defines += |
+ [ "CR_CLANG_REVISION=" + exec_script("//tools/clang/scripts/update.py", |
+ [ "--print-revision" ], |
+ "trim string") ] |
} |
# Mac-specific compiler flags setup. |
@@ -336,6 +336,7 @@ config("compiler") { |
"-fno-unwind-tables", |
"-fno-asynchronous-unwind-tables", |
] |
+ defines += [ "NO_UNWIND_TABLES" ] |
} else { |
cflags += [ "-funwind-tables" ] |
} |
@@ -636,6 +637,18 @@ config("chromium_code") { |
"__STDC_CONSTANT_MACROS", |
"__STDC_FORMAT_MACROS", |
] |
+ |
+ if (using_sanitizer) { |
+ # _FORTIFY_SOURCE isn't really supported by Clang now, see |
+ # http://llvm.org/bugs/show_bug.cgi?id=16821. |
+ # It seems to work fine with Ubuntu 12 headers though, so use it in |
+ # official builds. |
+ # |
+ # Non-chromium code is not guaranteed to compile cleanly with |
+ # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are |
+ # disabled, so only do that for Release build. |
+ defines += [ "_FORTIFY_SOURCE=2" ] |
+ } |
} |
} |
config("no_chromium_code") { |