[PATCH] D39176: [Driver] Use ld.lld directly for Fuchsia rather than passing flavor
Petr Hosek via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 23 14:31:25 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL316379: [Driver] Use ld.lld directly for Fuchsia rather than passing flavor (authored by phosek).
Changed prior to commit:
https://reviews.llvm.org/D39176?vs=119923&id=119938#toc
Repository:
rL LLVM
https://reviews.llvm.org/D39176
Files:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
cfe/trunk/test/Driver/fuchsia.c
cfe/trunk/test/Driver/fuchsia.cpp
Index: cfe/trunk/test/Driver/fuchsia.c
===================================================================
--- cfe/trunk/test/Driver/fuchsia.c
+++ cfe/trunk/test/Driver/fuchsia.c
@@ -1,16 +1,15 @@
// RUN: %clang %s -### -no-canonical-prefixes --target=x86_64-unknown-fuchsia \
-// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
+// RUN: --sysroot=%S/platform 2>&1 \
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
// RUN: %clang %s -### -no-canonical-prefixes --target=aarch64-unknown-fuchsia \
-// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
+// RUN: --sysroot=%S/platform 2>&1 \
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
// CHECK: {{.*}}clang{{.*}}" "-cc1"
// CHECK: "-munwind-tables"
// CHECK: "-fuse-init-array"
// CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
-// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
-// CHECK: "-z" "rodynamic"
+// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"
Index: cfe/trunk/test/Driver/fuchsia.cpp
===================================================================
--- cfe/trunk/test/Driver/fuchsia.cpp
+++ cfe/trunk/test/Driver/fuchsia.cpp
@@ -1,13 +1,12 @@
// RUN: %clangxx %s -### -no-canonical-prefixes --target=x86_64-unknown-fuchsia \
-// RUN: --sysroot=%S/platform 2>&1 -fuse-ld=ld | FileCheck %s
+// RUN: --sysroot=%S/platform 2>&1 | FileCheck %s
// CHECK: {{.*}}clang{{.*}}" "-cc1"
// CHECK: "-triple" "x86_64-fuchsia"
// CHECK: "-fuse-init-array"
// CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK: "-internal-isystem" "{{.*[/\\]}}x86_64-fuchsia{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
// CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
-// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
-// CHECK: "-z" "rodynamic"
+// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"
Index: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
@@ -44,10 +44,8 @@
Args.ClaimAllArgs(options::OPT_w);
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
- if (llvm::sys::path::stem(Exec).equals_lower("lld")) {
- CmdArgs.push_back("-flavor");
- CmdArgs.push_back("gnu");
-
+ if (llvm::sys::path::filename(Exec).equals_lower("ld.lld") ||
+ llvm::sys::path::stem(Exec).equals_lower("ld.lld")) {
CmdArgs.push_back("-z");
CmdArgs.push_back("rodynamic");
}
Index: cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
@@ -82,7 +82,7 @@
llvm::opt::ArgStringList &CmdArgs) const override;
const char *getDefaultLinker() const override {
- return "lld";
+ return "ld.lld";
}
protected:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39176.119938.patch
Type: text/x-patch
Size: 3095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171023/abccb77a/attachment-0001.bin>
More information about the cfe-commits
mailing list