Support -fuse-ld=lld for riscv

Differential Revision: https://reviews.llvm.org/D74704
This commit is contained in:
serge-sans-paille 2020-02-17 13:42:00 +01:00
parent 58f66f8af0
commit dd230142d8
2 changed files with 5 additions and 1 deletions

View File

@ -142,7 +142,7 @@ void RISCV::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("elf32lriscv");
}
std::string Linker = getToolChain().GetProgramPath(getShortName());
std::string Linker = getToolChain().GetLinkerPath();
bool WantCRTs =
!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles);

View File

@ -3,6 +3,10 @@
// RUN: %clang %s -### -no-canonical-prefixes -target riscv32 2>&1 | FileCheck -check-prefix=CC1 %s
// CC1: clang{{.*}} "-cc1" "-triple" "riscv32"
// Test interaction with -fuse-ld=lld
// RUN: %clang %s -### -no-canonical-prefixes -target riscv32 -fuse-ld=lld 2>&1 | FileCheck -check-prefix=LLD %s
// LLD: ld.lld
// In the below tests, --rtlib=platform is used so that the driver ignores
// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib