summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-01-28 19:32:52 +0000
committerNico Weber <nicolasweber@gmx.de>2019-01-28 19:32:52 +0000
commitb4980cd84f4c80f7c6b505972390c56ea34a0ac8 (patch)
treed03c72dec66be3057e5503ca22a86e867f1d56d5 /llvm/utils
parentb5d6292822c87dd66cc7646ddd9db180723a3233 (diff)
downloadbcm5719-llvm-b4980cd84f4c80f7c6b505972390c56ea34a0ac8.tar.gz
bcm5719-llvm-b4980cd84f4c80f7c6b505972390c56ea34a0ac8.zip
gn build: Fix `lld-link: unknown flag: -fuse-ld=lld` warnings on Windows
Fixes a minor regression from r351248. While here, also make it possible to opt out of lld by saying use_lld=false when clang_base_path is set. (use_lld still defaults to true if clang_base_path is set.) llvm-svn: 352415
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/gn/build/BUILD.gn3
-rw-r--r--llvm/utils/gn/build/toolchain/BUILD.gn4
2 files changed, 5 insertions, 2 deletions
diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn
index 18e25827aaf..4c5c3bbbb39 100644
--- a/llvm/utils/gn/build/BUILD.gn
+++ b/llvm/utils/gn/build/BUILD.gn
@@ -122,7 +122,8 @@ config("compiler_defaults") {
}
}
- if (use_lld) {
+ # On Windows, the linker is not invoked through the compiler driver.
+ if (use_lld && host_os != "win") {
ldflags += [ "-fuse-ld=lld" ]
}
}
diff --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn
index 8f5f14faa3d..4be5e4b8f31 100644
--- a/llvm/utils/gn/build/toolchain/BUILD.gn
+++ b/llvm/utils/gn/build/toolchain/BUILD.gn
@@ -197,7 +197,9 @@ toolchain("win") {
if (clang_base_path != "") {
cl = "$clang_base_path/bin/clang-cl"
- link = "$clang_base_path/bin/lld-link"
+ if (use_lld) {
+ link = "$clang_base_path/bin/lld-link"
+ }
}
if (use_goma) {
OpenPOWER on IntegriCloud