Skip to content

Commit

Permalink
[Hexagon] Make lld be the default linker for linux/musl
Browse files Browse the repository at this point in the history
When the target is hexagon-unknown-linux-musl select lld as the default
linker.

Differential Revision: https://reviews.llvm.org/D77498
  • Loading branch information
SidManning committed Apr 6, 2020
1 parent 8a42bf2 commit 2c5d6df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clang/lib/Driver/ToolChains/Hexagon.h
Expand Up @@ -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;

Expand Down
12 changes: 12 additions & 0 deletions clang/test/Driver/hexagon-toolchain-elf.c
Expand Up @@ -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
// -----------------------------------------------------------------------------

0 comments on commit 2c5d6df

Please sign in to comment.