mgorny      14/09/07 11:12:00

  Added:                clang-3.5-gentoo-runtime-gcc-detection-v3.patch
                        llvm-3.5-gcc-4.9.patch
  Log:
  Version bump, bug #522188.
  
  (Portage version: 2.2.12/cvs/Linux x86_64, signed Manifest commit with key 
EFB4464E!)

Revision  Changes    Path
1.1                  
sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch?rev=1.1&content-type=text/plain

Index: clang-3.5-gentoo-runtime-gcc-detection-v3.patch
===================================================================
>From 699d0b958b4d8fb42348d324ef805345b0cbc06b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
Date: Fri, 5 Sep 2014 16:49:35 +0200
Subject: [PATCH] Support obtaining active toolchain from gcc-config.

---
 tools/clang/lib/Driver/ToolChains.cpp | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/clang/lib/Driver/ToolChains.cpp 
b/tools/clang/lib/Driver/ToolChains.cpp
index b46f69d..f3e986c 100644
--- a/tools/clang/lib/Driver/ToolChains.cpp
+++ b/tools/clang/lib/Driver/ToolChains.cpp
@@ -1253,6 +1253,26 @@ Generic_GCC::GCCInstallationDetector::init(
       Prefixes.push_back("/usr");
   }
 
+  for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) {
+    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
+        llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + 
CandidateTripleAliases[k].str());
+    if (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");
-- 
2.1.0




1.1                  sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch?rev=1.1&content-type=text/plain

Index: llvm-3.5-gcc-4.9.patch
===================================================================
commit 080fb498017d17af2e4d7563608c7d8a848f20da
Author: Sanjoy Das <sanjoy at azulsystems.com>
Date:   Thu Jun 19 15:38:02 2014 -0700

    Fix the --enable-shared build.
    
    Currently a build configured with ./configure --enable-shared breaks
    with an undefined "llvm::cl::parser<llvm::PassInfo
    const*>::getOption(unsigned int) const" symbol when linking opt.  This
    body for this symbol gets emitted into Pass.o (along with the destructor
    for PassNameParser), but gets linked into libLLVM-3.5svn.so with local
    visibility, causing the link error.
    
    This fix uses the existing EXTERN_TEMPLATE machinery to force a globally
    visible definition for the functions in parser<const PassInfo *> into
    Pass.o.

diff --git a/include/llvm/IR/LegacyPassNameParser.h 
b/include/llvm/IR/LegacyPassNameParser.h
index e2e4912..a07e3fd 100644
--- a/include/llvm/IR/LegacyPassNameParser.h
+++ b/include/llvm/IR/LegacyPassNameParser.h
@@ -95,6 +95,8 @@ private:
   }
 };
 
+EXTERN_TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
+
 
///===----------------------------------------------------------------------===//
 /// FilteredPassNameParser class - Make use of the pass registration
 /// mechanism to automatically add a command line argument to opt for
diff --git a/lib/IR/Pass.cpp b/lib/IR/Pass.cpp
index 91d86ae..00ce223 100644
--- a/lib/IR/Pass.cpp
+++ b/lib/IR/Pass.cpp
@@ -234,6 +234,8 @@ PassNameParser::~PassNameParser() {
   // attempting to remove the registration listener is an error.
 }
 
+TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
+
 
//===----------------------------------------------------------------------===//
 //   AnalysisUsage Class Implementation
 //




Reply via email to