Commit a25e3672 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Reland "win: Link with lld instead of link.exe by default"

The nacl browser_test failures on Win7 that caused the last revert are fixed.
There's a known bug about this regressing binary size (crbug.com/838449),
but with in-progress patches binary size will soon be 200 kB smaller and
these should all be rolled in by branch point, so let's reland this to find
more unknown unknowns.

Original change's description:
> win: Link with lld instead of MSVC's link.exe by default
>
> lld is LLVM's linker. It produces PE/COFF and PDB files just like
> link.exe, but it's significantly faster and it can also handle LLVM's
> internal representation, which will enable us to do link-time
> optimization and control-flow integraty checks with Clang.
>
> While lld is much faster at linking, it doesn't support incremental
> links, meaning builds that only touch a few files and re-link a large
> executable may become slower.
>
> This is the first attempt at switching everything over, with the
> purpose of gathering data and finding unknown unknowns. It's likely
> temporary until something breaks.
>
> is_win_fastlink is implicitly ignored when using lld, as lld without
> fastlink is faster than link.exe with it.
>
> Also switch the CrWinClangLLD bots on chromium.clang to use MSVC's
> link.exe to make sure that configuration keeps working.
>
> Bug: 792131

Change-Id: I18aba7a66c54c87092a13745f0ca213171ec25db
Reviewed-on: https://chromium-review.googlesource.com/1054521
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarReid Kleckner <rnk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557987}
parent 3ef23fc2
......@@ -162,12 +162,12 @@ declare_args() {
# Linux or Fuchsia.
# TODO(pcc): Enable lld on more architectures on Linux. E.g. we probably need
# to fix some of crbug.com/742655 to enable it on ARM.
use_lld = is_clang &&
((is_win && host_os != "win") || is_fuchsia ||
(use_thin_lto && target_os != "chromeos") ||
(is_linux && current_cpu == "x64" && target_os != "chromeos") ||
(is_android && (current_cpu != "arm" || arm_version >= 7) &&
current_cpu != "mipsel" && current_cpu != "mips64el"))
use_lld =
is_clang &&
(is_win || is_fuchsia || (use_thin_lto && target_os != "chromeos") ||
(is_linux && current_cpu == "x64" && target_os != "chromeos") ||
(is_android && (current_cpu != "arm" || arm_version >= 7) &&
current_cpu != "mipsel" && current_cpu != "mips64el"))
}
declare_args() {
......
......@@ -115,10 +115,10 @@
'CrWinAsan(dll)': 'asan_clang_shared_v8_heap_x86_full_symbols_release',
'CrWinAsanCov': 'asan_clang_edge_fuzzer_static_v8_heap_x86_full_symbols_release',
'CrWinClangLLD': 'clang_tot_official_static_use_lld_x86',
'CrWinClangLLD64': 'clang_tot_shared_release_use_lld_dcheck',
'CrWinClngLLD64dbg': 'clang_tot_full_symbols_shared_debug_use_lld',
'CrWinClngLLDdbg': 'clang_tot_full_symbols_shared_debug_use_lld_x86',
'CrWinClangLLD': 'clang_tot_official_static_no_lld_x86',
'CrWinClangLLD64': 'clang_tot_shared_release_no_lld_dcheck',
'CrWinClngLLD64dbg': 'clang_tot_full_symbols_shared_debug_no_lld',
'CrWinClngLLDdbg': 'clang_tot_full_symbols_shared_debug_no_lld_x86',
'linux-win_cross-rel': 'clang_tot_win_release_cross',
'ToTAndroid': 'android_clang_tot_release_minimal_symbols',
'ToTAndroid64': 'android_clang_tot_release_arm64',
......@@ -1119,24 +1119,24 @@
'clang_tot', 'shared', 'debug',
],
'clang_tot_full_symbols_shared_debug_use_lld': [
'clang_tot', 'full_symbols', 'shared', 'debug', 'use_lld',
'clang_tot_full_symbols_shared_debug_no_lld': [
'clang_tot', 'full_symbols', 'shared', 'debug', 'no_lld',
],
'clang_tot_full_symbols_shared_debug_use_lld_x86': [
'clang_tot', 'full_symbols', 'shared', 'debug', 'use_lld', 'x86',
'clang_tot_full_symbols_shared_debug_no_lld_x86': [
'clang_tot', 'full_symbols', 'shared', 'debug', 'no_lld', 'x86',
],
'clang_tot_shared_debug_x86': [
'clang_tot', 'shared', 'debug', 'x86',
],
'clang_tot_shared_release_use_lld_dcheck': [
'clang_tot', 'minimal_symbols', 'shared', 'release', 'use_lld', 'dcheck_always_on',
'clang_tot_shared_release_no_lld_dcheck': [
'clang_tot', 'minimal_symbols', 'shared', 'release', 'no_lld', 'dcheck_always_on',
],
'clang_tot_official_static_use_lld_x86': [
'clang_tot', 'minimal_symbols', 'official', 'static', 'release', 'use_lld', 'x86',
'clang_tot_official_static_no_lld_x86': [
'clang_tot', 'minimal_symbols', 'official', 'static', 'release', 'no_lld', 'x86',
],
'clang_tot_minimal_symbols_shared_release': [
......@@ -2087,6 +2087,10 @@
'gn_args': 'use_lld=true',
},
'no_lld': {
'gn_args': 'use_lld=false',
},
'use_vaapi': {
'gn_args': 'use_vaapi=true',
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment