forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework how MB and GN handle concurrent links.
The Mac and iOS GN bots don't currently limit the number of concurrent links. The official continuous win bots aren't on MB because they can't limit the number of concurrent links through MB. This CL adds a 'concurrent_links' arg to GN, which calls the get_concurrent_links script to get the appropriate default value (making this consistent across platforms), and also adds a hack to MB to translate a gyp_link_concurrent "GYP_DEFINE" to the GYP_LINK_CONCURRENCY env var. The CL also adds a test for this MB hack and the similar, already existing LLVM_FORCE_HEAD_REVISION hack. R=scottmg@chromium.org, brettw@chromium.org BUG=602480, 611491, 616390 Review-Url: https://codereview.chromium.org/2031233002 Cr-Commit-Position: refs/heads/master@{#398200}
- Loading branch information
Showing
8 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2016 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# This file should only be imported from files that define toolchains. | ||
# There's no way to enforce this exactly, but all toolchains are processed | ||
# in the context of the default_toolchain, so we can at least check for that. | ||
assert(current_toolchain == default_toolchain) | ||
|
||
import("//build/config/sanitizers/sanitizers.gni") | ||
import("//build/toolchain/toolchain.gni") | ||
|
||
declare_args() { | ||
# Limit the number of concurrent links; we often want to run fewer | ||
# links at once than we do compiles, because linking is memory-intensive. | ||
# The default to use varies by platform and by the amount of memory | ||
# available, so we call out to a script to get the right value. | ||
concurrent_links = -1 | ||
} | ||
|
||
if (concurrent_links == -1) { | ||
if (allow_posix_link_time_opt || is_cfi) { | ||
_args = [ "--lto" ] | ||
} else { | ||
_args = [] | ||
} | ||
|
||
# TODO(crbug.com/617429) Pass more build configuration info to the script | ||
# so that we can compute better values. | ||
concurrent_links = exec_script("get_concurrent_links.py", _args, "value") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters