Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4432)

Unified Diff: build/config/sanitizers/sanitizers.gni

Issue 1326453003: Add a assert for running a sanitizer in debug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/sanitizers/sanitizers.gni
diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni
index cab01b1c45d260d73c2d99fec7c8f6d5d9538d80..6f7aebc5ab78e55af40cf2963b22f2e565b8457e 100644
--- a/build/config/sanitizers/sanitizers.gni
+++ b/build/config/sanitizers/sanitizers.gni
@@ -23,3 +23,17 @@ declare_args() {
# https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
is_syzyasan = false
}
+
+# MSan only links Chrome properly in release builds (brettw -- 9/1/2015). The
+# same is possibly true for the other sanitizers. But regardless of whether it
+# links, one would normally never run a sanitizer in debug mode. Running in
+# debug mode probably indicates you forgot to set the "is_debug = false" flag
+# in the build args.
+#
+# If you find a use-case where you want to compile a sanitizer in debug mode
+# and have verified it works, you can remove it from this condition. But please
+# balance how common your use-case is versus how easy it is to forget to set
+# the release flag, have an unpleasant time trying to use the sanitizer, and
+# have to rebuild. For one-off builds, just comment this out locally.
+assert(!is_debug || !(is_msan || is_asan || is_lsan || is_tsan),
+ "Sanitizers should generally be used in release (set is_debug=false).")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698