]> granicus.if.org Git - clang/commitdiff
Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.
authorYaron Keren <yaron.keren@gmail.com>
Sun, 15 Nov 2015 08:06:27 +0000 (08:06 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Sun, 15 Nov 2015 08:06:27 +0000 (08:06 +0000)
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
test/Driver/mingw-useld.c

index 436f6401c2b1ace9d5b8779f0db2c6c87898c3ea..3f07ad6eb483a797f573c7e9b9b059f1a52bf843 100644 (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())
index 0d894d753819124b0dce2a1b2684e1c0413ff578..43a811ce8b7c7fa577dba47e6f3d4c5ca8c2ae01 100644 (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"