Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -7863,13 +7863,15 @@ 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"; Index: test/Driver/linux-ld.c =================================================================== --- test/Driver/linux-ld.c +++ test/Driver/linux-ld.c @@ -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)?}}"