Commit 979ca1f9 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Set use_lld = false in nacl toolchains and reland "Let lld emit colored...

Set use_lld = false in nacl toolchains and reland "Let lld emit colored diagnostics when invoked from ninja."

This reverts commit 18da5f23.

Reason for revert: The original commit broke the CFI bot with errors like:

  src/native_client/toolchain/linux_x86/pnacl_newlib/bin/../x86_64-nacl/bin/ld:
      unrecognized option '--color-diagnostics'

I do not know why this only happened on the CFI bot (XXX), but since we only add
-fuse-ld=lld if !is_nacl, we should set use_lld to false in the nacl toolchains,
which fixes this, and probably many future issues like it.

Original change's description:
> Revert "Let lld emit colored diagnostics when invoked from ninja."
>
> This reverts commit 00db3ddc.
>
> Reason for revert: Breaks Linux CFI build here: https://ci.chromium.org/buildbot/chromium.memory/Linux%20CFI/8024
>
> Original change's description:
> > Let lld emit colored diagnostics when invoked from ninja.
> >
> > Bug: 841221
> > Change-Id: I72d13c78a2c623865a4f29542d25f6b3488b350b
> > Reviewed-on: https://chromium-review.googlesource.com/1067460
> > Reviewed-by: Reid Kleckner <rnk@chromium.org>
> > Commit-Queue: Nico Weber <thakis@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#560343}
>
> TBR=thakis@chromium.org,rnk@chromium.org
>
> Change-Id: I3811083daa622dca605ca32be5cc4c7098b60b4a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 841221
> Reviewed-on: https://chromium-review.googlesource.com/1067949
> Reviewed-by: Tommy Li <tommycli@chromium.org>
> Commit-Queue: Tommy Li <tommycli@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#560345}

TBR=thakis@chromium.org,rnk@chromium.org,tommycli@chromium.org

Change-Id: I5d4c9298e3613ab84650f081a59715880d780805
Bug: 841221
Reviewed-on: https://chromium-review.googlesource.com/1068218
Commit-Queue: Reid Kleckner <rnk@chromium.org>
Reviewed-by: default avatarReid Kleckner <rnk@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560676}
parent bdccf741
......@@ -153,7 +153,7 @@ declare_args() {
# lld doesn't have the bug.
use_icf = (is_posix || is_fuchsia) && !using_sanitizer &&
!(is_android && use_order_profiling) &&
((use_lld && !is_nacl) ||
(use_lld ||
(use_gold &&
((!is_android && linux_use_bundled_binutils) || is_chromeos ||
!(current_cpu == "x86" || current_cpu == "x64"))))
......@@ -398,7 +398,7 @@ config("compiler") {
ldflags += [ "--gcc-toolchain=$_rebased_android_toolchain_root" ]
}
if (((is_posix || is_fuchsia) && use_lld && !is_nacl) ||
if (((is_posix || is_fuchsia) && use_lld) ||
(target_os == "chromeos" && is_android)) {
# NOTE: Some Chrome OS builds globally disable LLD, but they also build some
# targets against Android toolchains which should use LLD. Therefore we
......@@ -475,6 +475,19 @@ config("compiler") {
cflags += [ "-fmerge-all-constants" ]
}
if (use_lld) {
# TODO(thakis): Make the driver pass --color-diagnostics to the linker
# if -fcolor-diagnostics is passed to it, and pass -fcolor-diagnostics
# in ldflags instead.
if (is_win) {
# On Windows, we call the linker directly, instead of calling it through
# the driver.
ldflags += [ "--color-diagnostics" ]
} else {
ldflags += [ "-Wl,--color-diagnostics" ]
}
}
if (is_clang && !is_nacl && current_toolchain == host_toolchain &&
target_os != "chromeos") {
cflags += [
......
......@@ -87,6 +87,7 @@ template("pnacl_toolchain") {
toolchain_args = {
is_clang = true
current_cpu = "pnacl"
use_lld = false
}
}
}
......@@ -141,6 +142,7 @@ template("nacl_glibc_toolchain") {
current_cpu = toolchain_cpu
is_clang = false
is_nacl_glibc = true
use_lld = false
}
}
}
......@@ -191,6 +193,7 @@ template("nacl_clang_toolchain") {
toolchain_args = {
current_cpu = toolchain_cpu
is_clang = true
use_lld = false
}
}
}
......@@ -229,6 +232,7 @@ template("nacl_irt_toolchain") {
toolchain_args = {
current_cpu = toolchain_cpu
is_clang = true
use_lld = false
}
# TODO(ncbray): depend on link script
......
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