[llvm-branch-commits] [cfe-branch] r243299 - Merging r243262:

Renato Golin renato.golin at linaro.org
Mon Jul 27 11:29:53 PDT 2015


Author: rengolin
Date: Mon Jul 27 13:29:53 2015
New Revision: 243299

URL: http://llvm.org/viewvc/llvm-project?rev=243299&view=rev
Log:
Merging r243262:

Setting ARM dynamic linker name from commandline

Currently trigger to select hard-float linker is only based of -gnueabihf
appearing in target triplet, but we should also select it when hardfloat
is requested via cmdline.

Patch by Khem Raj.


Modified:
    cfe/branches/release_37/lib/Driver/Tools.cpp
    cfe/branches/release_37/test/Driver/linux-ld.c

Modified: cfe/branches/release_37/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/lib/Driver/Tools.cpp?rev=243299&r1=243298&r2=243299&view=diff
==============================================================================
--- cfe/branches/release_37/lib/Driver/Tools.cpp (original)
+++ cfe/branches/release_37/lib/Driver/Tools.cpp Mon Jul 27 13:29:53 2015
@@ -7865,13 +7865,15 @@ static std::string getLinuxDynamicLinker
   else if (Arch == llvm::Triple::aarch64_be)
     return "/lib/ld-linux-aarch64_be.so.1";
   else if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb) {
-    if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
+    if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF ||
+        tools::arm::getARMFloatABI(ToolChain.getDriver(), Args, ToolChain.getTriple()) == "hard")
       return "/lib/ld-linux-armhf.so.3";
     else
       return "/lib/ld-linux.so.3";
   } else if (Arch == llvm::Triple::armeb || Arch == llvm::Triple::thumbeb) {
     // TODO: check which dynamic linker name.
-    if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
+    if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF ||
+        tools::arm::getARMFloatABI(ToolChain.getDriver(), Args, ToolChain.getTriple()) == "hard")
       return "/lib/ld-linux-armhf.so.3";
     else
       return "/lib/ld-linux.so.3";

Modified: cfe/branches/release_37/test/Driver/linux-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/test/Driver/linux-ld.c?rev=243299&r1=243298&r2=243299&view=diff
==============================================================================
--- cfe/branches/release_37/test/Driver/linux-ld.c (original)
+++ cfe/branches/release_37/test/Driver/linux-ld.c Mon Jul 27 13:29:53 2015
@@ -618,6 +618,13 @@
 // CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3"
 //
 // RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN:     --target=arm-linux-gnueabi -mfloat-abi=hard \
+// RUN:   | FileCheck --check-prefix=CHECK-ARM-ABIHF %s
+// CHECK-ARM-ABIHF: "{{.*}}ld{{(.exe)?}}"
+// CHECK-ARM-ABIHF: "-m" "armelf_linux_eabi"
+// CHECK-ARM-ABIHF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
+//
+// RUN: %clang %s -### -o %t.o 2>&1 \
 // RUN:     --target=arm-linux-gnueabihf \
 // RUN:   | FileCheck --check-prefix=CHECK-ARM-HF %s
 // CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}"





More information about the llvm-branch-commits mailing list