From: Jakob Stoklund Olesen Date: Fri, 10 Jan 2014 08:18:34 +0000 (+0000) Subject: Use the right dynamic linker for SPARC Linux executables. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=609e20d0de590ebb1ddc387b595f4d264611340b;p=clang Use the right dynamic linker for SPARC Linux executables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198923 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index a9aeab0151..9a43afe7d4 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -6440,7 +6440,8 @@ static StringRef getLinuxDynamicLinker(const ArgList &Args, const toolchains::Linux &ToolChain) { if (ToolChain.getTriple().getEnvironment() == llvm::Triple::Android) return "/system/bin/linker"; - else if (ToolChain.getArch() == llvm::Triple::x86) + else if (ToolChain.getArch() == llvm::Triple::x86 || + ToolChain.getArch() == llvm::Triple::sparc) return "/lib/ld-linux.so.2"; else if (ToolChain.getArch() == llvm::Triple::aarch64) return "/lib/ld-linux-aarch64.so.1"; @@ -6465,6 +6466,8 @@ static StringRef getLinuxDynamicLinker(const ArgList &Args, ToolChain.getArch() == llvm::Triple::ppc64le || ToolChain.getArch() == llvm::Triple::systemz) return "/lib64/ld64.so.1"; + else if (ToolChain.getArch() == llvm::Triple::sparcv9) + return "/lib64/ld-linux.so.2"; else return "/lib64/ld-linux-x86-64.so.2"; } diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c index 702728eca5..77464adc05 100644 --- a/test/Driver/linux-ld.c +++ b/test/Driver/linux-ld.c @@ -389,12 +389,14 @@ // RUN: | FileCheck --check-prefix=CHECK-SPARCV8 %s // CHECK-SPARCV8: "{{.*}}ld{{(.exe)?}}" // CHECK-SPARCV8: "-m" "elf32_sparc" +// CHECK-SPARCV8: "-dynamic-linker" "/lib/ld-linux.so.2" // // RUN: %clang %s -### -o %t.o 2>&1 \ // RUN: --target=sparcv9-linux-gnu \ // RUN: | FileCheck --check-prefix=CHECK-SPARCV9 %s // CHECK-SPARCV9: "{{.*}}ld{{(.exe)?}}" // CHECK-SPARCV9: "-m" "elf64_sparc" +// CHECK-SPARCV9: "-dynamic-linker" "/lib64/ld-linux.so.2" // // Thoroughly exercise the Debian multiarch environment. // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \