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

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

Issue 2559563002: Limit the number of thinlto jobs to 8; also support limits in lld. (Closed)
Patch Set: improve a comment Created 4 years 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 | 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 # optimizations/transformations that require whole-program visibility at link 434 # optimizations/transformations that require whole-program visibility at link
435 # time, so they need to be applied to all translation units, and we may end up 435 # time, so they need to be applied to all translation units, and we may end up
436 # with miscompiles if only part of the program is compiled with LTO flags. For 436 # with miscompiles if only part of the program is compiled with LTO flags. For
437 # that reason, we cannot allow targets to enable or disable these flags, for 437 # that reason, we cannot allow targets to enable or disable these flags, for
438 # example by disabling the optimize configuration. 438 # example by disabling the optimize configuration.
439 # TODO(pcc): Make this conditional on is_official_build rather than on gn 439 # TODO(pcc): Make this conditional on is_official_build rather than on gn
440 # flags for specific features. 440 # flags for specific features.
441 if (!is_debug && (allow_posix_link_time_opt || is_cfi) && !is_nacl) { 441 if (!is_debug && (allow_posix_link_time_opt || is_cfi) && !is_nacl) {
442 if (use_thin_lto) { 442 if (use_thin_lto) {
443 cflags += [ "-flto=thin" ] 443 cflags += [ "-flto=thin" ]
444 ldflags += [ 444 ldflags += [ "-flto=thin" ]
445 "-flto=thin",
446 445
447 # Limit the parallelism to the sweet spot on most of the machines. 446 # Limit the parallelism to avoid too agressive competition between
448 # As of now, ThinLTO does not scale beyond 16 cores anyway. 447 # linker jobs. This is still suboptimal to a potential dynamic
449 "-Wl,-plugin-opt,jobs=16", 448 # resource allocation scheme, but should be good enough.
Nico 2016/12/06 21:08:48 Shouldn't the OS scheduler be ok with linker threa
450 ] 449 if (use_lld) {
450 ldflags += [ "-Wl,--thinlto-jobs=8" ]
451 } else {
452 ldflags += [ "-Wl,-plugin-opt,jobs=8" ]
453 }
451 } else { 454 } else {
452 # Note: ThinLTO does not currently have this feature implemented 455 # Note: ThinLTO does not currently have this feature implemented
453 # For Full LTO, it provides a measurable runtime speedup of Chrome. 456 # For Full LTO, it provides a measurable runtime speedup of Chrome.
454 cflags += [ 457 cflags += [
455 "-flto", 458 "-flto",
456 "-fwhole-program-vtables", 459 "-fwhole-program-vtables",
457 ] 460 ]
458 ldflags += [ 461 ldflags += [
459 "-flto", 462 "-flto",
460 "-fwhole-program-vtables", 463 "-fwhole-program-vtables",
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 1638
1636 if (is_ios || is_mac) { 1639 if (is_ios || is_mac) {
1637 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1640 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1638 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1641 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1639 config("enable_arc") { 1642 config("enable_arc") {
1640 common_flags = [ "-fobjc-arc" ] 1643 common_flags = [ "-fobjc-arc" ]
1641 cflags_objc = common_flags 1644 cflags_objc = common_flags
1642 cflags_objcc = common_flags 1645 cflags_objcc = common_flags
1643 } 1646 }
1644 } 1647 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698