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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 1887303003: Build: disable icf for gcc builds with bundled gold (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixup Created 4 years, 8 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 | « build/common.gypi ('k') | no next file » | no next file with comments »
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
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
90 # Gold icf level, values are "none", "safe", "all". If value isn't overridden,
91 # default initialization is below.
92 gold_icf_level = ""
89 } 93 }
90 94
91 # Apply the default logic for these values if they were not set explicitly. 95 # Apply the default logic for these values if they were not set explicitly.
92 if (gold_path == false) { 96 if (gold_path == false) {
93 if (use_gold) { 97 if (use_gold) {
94 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", 98 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
95 root_build_dir) 99 root_build_dir)
96 } else { 100 } else {
97 gold_path = "" 101 gold_path = ""
98 } 102 }
99 } 103 }
100 104
101 if (use_debug_fission == "default") { 105 if (use_debug_fission == "default") {
102 use_debug_fission = is_debug && !is_win && use_gold && 106 use_debug_fission = is_debug && !is_win && use_gold &&
103 linux_use_bundled_binutils && cc_wrapper == "" 107 linux_use_bundled_binutils && cc_wrapper == ""
104 } 108 }
105 109
110 if (gold_icf_level == "") {
111 if (use_gold && !is_clang) {
112 # Gold doesn't respect section alignment and breaks gcc builds with icf
113 # https://bugs.chromium.org/p/chromium/issues/detail?id=576197
114 gold_icf_level = "none"
115 } else {
116 gold_icf_level = "all"
117 }
118 }
119
106 # default_include_dirs --------------------------------------------------------- 120 # default_include_dirs ---------------------------------------------------------
107 # 121 #
108 # This is a separate config so that third_party code (which would not use the 122 # This is a separate config so that third_party code (which would not use the
109 # source root and might have conflicting versions of some headers) can remove 123 # source root and might have conflicting versions of some headers) can remove
110 # this and specify their own include paths. 124 # this and specify their own include paths.
111 config("default_include_dirs") { 125 config("default_include_dirs") {
112 include_dirs = [ 126 include_dirs = [
113 "//", 127 "//",
114 root_gen_dir, 128 root_gen_dir,
115 ] 129 ]
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 #"-Wl,--threads", 311 #"-Wl,--threads",
298 #"-Wl,--thread-count=4", 312 #"-Wl,--thread-count=4",
299 ] 313 ]
300 314
301 if (gdb_index) { 315 if (gdb_index) {
302 ldflags += [ "-Wl,--gdb-index" ] 316 ldflags += [ "-Wl,--gdb-index" ]
303 } 317 }
304 318
305 if (!using_sanitizer && !(is_android && use_order_profiling)) { 319 if (!using_sanitizer && !(is_android && use_order_profiling)) {
306 # TODO(brettw) common.gypi has this only for target toolset. 320 # TODO(brettw) common.gypi has this only for target toolset.
307 ldflags += [ "-Wl,--icf=all" ] 321 ldflags += [ "-Wl,--icf=${gold_icf_level}" ]
308 } 322 }
309 323
310 # TODO(thestig): Make this flag work with GN. 324 # TODO(thestig): Make this flag work with GN.
311 #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)) {
312 # ldflags += [ 326 # ldflags += [
313 # "-Wl,--detect-odr-violations", 327 # "-Wl,--detect-odr-violations",
314 # ] 328 # ]
315 #} 329 #}
316 } else if (linux_use_bundled_binutils) { 330 } else if (linux_use_bundled_binutils) {
317 # 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 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 1414
1401 if (is_ios || is_mac) { 1415 if (is_ios || is_mac) {
1402 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1416 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1403 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1417 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1404 config("enable_arc") { 1418 config("enable_arc") {
1405 common_flags = [ "-fobjc-arc" ] 1419 common_flags = [ "-fobjc-arc" ]
1406 cflags_objc = common_flags 1420 cflags_objc = common_flags
1407 cflags_objcc = common_flags 1421 cflags_objcc = common_flags
1408 } 1422 }
1409 } 1423 }
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698