[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
This commit is contained in:
Sid Manning 2020-04-04 19:36:00 -05:00
parent 8a42bf24ae
commit 2c5d6dfda9
2 changed files with 15 additions and 1 deletions

View File

@ -81,7 +81,9 @@ public:
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;

View File

@ -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
// -----------------------------------------------------------------------------