| 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" ]
|
| }
|
|
|