Switch to LLD as the default linker on Linux/x64, take 2.

Previous attempt: https://chromium-review.googlesource.com/c/chromium/src/+/698292

This time, the use_lld default uses current_{os,cpu} instead of
target_{os,cpu}, which prevents it from defaulting to true when
targeting NaCl.

Bug: 607968, 682777
Change-Id: Iedf5b2f9850df249172b7b543af312318e9beae9
Reviewed-on: https://chromium-review.googlesource.com/699741
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#506313}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5581f58e288ebc2a6963dd434335d224b8f6297f
This commit is contained in:
Peter Collingbourne 2017-10-04 05:42:43 +00:00 коммит произвёл Commit Bot
Родитель 4d898c0e0b
Коммит 851b183fd8
2 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -126,8 +126,8 @@ if (gold_path == false) {
}
if (use_debug_fission == "default") {
use_debug_fission =
is_debug && !is_android && !is_win && use_gold && cc_wrapper == ""
use_debug_fission = is_debug && !is_android && !is_win &&
(use_gold || use_lld) && cc_wrapper == ""
}
# default_include_dirs ---------------------------------------------------------
@ -1817,12 +1817,13 @@ config("symbols") {
# obj/native_client/src/trusted/service_runtime/sel_asm/nacl_switch_32.o:
# DWARF info may be corrupt; offsets in a range list entry are in different
# sections" there. Maybe just a bug in nacl_switch_32.S.
# TODO(thakis): Figure out if there's a way to make this go for official
# builds, currently get
# "third_party/binutils/Linux_x64/Release/bin/ld.gold: warning:
# /tmp/lto-llvm-0b5201.o: corrupt debug info in .debug_info"
if (!is_mac && !is_ios && !is_nacl && target_cpu != "x86" &&
(use_gold || use_lld) && !use_thin_lto && !is_official_build) {
(use_gold || use_lld)) {
# This flag enables the GNU-format pubnames and pubtypes sections, which
# lld needs in order to generate a correct GDB index.
# TODO(pcc): Try to make lld understand non-GNU-format pubnames sections
# (llvm.org/PR34820).
cflags += [ "-ggnu-pubnames" ]
ldflags += [ "-Wl,--gdb-index" ]
}
}

Просмотреть файл

@ -149,8 +149,11 @@ declare_args() {
declare_args() {
# Set to true to use lld, the LLVM linker. This flag may be used on Windows,
# 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_win && host_os != "win") || is_fuchsia ||
(use_thin_lto && target_os != "chromeos")
(use_thin_lto && target_os != "chromeos") ||
(is_linux && current_cpu == "x64" && target_os != "chromeos")
}
declare_args() {