diff options
Diffstat (limited to 'sys-devel/llvm/files/3.4.2/clang')
3 files changed, 156 insertions, 0 deletions
diff --git a/sys-devel/llvm/files/3.4.2/clang/darwin_build_fix.patch b/sys-devel/llvm/files/3.4.2/clang/darwin_build_fix.patch new file mode 100644 index 000000000000..113b04bc6637 --- /dev/null +++ b/sys-devel/llvm/files/3.4.2/clang/darwin_build_fix.patch @@ -0,0 +1,47 @@ +Our (gcc/binutils) toolchain doesn't do ARM targets, hence we will get +"unable to interface with target machine" errors while building if we +attempt to. Disable those targets. + +Patch by Reza Jelveh from +https://github.com/fishman/timebomb-gentoo-osx-overlay/blob/master/sys-devel/llvm/files/llvm-3.4-fix_darwin_build.patch + +--- a/projects/compiler-rt/make/platform/clang_darwin_embedded.mk ++++ b/projects/compiler-rt/make/platform/clang_darwin_embedded.mk +@@ -27,20 +27,20 @@ UniversalArchs := + # Soft-float version of the runtime. No floating-point instructions will be used + # and the ABI (out of necessity) passes floating values in normal registers: + # non-VFP variant of the AAPCS. +-Configs += soft_static +-UniversalArchs.soft_static := armv6m armv7m armv7em armv7 ++# Configs += soft_static ++# UniversalArchs.soft_static := armv6m armv7m armv7em armv7 + + # Hard-float version of the runtime. On ARM VFP instructions and registers are + # allowed, and floating point values get passed in them. VFP variant of the + # AAPCS. + Configs += hard_static +-UniversalArchs.hard_static := armv7em armv7 i386 x86_64 ++UniversalArchs.hard_static := i386 x86_64 + +-Configs += soft_pic +-UniversalArchs.soft_pic := armv6m armv7m armv7em armv7 ++# Configs += soft_pic ++# UniversalArchs.soft_pic := armv6m armv7m armv7em armv7 + + Configs += hard_pic +-UniversalArchs.hard_pic := armv7em armv7 i386 x86_64 ++UniversalArchs.hard_pic := i386 x86_64 + + CFLAGS := -Wall -Werror -Oz -fomit-frame-pointer -ffreestanding + +--- a/tools/clang/runtime/compiler-rt/Makefile ++++ b/tools/clang/runtime/compiler-rt/Makefile +@@ -85,7 +85,7 @@ RuntimeLibrary.darwin.Configs := \ + profile_osx.a profile_ios.a \ + ubsan_osx.a + RuntimeLibrary.darwin_embedded.Configs := \ +- soft_static.a hard_static.a soft_pic.a hard_pic.a ++ hard_static.a hard_pic.a + + # Support building compiler-rt with relocatable SDKs. + # diff --git a/sys-devel/llvm/files/3.4.2/clang/gentoo-install.patch b/sys-devel/llvm/files/3.4.2/clang/gentoo-install.patch new file mode 100644 index 000000000000..0a1d9eb3c353 --- /dev/null +++ b/sys-devel/llvm/files/3.4.2/clang/gentoo-install.patch @@ -0,0 +1,80 @@ +From a12fc090b3b43fe25c7de50c09782611e3834aeb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sat, 14 Jun 2014 19:35:33 +0200 +Subject: [PATCH] clang gentoo fixes + +--- + tools/clang/lib/Driver/Tools.cpp | 6 +++--- + tools/clang/tools/scan-build/scan-build | 4 ++-- + tools/clang/tools/scan-view/scan-view | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp +index b013eb5..dbbcacb 100644 +--- a/tools/clang/lib/Driver/Tools.cpp ++++ b/tools/clang/lib/Driver/Tools.cpp +@@ -222,7 +222,7 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args, + // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is + // not supported by old linkers. + std::string ProfileRT = +- std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a"; ++ "-l:libprofile_rt.a"; + + CmdArgs.push_back(Args.MakeArgString(ProfileRT)); + } +@@ -5911,7 +5911,7 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA, + // forward. + if (D.IsUsingLTO(Args)) { + CmdArgs.push_back("-plugin"); +- std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so"; ++ std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so"; + CmdArgs.push_back(Args.MakeArgString(Plugin)); + + // Try to pass driver level flags relevant to LTO code generation down to +@@ -6534,7 +6534,7 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA, + // forward. + if (D.IsUsingLTO(Args)) { + CmdArgs.push_back("-plugin"); +- std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so"; ++ std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so"; + CmdArgs.push_back(Args.MakeArgString(Plugin)); + + // Try to pass driver level flags relevant to LTO code generation down to +diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build +index 0f119f6..58f78d9 100755 +--- a/tools/clang/tools/scan-build/scan-build ++++ b/tools/clang/tools/scan-build/scan-build +@@ -419,7 +419,7 @@ sub CopyFiles { + + my $Dir = shift; + +- my $JS = Cwd::realpath("$RealBin/sorttable.js"); ++ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js"); + + DieDiag("Cannot find 'sorttable.js'.\n") + if (! -r $JS); +@@ -429,7 +429,7 @@ sub CopyFiles { + DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n") + if (! -r "$Dir/sorttable.js"); + +- my $CSS = Cwd::realpath("$RealBin/scanview.css"); ++ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css"); + + DieDiag("Cannot find 'scanview.css'.\n") + if (! -r $CSS); +diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view +index fb27da6..1f8ddb8 100755 +--- a/tools/clang/tools/scan-view/scan-view ++++ b/tools/clang/tools/scan-view/scan-view +@@ -54,7 +54,7 @@ def start_browser(port, options): + webbrowser.open(url) + + def run(port, options, root): +- import ScanView ++ from clang import ScanView + try: + print 'Starting scan-view at: http://%s:%d'%(options.host, + port) +-- +2.0.0 + diff --git a/sys-devel/llvm/files/3.4.2/clang/gentoo-runtime-gcc-detection-v3.patch b/sys-devel/llvm/files/3.4.2/clang/gentoo-runtime-gcc-detection-v3.patch new file mode 100644 index 000000000000..49f108533404 --- /dev/null +++ b/sys-devel/llvm/files/3.4.2/clang/gentoo-runtime-gcc-detection-v3.patch @@ -0,0 +1,29 @@ +diff -upNr a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp +--- a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-24 03:32:31.593191000 -0400 ++++ b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-24 03:38:31.733163513 -0400 +@@ -1145,6 +1145,25 @@ Generic_GCC::GCCInstallationDetector::GC + Prefixes.push_back(D.InstalledDir + "/.."); + } + ++ llvm::OwningPtr<llvm::MemoryBuffer> File; ++ for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) { ++ if (!llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str(), File)) ++ { ++ bool Exists; ++ const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str(); ++ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText; ++ if (!llvm::sys::fs::exists(GentooPath + "/crtbegin.o", Exists) && Exists) ++ { ++ Version = GCCVersion::Parse(VersionText); ++ GCCInstallPath = GentooPath; ++ GCCParentLibPath = GCCInstallPath + "/../../.."; ++ GCCTriple.setTriple(CandidateTripleAliases[k]); ++ IsValid = true; ++ return; ++ } ++ } ++ } ++ + // Loop over the various components which exist and select the best GCC + // installation available. GCC installs are ranked by version number. + Version = GCCVersion::Parse("0.0.0"); |