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

Unified Diff: build/config/compiler/BUILD.gn

Issue 2389923003: Add an optimize_for_fuzzing GN flag to build with -O1 (Closed)
Patch Set: add visibility Created 4 years, 2 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/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index db0e6f0ef30569d62d0759b1f6f80af5a22f36e0..4d8f0cedc23b7bce81f1a26092078b31aad477f3 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -86,6 +86,10 @@ declare_args() {
# builds. To use it, set auto_profile_path to the path to a file containing
# the needed gcov profiling data.
auto_profile_path = ""
+
+ # Optimize for coverage guided fuzzing (balance between speed and number of
+ # branches)
+ optimize_for_fuzzing = false
}
if (is_clang && !is_nacl) {
@@ -1461,6 +1465,12 @@ config("optimize_speed") {
}
}
+config("optimize_fuzzing") {
+ cflags = [ "-O1" ] + common_optimize_on_cflags
+ ldflags = common_optimize_on_ldflags
+ visibility = [ ":default_optimization" ]
+}
+
# The default optimization applied to all targets. This will be equivalent to
# either "optimize" or "no_optimize", depending on the build flags.
config("default_optimization") {
@@ -1470,6 +1480,9 @@ config("default_optimization") {
configs = [ "//build/config/nacl:irt_optimize" ]
} else if (is_debug) {
configs = [ ":no_optimize" ]
+ } else if (optimize_for_fuzzing) {
+ assert(!is_win, "Fuzzing optimize level not supported on Windows")
+ configs = [ ":optimize_fuzzing" ]
} else {
configs = [ ":optimize" ]
}
« 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