r251493 - Driver: support -fuse-ld= on cross windows

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 21:45:58 PDT 2015


Author: compnerd
Date: Tue Oct 27 23:45:58 2015
New Revision: 251493

URL: http://llvm.org/viewvc/llvm-project?rev=251493&view=rev
Log:
Driver: support -fuse-ld= on cross windows

Update the linker selection to support the `-fuse-ld=` option for selecting a
linker.

Added:
    cfe/trunk/test/Driver/Inputs/Windows/ARM/8.1/usr/bin/ld.lld-link2   (with props)
Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/windows-cross.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=251493&r1=251492&r2=251493&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Oct 27 23:45:58 2015
@@ -9750,8 +9750,7 @@ void CrossWindows::Linker::ConstructJob(
     }
   }
 
-  const std::string Linker = TC.GetProgramPath("ld");
-  Exec = Args.MakeArgString(Linker);
+  Exec = Args.MakeArgString(TC.GetLinkerPath());
 
   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
 }

Added: cfe/trunk/test/Driver/Inputs/Windows/ARM/8.1/usr/bin/ld.lld-link2
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/Windows/ARM/8.1/usr/bin/ld.lld-link2?rev=251493&view=auto
==============================================================================
    (empty)

Propchange: cfe/trunk/test/Driver/Inputs/Windows/ARM/8.1/usr/bin/ld.lld-link2
------------------------------------------------------------------------------
    svn:executable = *

Modified: cfe/trunk/test/Driver/windows-cross.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/windows-cross.c?rev=251493&r1=251492&r2=251493&view=diff
==============================================================================
--- cfe/trunk/test/Driver/windows-cross.c (original)
+++ cfe/trunk/test/Driver/windows-cross.c Tue Oct 27 23:45:58 2015
@@ -38,3 +38,7 @@
 
 // CHECK-LIBSTDCXX:  "-internal-isystem" "{{.*}}/usr/include/c++" "-internal-isystem" "{{.*}}/usr/include/c++/armv7--windows-itanium" "-internal-isystem" "{{.*}}/usr/include/c++/backwards"
 
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -x c++ %s 2>&1 \
+// RUN:    | FileCheck %s --check-prefix CHECK-FUSE-LD
+// CHECK-FUSE-LD: "{{.*}}lld-link2"
+




More information about the cfe-commits mailing list