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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | build/config/compiler/compiler.gni » ('j') | build/config/compiler/compiler.gni » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/compiler/compiler.gni") 7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/nacl/config.gni") 8 import("//build/config/nacl/config.gni")
9 import("//build/toolchain/cc_wrapper.gni") 9 import("//build/toolchain/cc_wrapper.gni")
10 import("//build/toolchain/toolchain.gni") 10 import("//build/toolchain/toolchain.gni")
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 # value of C4702 for PGO builds is likely very small. 1456 # value of C4702 for PGO builds is likely very small.
1457 "/wd4702", 1457 "/wd4702",
1458 ] 1458 ]
1459 } 1459 }
1460 } else { 1460 } else {
1461 cflags = [ "-O3" ] + common_optimize_on_cflags 1461 cflags = [ "-O3" ] + common_optimize_on_cflags
1462 } 1462 }
1463 } 1463 }
1464 } 1464 }
1465 1465
1466 config("optimize_fuzzing") {
1467 if (is_nacl_irt) {
1468 # The NaCl IRT is a special case and always wants its own config.
1469 # Various components do:
1470 # if (!is_debug) {
1471 # configs -= [ "//build/config/compiler:default_optimization" ]
1472 # configs += [ "//build/config/compiler:optimize_max" ]
1473 # }
1474 # So this config has to have the selection logic just like
1475 # "default_optimization", below.
1476 configs = [ "//build/config/nacl:irt_optimize" ]
1477 } else {
1478 # Only supported on non-Windows.
1479 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.
1480 cflags = [ "-O1" ] + common_optimize_on_cflags
1481 ldflags = common_optimize_on_ldflags
1482 }
1483 }
1484
1466 # The default optimization applied to all targets. This will be equivalent to 1485 # The default optimization applied to all targets. This will be equivalent to
1467 # either "optimize" or "no_optimize", depending on the build flags. 1486 # either "optimize" or "no_optimize", depending on the build flags.
1468 config("default_optimization") { 1487 config("default_optimization") {
1469 if (is_nacl_irt) { 1488 if (is_nacl_irt) {
1470 # The NaCl IRT is a special case and always wants its own config. 1489 # The NaCl IRT is a special case and always wants its own config.
1471 # It gets optimized the same way regardless of the type of build. 1490 # It gets optimized the same way regardless of the type of build.
1472 configs = [ "//build/config/nacl:irt_optimize" ] 1491 configs = [ "//build/config/nacl:irt_optimize" ]
1473 } else if (is_debug) { 1492 } else if (is_debug) {
1474 configs = [ ":no_optimize" ] 1493 configs = [ ":no_optimize" ]
1494 } else if (!is_win && optimize_for_fuzzing) {
1495 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.
1475 } else { 1496 } else {
1476 configs = [ ":optimize" ] 1497 configs = [ ":optimize" ]
1477 } 1498 }
1478 } 1499 }
1479 1500
1480 # Symbols ---------------------------------------------------------------------- 1501 # Symbols ----------------------------------------------------------------------
1481 1502
1482 # The BUILDCONFIG file sets the "default_symbols" config on targets by 1503 # The BUILDCONFIG file sets the "default_symbols" config on targets by
1483 # default. It will be equivalent to one the three specific symbol levels. 1504 # default. It will be equivalent to one the three specific symbol levels.
1484 # 1505 #
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 1609
1589 if (is_ios || is_mac) { 1610 if (is_ios || is_mac) {
1590 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1611 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1591 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1612 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1592 config("enable_arc") { 1613 config("enable_arc") {
1593 common_flags = [ "-fobjc-arc" ] 1614 common_flags = [ "-fobjc-arc" ]
1594 cflags_objc = common_flags 1615 cflags_objc = common_flags
1595 cflags_objcc = common_flags 1616 cflags_objcc = common_flags
1596 } 1617 }
1597 } 1618 }
OLDNEW
« 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