diff options
Diffstat (limited to 'contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff')
-rw-r--r-- | contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff b/contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff new file mode 100644 index 0000000..9e3ce43 --- /dev/null +++ b/contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff @@ -0,0 +1,44 @@ +Pull in r198912 from upstream clang trunk (by Jakob Stoklund Olesen): + + Give the linker the right ELF type for SPARC targets. + +Introduced here: http://svn.freebsd.org/changeset/base/262262 + +Index: tools/clang/lib/Driver/Tools.cpp +=================================================================== +--- tools/clang/lib/Driver/Tools.cpp ++++ tools/clang/lib/Driver/Tools.cpp +@@ -6461,6 +6461,10 @@ void gnutools::Link::ConstructJob(Compilation &C, + CmdArgs.push_back("elf32ppclinux"); + else if (ToolChain.getArch() == llvm::Triple::ppc64) + CmdArgs.push_back("elf64ppc"); ++ else if (ToolChain.getArch() == llvm::Triple::sparc) ++ CmdArgs.push_back("elf32_sparc"); ++ else if (ToolChain.getArch() == llvm::Triple::sparcv9) ++ CmdArgs.push_back("elf64_sparc"); + else if (ToolChain.getArch() == llvm::Triple::mips) + CmdArgs.push_back("elf32btsmip"); + else if (ToolChain.getArch() == llvm::Triple::mipsel) +Index: tools/clang/test/Driver/linux-ld.c +=================================================================== +--- tools/clang/test/Driver/linux-ld.c ++++ tools/clang/test/Driver/linux-ld.c +@@ -384,6 +384,18 @@ + // CHECK-MIPS64EL-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1" + // CHECK-MIPS64EL-N32-NOT: "--hash-style={{gnu|both}}" + // ++// RUN: %clang %s -### -o %t.o 2>&1 \ ++// RUN: --target=sparc-linux-gnu \ ++// RUN: | FileCheck --check-prefix=CHECK-SPARCV8 %s ++// CHECK-SPARCV8: "{{.*}}ld{{(.exe)?}}" ++// CHECK-SPARCV8: "-m" "elf32_sparc" ++// ++// 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" ++// + // Thoroughly exercise the Debian multiarch environment. + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=i686-linux-gnu \ |