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

Side by Side Diff: build/toolchain/toolchain.gni

Issue 2957533002: Enable ThinLTO for POSIX LTO by default on Linux, take 2. (Closed)
Patch Set: New patch Created 3 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 # Toolchain-related configuration that may be needed outside the context of the 5 # Toolchain-related configuration that may be needed outside the context of the
6 # toolchain() rules themselves. 6 # toolchain() rules themselves.
7 7
8 import("//build_overrides/build.gni") 8 import("//build_overrides/build.gni")
9 import("//build/config/chrome_build.gni") 9 import("//build/config/chrome_build.gni")
10 10
11 declare_args() { 11 declare_args() {
12 # Enable Link Time Optimization in optimized builds (output programs run 12 # Enable Link Time Optimization in optimized builds (output programs run
13 # faster, but linking is up to 5-20x slower). 13 # faster, but linking is up to 5-20x slower).
14 # Note: use target_os == "linux" rather than is_linux so that it does not 14 # Note: use target_os == "linux" rather than is_linux so that it does not
15 # apply to host_toolchain when target_os="android". 15 # apply to host_toolchain when target_os="android".
16 allow_posix_link_time_opt = 16 allow_posix_link_time_opt =
17 is_clang && target_os == "linux" && !is_chromeos && target_cpu == "x64" && 17 is_clang && target_os == "linux" && !is_chromeos && target_cpu == "x64" &&
18 is_official_build 18 is_official_build
19 }
19 20
20 # If used with allow_posix_link_time_opt, it enables the experimental support 21 declare_args() {
21 # of ThinLTO that links 3x-10x faster but (as of now) does not have all the 22 # If used with allow_posix_link_time_opt, it enables support for ThinLTO,
22 # important optimizations such us devirtualization implemented. See also 23 # which links 3x-10x faster than full LTO. See also
23 # http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html 24 # http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
24 use_thin_lto = false 25 use_thin_lto = allow_posix_link_time_opt && target_os == "linux" &&
26 !is_chromeos && target_cpu == "x64"
25 27
26 # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1 28 # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1
27 # in the environment, we use the revision in the llvm repo to determine 29 # in the environment, we use the revision in the llvm repo to determine
28 # the CLANG_REVISION to use, instead of the version hard-coded into 30 # the CLANG_REVISION to use, instead of the version hard-coded into
29 # //tools/clang/scripts/update.py. This should only be used in 31 # //tools/clang/scripts/update.py. This should only be used in
30 # conjunction with setting LLVM_FORCE_HEAD_REVISION in the 32 # conjunction with setting LLVM_FORCE_HEAD_REVISION in the
31 # environment when `gclient runhooks` is run as well. 33 # environment when `gclient runhooks` is run as well.
32 llvm_force_head_revision = false 34 llvm_force_head_revision = false
33 35
34 # Compile with Xcode version of clang instead of hermetic version shipped 36 # Compile with Xcode version of clang instead of hermetic version shipped
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 _tool_wrapper_path = 122 _tool_wrapper_path =
121 rebase_path("//build/toolchain/win/tool_wrapper.py", root_build_dir) 123 rebase_path("//build/toolchain/win/tool_wrapper.py", root_build_dir)
122 124
123 stamp_command = "$python_path $_tool_wrapper_path stamp {{output}}" 125 stamp_command = "$python_path $_tool_wrapper_path stamp {{output}}"
124 copy_command = 126 copy_command =
125 "$python_path $_tool_wrapper_path recursive-mirror {{source}} {{output}}" 127 "$python_path $_tool_wrapper_path recursive-mirror {{source}} {{output}}"
126 } else { 128 } else {
127 stamp_command = "touch {{output}}" 129 stamp_command = "touch {{output}}"
128 copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" 130 copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
129 } 131 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698