OLD | NEW |
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 # If true, optimize for size. Does not affect windows builds. | 73 # If true, optimize for size. Does not affect windows builds. |
74 # Linux & Mac favor speed over size. | 74 # Linux & Mac favor speed over size. |
75 # TODO(brettw) it's weird that Mac and desktop Linux are different. We should | 75 # TODO(brettw) it's weird that Mac and desktop Linux are different. We should |
76 # explore favoring size over speed in this case as well. | 76 # explore favoring size over speed in this case as well. |
77 optimize_for_size = is_android || is_ios | 77 optimize_for_size = is_android || is_ios |
78 | 78 |
79 # Enable fatal linker warnings. Building Chromium with certain versions | 79 # Enable fatal linker warnings. Building Chromium with certain versions |
80 # of binutils can cause linker warning. | 80 # of binutils can cause linker warning. |
81 # See: https://bugs.chromium.org/p/chromium/issues/detail?id=457359 | 81 # See: https://bugs.chromium.org/p/chromium/issues/detail?id=457359 |
82 fatal_linker_warnings = true | 82 fatal_linker_warnings = true |
| 83 |
| 84 # AFDO (Automatic Feedback Directed Optimizer) is a form of profile-guided |
| 85 # optimization that GCC supports. It used by ChromeOS in their official |
| 86 # builds. To use it, set auto_profile_path to the path to a file containing |
| 87 # the needed gcov profiling data. |
| 88 auto_profile_path = "" |
83 } | 89 } |
84 | 90 |
85 if (is_clang && !is_nacl) { | 91 if (is_clang && !is_nacl) { |
86 update_args = [ "--print-revision" ] | 92 update_args = [ "--print-revision" ] |
87 if (llvm_force_head_revision) { | 93 if (llvm_force_head_revision) { |
88 update_args += [ "--llvm-force-head-revision" ] | 94 update_args += [ "--llvm-force-head-revision" ] |
89 } | 95 } |
90 clang_revision = | 96 clang_revision = |
91 exec_script("//tools/clang/scripts/update.py", update_args, "trim string") | 97 exec_script("//tools/clang/scripts/update.py", update_args, "trim string") |
92 } | 98 } |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 # The NaCl IRT is a special case and always wants its own config. | 1478 # The NaCl IRT is a special case and always wants its own config. |
1473 # It gets optimized the same way regardless of the type of build. | 1479 # It gets optimized the same way regardless of the type of build. |
1474 configs = [ "//build/config/nacl:irt_optimize" ] | 1480 configs = [ "//build/config/nacl:irt_optimize" ] |
1475 } else if (is_debug) { | 1481 } else if (is_debug) { |
1476 configs = [ ":no_optimize" ] | 1482 configs = [ ":no_optimize" ] |
1477 } else { | 1483 } else { |
1478 configs = [ ":optimize" ] | 1484 configs = [ ":optimize" ] |
1479 } | 1485 } |
1480 } | 1486 } |
1481 | 1487 |
| 1488 # GCC supports a form of profile-guided optimization called AFDO, which |
| 1489 # is used by ChromeOS in their official builds. However, |
| 1490 # //base/allocator:tcmalloc currently doesn't work correctly with AFDO |
| 1491 # so we provide separate config so that the flag can be disabled per-target. |
| 1492 # TODO(crbug.com/633719): Remove this config once tcmalloc works with AFDO |
| 1493 # or we remove tcmalloc or we stop using AFDO. |
| 1494 config("afdo") { |
| 1495 if (auto_profile_path) { |
| 1496 cflags = [ "-fauto-profile=${auto_profile_path}" ] |
| 1497 } |
| 1498 } |
| 1499 |
1482 # Symbols ---------------------------------------------------------------------- | 1500 # Symbols ---------------------------------------------------------------------- |
1483 | 1501 |
1484 # The BUILDCONFIG file sets the "default_symbols" config on targets by | 1502 # The BUILDCONFIG file sets the "default_symbols" config on targets by |
1485 # default. It will be equivalent to one the three specific symbol levels. | 1503 # default. It will be equivalent to one the three specific symbol levels. |
1486 # | 1504 # |
1487 # You can override the symbol level on a per-target basis by removing the | 1505 # You can override the symbol level on a per-target basis by removing the |
1488 # default config and then adding the named one you want: | 1506 # default config and then adding the named one you want: |
1489 # | 1507 # |
1490 # configs -= [ "//build/config/compiler:default_symbols" ] | 1508 # configs -= [ "//build/config/compiler:default_symbols" ] |
1491 # configs += [ "//build/config/compiler:symbols" ] | 1509 # configs += [ "//build/config/compiler:symbols" ] |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 | 1608 |
1591 if (is_ios || is_mac) { | 1609 if (is_ios || is_mac) { |
1592 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1610 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1593 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1611 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1594 config("enable_arc") { | 1612 config("enable_arc") { |
1595 common_flags = [ "-fobjc-arc" ] | 1613 common_flags = [ "-fobjc-arc" ] |
1596 cflags_objc = common_flags | 1614 cflags_objc = common_flags |
1597 cflags_objcc = common_flags | 1615 cflags_objcc = common_flags |
1598 } | 1616 } |
1599 } | 1617 } |
OLD | NEW |