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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 # If true, gold linker will save symbol table inside object files. | 80 # If true, gold linker will save symbol table inside object files. |
81 # This speeds up gdb startup by 60% | 81 # This speeds up gdb startup by 60% |
82 gdb_index = false | 82 gdb_index = false |
83 | 83 |
84 # If true, optimize for size. Does not affect windows builds. | 84 # If true, optimize for size. Does not affect windows builds. |
85 # Linux & Mac favor speed over size. | 85 # Linux & Mac favor speed over size. |
86 # TODO(brettw) it's weird that Mac and desktop Linux are different. We should | 86 # TODO(brettw) it's weird that Mac and desktop Linux are different. We should |
87 # explore favoring size over speed in this case as well. | 87 # explore favoring size over speed in this case as well. |
88 optimize_for_size = is_android || is_ios | 88 optimize_for_size = is_android || is_ios |
89 | 89 |
90 # Gold icf level, values are "none", "safe", "all". If value isn't overridden, | |
91 # default initialization is below. | |
92 gold_icf_level = "" | |
93 | |
94 # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1 | 90 # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1 |
95 # in the environment, we use the revision in the llvm repo to determine | 91 # in the environment, we use the revision in the llvm repo to determine |
96 # the CLANG_REVISION to use, instead of the version hard-coded into | 92 # the CLANG_REVISION to use, instead of the version hard-coded into |
97 # //tools/clang/scripts/update.py. This should only be used in | 93 # //tools/clang/scripts/update.py. This should only be used in |
98 # conjunction with setting LLVM_FORCE_HEAD_REVISION in the | 94 # conjunction with setting LLVM_FORCE_HEAD_REVISION in the |
99 # environment when `gclient runhooks` is run as well. | 95 # environment when `gclient runhooks` is run as well. |
100 llvm_force_head_revision = false | 96 llvm_force_head_revision = false |
101 } | 97 } |
102 | 98 |
103 if (is_clang && !is_nacl) { | 99 if (is_clang && !is_nacl) { |
(...skipping 13 matching lines...) Expand all Loading... |
117 } else { | 113 } else { |
118 gold_path = "" | 114 gold_path = "" |
119 } | 115 } |
120 } | 116 } |
121 | 117 |
122 if (use_debug_fission == "default") { | 118 if (use_debug_fission == "default") { |
123 use_debug_fission = is_debug && !is_win && use_gold && | 119 use_debug_fission = is_debug && !is_win && use_gold && |
124 linux_use_bundled_binutils && cc_wrapper == "" | 120 linux_use_bundled_binutils && cc_wrapper == "" |
125 } | 121 } |
126 | 122 |
127 if (gold_icf_level == "") { | |
128 if (use_gold && !is_clang) { | |
129 # Gold doesn't respect section alignment and breaks gcc builds with icf | |
130 # https://bugs.chromium.org/p/chromium/issues/detail?id=576197 | |
131 gold_icf_level = "none" | |
132 } else { | |
133 gold_icf_level = "all" | |
134 } | |
135 } | |
136 | |
137 # default_include_dirs --------------------------------------------------------- | 123 # default_include_dirs --------------------------------------------------------- |
138 # | 124 # |
139 # This is a separate config so that third_party code (which would not use the | 125 # This is a separate config so that third_party code (which would not use the |
140 # source root and might have conflicting versions of some headers) can remove | 126 # source root and might have conflicting versions of some headers) can remove |
141 # this and specify their own include paths. | 127 # this and specify their own include paths. |
142 config("default_include_dirs") { | 128 config("default_include_dirs") { |
143 include_dirs = [ | 129 include_dirs = [ |
144 "//", | 130 "//", |
145 root_gen_dir, | 131 root_gen_dir, |
146 ] | 132 ] |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 #"-Wl,--threads", | 311 #"-Wl,--threads", |
326 #"-Wl,--thread-count=4", | 312 #"-Wl,--thread-count=4", |
327 ] | 313 ] |
328 | 314 |
329 if (gdb_index) { | 315 if (gdb_index) { |
330 ldflags += [ "-Wl,--gdb-index" ] | 316 ldflags += [ "-Wl,--gdb-index" ] |
331 } | 317 } |
332 | 318 |
333 if (!using_sanitizer && !(is_android && use_order_profiling)) { | 319 if (!using_sanitizer && !(is_android && use_order_profiling)) { |
334 # TODO(brettw) common.gypi has this only for target toolset. | 320 # TODO(brettw) common.gypi has this only for target toolset. |
335 ldflags += [ "-Wl,--icf=${gold_icf_level}" ] | 321 ldflags += [ "-Wl,--icf=all" ] |
336 } | 322 } |
337 | 323 |
338 # TODO(thestig): Make this flag work with GN. | 324 # TODO(thestig): Make this flag work with GN. |
339 #if (!is_official_build && !is_chromeos && !(is_asan || is_lsan || is_tsan |
| is_msan)) { | 325 #if (!is_official_build && !is_chromeos && !(is_asan || is_lsan || is_tsan |
| is_msan)) { |
340 # ldflags += [ | 326 # ldflags += [ |
341 # "-Wl,--detect-odr-violations", | 327 # "-Wl,--detect-odr-violations", |
342 # ] | 328 # ] |
343 #} | 329 #} |
344 } else if (linux_use_bundled_binutils) { | 330 } else if (linux_use_bundled_binutils) { |
345 # Gold is the default linker for the bundled binutils so we explicitly | 331 # Gold is the default linker for the bundled binutils so we explicitly |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 | 1421 |
1436 if (is_ios || is_mac) { | 1422 if (is_ios || is_mac) { |
1437 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1423 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1438 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1424 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1439 config("enable_arc") { | 1425 config("enable_arc") { |
1440 common_flags = [ "-fobjc-arc" ] | 1426 common_flags = [ "-fobjc-arc" ] |
1441 cflags_objc = common_flags | 1427 cflags_objc = common_flags |
1442 cflags_objcc = common_flags | 1428 cflags_objcc = common_flags |
1443 } | 1429 } |
1444 } | 1430 } |
OLD | NEW |