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

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

Issue 2389923003: Add an optimize_for_fuzzing GN flag to build with -O1 (Closed)
Patch Set: Add an optimize_for_fuzzing GN flag to build with -O1 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 | build/config/compiler/compiler.gni » ('j') | build/config/compiler/compiler.gni » ('J')
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 5fcc050b1741aacfeebd2a964c30ec32f1460e4b..04b768a670b75aae2af76297844bbe75dacd868e 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1463,6 +1463,25 @@ config("optimize_speed") {
}
}
+config("optimize_fuzzing") {
+ if (is_nacl_irt) {
+ # The NaCl IRT is a special case and always wants its own config.
+ # Various components do:
+ # if (!is_debug) {
+ # configs -= [ "//build/config/compiler:default_optimization" ]
+ # configs += [ "//build/config/compiler:optimize_max" ]
+ # }
+ # So this config has to have the selection logic just like
+ # "default_optimization", below.
+ configs = [ "//build/config/nacl:irt_optimize" ]
+ } else {
+ # Only supported on non-Windows.
+ assert(!is_win)
Dirk Pranke 2016/10/03 20:37:13 I would: - get rid of lines 1467-1477 since they
Oliver Chang 2016/10/03 20:54:24 Done.
+ cflags = [ "-O1" ] + common_optimize_on_cflags
+ ldflags = common_optimize_on_ldflags
+ }
+}
+
# 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") {
@@ -1472,6 +1491,8 @@ config("default_optimization") {
configs = [ "//build/config/nacl:irt_optimize" ]
} else if (is_debug) {
configs = [ ":no_optimize" ]
+ } else if (!is_win && optimize_for_fuzzing) {
+ configs = [ ":optimize_fuzzing" ]
Dirk Pranke 2016/10/03 20:37:13 I would get rid of the (!is_win) check here, as pe
Oliver Chang 2016/10/03 20:54:25 Done.
} else {
configs = [ ":optimize" ]
}
« no previous file with comments | « no previous file | build/config/compiler/compiler.gni » ('j') | build/config/compiler/compiler.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698