From 4f60e73bd8c2ee40ef6d419e15860bfbfba4c619 Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Sun, 15 Nov 2015 08:06:27 +0000 Subject: [PATCH] Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld. Post-commit suggestion by Filipe Cabecinhas. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253161 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 2 ++ test/Driver/mingw-useld.c | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 436f6401c2..3f07ad6eb4 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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()) diff --git a/test/Driver/mingw-useld.c b/test/Driver/mingw-useld.c index 0d894d7538..43a811ce8b 100644 --- a/test/Driver/mingw-useld.c +++ b/test/Driver/mingw-useld.c @@ -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" -- 2.40.0