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

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

Issue 2294963003: [mb] Config for ClangToTLinuxASanLibfuzzer (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') | 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 5fcc050b1741aacfeebd2a964c30ec32f1460e4b..2d2112dfd3a2910eb4dd0a2603df801d3d98ba45 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1350,6 +1350,8 @@ config("optimize_no_wpo") {
} else if (optimize_for_size) {
# Favor size over speed.
cflags = [ "-Os" ] + common_optimize_on_cflags
+ } else if (optimize_for_fuzzing) {
+ cflags = [ "-O1" ] + common_optimize_on_cflags
} else {
cflags = [ "-O2" ] + common_optimize_on_cflags
}
@@ -1463,6 +1465,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)
+ 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 +1493,8 @@ config("default_optimization") {
configs = [ "//build/config/nacl:irt_optimize" ]
} else if (is_debug) {
configs = [ ":no_optimize" ]
+ } else if (optimize_for_fuzzing) {
+ configs = [ ":optimize_fuzzing" ]
} else {
configs = [ ":optimize" ]
}
« no previous file with comments | « no previous file | build/config/compiler/compiler.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698