[clang] 2c5d6df - [Hexagon] Make lld be the default linker for linux/musl
Sid Manning via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 6 10:59:26 PDT 2020
Author: Sid Manning
Date: 2020-04-06T12:59:07-05:00
New Revision: 2c5d6dfda98e409f6a6b4b577ebdf59a35ff2ebe
URL: https://github.com/llvm/llvm-project/commit/2c5d6dfda98e409f6a6b4b577ebdf59a35ff2ebe
DIFF: https://github.com/llvm/llvm-project/commit/2c5d6dfda98e409f6a6b4b577ebdf59a35ff2ebe.diff
LOG: [Hexagon] Make lld be the default linker for linux/musl
When the target is hexagon-unknown-linux-musl select lld as the default
linker.
Differential Revision: https://reviews.llvm.org/D77498
Added:
Modified:
clang/lib/Driver/ToolChains/Hexagon.h
clang/test/Driver/hexagon-toolchain-elf.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Hexagon.h b/clang/lib/Driver/ToolChains/Hexagon.h
index d7b4a13d3a4f..0158b9c42af9 100644
--- a/clang/lib/Driver/ToolChains/Hexagon.h
+++ b/clang/lib/Driver/ToolChains/Hexagon.h
@@ -81,7 +81,9 @@ class LLVM_LIBRARY_VISIBILITY HexagonToolChain : public Linux {
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
- const char *getDefaultLinker() const override { return "hexagon-link"; }
+ const char *getDefaultLinker() const override {
+ return getTriple().isMusl() ? "ld.lld" : "hexagon-link";
+ }
CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c
index fba1a891a361..ee5fb220d220 100644
--- a/clang/test/Driver/hexagon-toolchain-elf.c
+++ b/clang/test/Driver/hexagon-toolchain-elf.c
@@ -674,3 +674,15 @@
// RUN: | FileCheck -check-prefix=CHECK090 %s
// CHECK090-NOT: -fno-use-init-array
// -----------------------------------------------------------------------------
+// Check default linker for musl
+// -----------------------------------------------------------------------------
+// RUN: %clang -### -target hexagon-unknown-linux-musl %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK091 %s
+// CHECK091: ld.lld
+// -----------------------------------------------------------------------------
+// Check default linker for elf
+// -----------------------------------------------------------------------------
+// RUN: %clang -### -target hexagon-unknown-elf %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK092 %s
+// CHECK092: hexagon-link
+// -----------------------------------------------------------------------------
More information about the cfe-commits
mailing list