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

Unified Diff: build/toolchain/concurrent_links.gni

Issue 2031233002: Rework how MB and GN handle concurrent links. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move concurrent_links into a dedicated .gni Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: build/toolchain/concurrent_links.gni
diff --git a/build/toolchain/concurrent_links.gni b/build/toolchain/concurrent_links.gni
new file mode 100644
index 0000000000000000000000000000000000000000..2e68e354c56d372600f7854a875d4e941a15183c
--- /dev/null
+++ b/build/toolchain/concurrent_links.gni
@@ -0,0 +1,32 @@
+# 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.
+
brettw 2016/06/06 17:33:38 Can you delete this blank line so that it's clear
Dirk Pranke 2016/06/06 22:16:12 Acknowledged.
+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" ]
brettw 2016/06/06 17:33:38 This should be preceeded by an underscore to avoid
Dirk Pranke 2016/06/06 22:16:12 Acknowledged.
+ } 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")
+}
« no previous file with comments | « .gn ('k') | build/toolchain/gcc_toolchain.gni » ('j') | build/toolchain/gcc_toolchain.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698