Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.

Post-commit suggestion by Filipe Cabecinhas.

llvm-svn: 253161
This commit is contained in:
Yaron Keren 2015-11-15 08:06:27 +00:00
parent aa40ddd3ba
commit a7fa79fb9b
2 changed files with 2 additions and 4 deletions

View File

@ -9468,6 +9468,8 @@ void MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (LinkerName.equals_lower("lld")) {
CmdArgs.push_back("-flavor");
CmdArgs.push_back("gnu");
} else if (!LinkerName.equals_lower("ld")) {
D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
}
if (!D.SysRoot.empty())

View File

@ -7,10 +7,6 @@
// CHECK_LLD_32: lld" "-flavor" "gnu"
// CHECK_LLD_32: "i386pe"
// RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=link.exe 2>&1 | FileCheck -check-prefix=CHECK_LINK_32 %s
// CHECK_LINK_32: link.exe"
// CHECK_LINK_32: "i386pe"
// RUN: %clang -### -target x86_64-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 | FileCheck -check-prefix=CHECK_LLD_64 %s
// CHECK_LLD_64: lld" "-flavor" "gnu"
// CHECK_LLD_64: "i386pep"