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

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

Issue 2877913003: Enable LLD for POSIX LTO builds on Linux. (Closed)
Patch Set: Created 3 years, 7 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 | « 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 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 # Set to true to use lld, the LLVM linker. This flag may be used on Windows
21 # with the shipped LLVM toolchain, or on Linux with a self-built top-of-tree
22 # LLVM toolchain (see llvm_force_head_revision in
23 # build/config/compiler/BUILD.gn).
24 use_lld = is_win && host_os != "win"
25
26 # If used with allow_posix_link_time_opt, it enables the experimental support 20 # If used with allow_posix_link_time_opt, it enables the experimental support
27 # of ThinLTO that links 3x-10x faster but (as of now) does not have all the 21 # of ThinLTO that links 3x-10x faster but (as of now) does not have all the
28 # important optimizations such us devirtualization implemented. See also 22 # important optimizations such us devirtualization implemented. See also
29 # http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html 23 # http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
30 use_thin_lto = false 24 use_thin_lto = false
31 25
32 # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1 26 # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1
33 # in the environment, we use the revision in the llvm repo to determine 27 # in the environment, we use the revision in the llvm repo to determine
34 # the CLANG_REVISION to use, instead of the version hard-coded into 28 # the CLANG_REVISION to use, instead of the version hard-coded into
35 # //tools/clang/scripts/update.py. This should only be used in 29 # //tools/clang/scripts/update.py. This should only be used in
(...skipping 10 matching lines...) Expand all
46 # The path to the hermetic install of Xcode. Only relevant when 40 # The path to the hermetic install of Xcode. Only relevant when
47 # use_system_xcode = false. 41 # use_system_xcode = false.
48 hermetic_xcode_path = 42 hermetic_xcode_path =
49 rebase_path("//build/${target_os}_files/Xcode.app", "", root_build_dir) 43 rebase_path("//build/${target_os}_files/Xcode.app", "", root_build_dir)
50 44
51 declare_args() { 45 declare_args() {
52 if (is_clang) { 46 if (is_clang) {
53 # Clang compiler version. Clang files are placed at version-dependent paths. 47 # Clang compiler version. Clang files are placed at version-dependent paths.
54 clang_version = "5.0.0" 48 clang_version = "5.0.0"
55 } 49 }
50
51 # Set to true to use lld, the LLVM linker. This flag may be used on Windows
52 # or Linux.
53 use_lld = (is_win && host_os != "win") ||
54 (allow_posix_link_time_opt && target_os == "linux" &&
55 !is_chromeos && target_cpu == "x64")
56 } 56 }
57 57
58 # Check target_os here instead of is_ios as this file is loaded for secondary 58 # Check target_os here instead of is_ios as this file is loaded for secondary
59 # toolchain (host toolchain in particular) but the argument is the same for 59 # toolchain (host toolchain in particular) but the argument is the same for
60 # all toolchains. 60 # all toolchains.
61 assert(!use_xcode_clang || target_os == "ios", 61 assert(!use_xcode_clang || target_os == "ios",
62 "Using Xcode's clang is only supported in iOS builds") 62 "Using Xcode's clang is only supported in iOS builds")
63 63
64 # Subdirectory within root_out_dir for shared library files. 64 # Subdirectory within root_out_dir for shared library files.
65 # TODO(agrieve): GYP sets this to "lib" for Linux & Android, but this won't work 65 # TODO(agrieve): GYP sets this to "lib" for Linux & Android, but this won't work
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 _tool_wrapper_path = 107 _tool_wrapper_path =
108 rebase_path("//build/toolchain/win/tool_wrapper.py", root_build_dir) 108 rebase_path("//build/toolchain/win/tool_wrapper.py", root_build_dir)
109 109
110 stamp_command = "$python_path $_tool_wrapper_path stamp {{output}}" 110 stamp_command = "$python_path $_tool_wrapper_path stamp {{output}}"
111 copy_command = 111 copy_command =
112 "$python_path $_tool_wrapper_path recursive-mirror {{source}} {{output}}" 112 "$python_path $_tool_wrapper_path recursive-mirror {{source}} {{output}}"
113 } else { 113 } else {
114 stamp_command = "touch {{output}}" 114 stamp_command = "touch {{output}}"
115 copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" 115 copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
116 } 116 }
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