aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Arnold <stephen.arnold42@gmail.com>2015-01-22 12:34:52 -0800
committerSteve Arnold <stephen.arnold42@gmail.com>2015-01-22 12:34:52 -0800
commit25e18dcd7776654f3fc1e3af53e7f1f50abac1ec (patch)
treeec49e7797c436a755c1e88c329d882e570cdcd5f /sys-devel
parentupdated libdrm ebuilds and added arm patch from meta-fsl (diff)
downloadarm-25e18dcd7776654f3fc1e3af53e7f1f50abac1ec.tar.gz
arm-25e18dcd7776654f3fc1e3af53e7f1f50abac1ec.tar.bz2
arm-25e18dcd7776654f3fc1e3af53e7f1f50abac1ec.zip
updated llvm-9999 to latest ebuild tweaks and patches (still with added cmake sauce)
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/llvm/Manifest9
-rw-r--r--sys-devel/llvm/files/clang-3.5-gentoo-install.patch34
-rw-r--r--sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch42
-rw-r--r--sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch43
-rw-r--r--sys-devel/llvm/files/llvm-3.5-gentoo-llvm-config.patch48
-rw-r--r--sys-devel/llvm/files/llvm-3.6-gentoo-install.patch (renamed from sys-devel/llvm/files/llvm-3.5-gentoo-install.patch)43
-rw-r--r--sys-devel/llvm/llvm-9999.ebuild179
7 files changed, 226 insertions, 172 deletions
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index 010f6a2..8393508 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -1,5 +1,6 @@
-AUX clang-3.5-gentoo-install.patch 2808 SHA256 11bff59bd61ba93549e17625a1141995252534b4770a23cfa5c45f1b62a035b3 SHA512 35f1792822e5c5db3f2d06b2dbbb04ec4851efc6eabddd8023c541ab9bbe4014500c8f661a4f6c410fa3d3529d5ebb05b35961ddb8a90747bfafdc0810aa7f5d WHIRLPOOL 02b80a9310119335d2bd269a4d325815c69817b56587a684e3f7d7156b50aa639f45a5d84eea68d17ce9ac8f6d7e759abe76eed25f79ba66141f7d5472d7490d
+AUX clang-3.5-gentoo-install.patch 2166 SHA256 e359a219f2d0d2b88094bbb5ab91fd50d9662686f77e85b7ccfb8d1c4a6fd39d SHA512 07e5b3d4131a7d58577bcb99a82c585258c98a38e71b7e8dda058b467a558471e1ddeec5c9f5492f5d17e280cd4b09e49338e0926dd2534583bc8a2772bce26d WHIRLPOOL 5582b2015b4d3e845a45bfda08c156683df11685170f253f79ccf016f2e771b016d213417d83068f01a41bd8e0148474711cd6f9b7187e758322e9ebb9c390dd
+AUX clang-3.5-gentoo-runtime-gcc-detection-v3.patch 1694 SHA256 24691db819d08f87f0144a67900ae6797c0df4d180b55acc5c377d890ac2e72e SHA512 a34f694560ef0c7366ad0dc243a479afc74b6122d624b8681538da69c70d0d1869245a89c61d49add890c5f76134281470f5e75a59e6fc9ac963230fc56fe8e6 WHIRLPOOL 4f4af09e08c7d5af89558e77d0a2a4542f77ae505e9020ca6e48e20ef71c4db6016ed0211b2a303b756994f62949c91c216cc2f81b16ff65c71414d354977c8f
AUX llvm-3.2-nodoctargz.patch 1761 SHA256 e17494aef638d2fe3fb0b669516ffcc9e560161903e1e165de0eecba684c8c1b SHA512 d12a8996d8a1160f7bad4ce3b3a9ddfb2d29d91fc160876c145f9241927b0cf4413f3b29bc2bf291f0421f61a512de8057e8f3d0029a8a09ba3f1d93582723b5 WHIRLPOOL be273271db8293829a63120cfc917711c99d8893cae6f95af2583def735131f629ee67b5a1515df007477f34abeaf5f2729d689eefdc61eb3aae6b1959971507
-AUX llvm-3.5-gentoo-install.patch 3204 SHA256 0c97173613505ea92f0aa79d4e04e797f1917fdc33b34daee05752bb52336d53 SHA512 f60b04f1fc7798f7869f3d80e4c163086c398e01b81220d60ccff42be5899fa036d5ab95257933e89e4c5efd04267a09015917c6a617b86b82d7ab4f5d0de221 WHIRLPOOL 81ce5835b9eb1fe1b162f35d6e37762cc8d613e67c5791f078ecd0e354a87eb92e52452bd6e9a7f70953dabea99d197786e87ed64dc802223149b8e97d6de265
-AUX llvm-3.5-gentoo-llvm-config.patch 1672 SHA256 8e5f6cc2e670562e65189c3a032bc9dc6a893b0252281cd712d923ff138103a3 SHA512 fc1a44838432cd46e8758973ad4217ab3b9d23c9d6ef2e9be787d13db2209c1b4b7ef7d9a6080e2e6848073ceef8172d254b7da4d5639ac196a96a159c9287aa WHIRLPOOL 5942b6855db509b5b8824a0ed487af7b52663cded006ed059507d4e8c93652c988ae8ffe87a6d7f393c6a1f6aabbc93dc85ced2f577be7025a3ffb5573f2927d
-EBUILD llvm-9999.ebuild 13941 SHA256 dfde88deada12f826916227a412cc43eeea1b48530371c5b5b01c716213f3643 SHA512 82d1b285cccc696f1ec0430f4ed3d1452537e3ab23d329aff15a524ab17d3489490bf3a4cc70500f29e87f55eac9ae00fbf2be21483b7adfa231518e64a9b5a3 WHIRLPOOL ddcac504e417a51d89f0bf75292111b186514e51a03764bd1494e224ca5f3128d08cff99d574038348e57995600bb64d464953eed3fb9b7aa78e1df7305968db
+AUX llvm-3.5-gcc-4.9.patch 1722 SHA256 c73f64311ff67534b581729b3ef0fecf452b86961c3b668ac2e6b50f1eff0bd2 SHA512 5ad0a742fca3eb9e08a183af9f90370baf85528bba6f3083d19592fe2a704950ca8c6bf9e930f9834255de3fc5832c49a06c9ca29a66e45928d9047abd9ad8ac WHIRLPOOL dac24fcb47d8b094ffa6b4403dbd7604901dd0f5ef6665a882380109584e4de815b2f277e05d44c05e1a3d22a7003075b2b2649f3f614f299b38bc6d594400ae
+AUX llvm-3.6-gentoo-install.patch 3169 SHA256 318288e667623e22c441f7a1da8c3e27b3fff7426839a58a05e43dd0ac37d443 SHA512 9e13fd8606c6aa636d5e1cd3e32781fa4cae3266acf306f5c38f052a7520fc4b603022244b4502045d968c9ca28292539a17caa33b9b470353adfdbb8e159321 WHIRLPOOL 8f3b9b5150d2a29ba4f94a86235d12cf96c1a28ceb7f55fe7b90b3e5e074fe4883d449ac34cbe823ccc22f1ab8b3e2d05dadb39abaaac0a17e3870bbba1ea14e
+EBUILD llvm-9999.ebuild 14697 SHA256 12898efb3f2fd1fd9c684e98cd5e1eefbdc0024d59b714b055c1c107872f8831 SHA512 d3106181eddcf2122cebfec811ef4d4171f647bda87cdbd532169d9522c68904af36f173bb8a57f8e832cd7aa9f9cc35ea9bb6067c9ba05b580aed2d2cb2673f WHIRLPOOL 0b799c5d0ce2b03a7486b5a7bd891b953b75a19d39fe857a6b98d14dd76f4272e318e2bac811e8778223b5b536ed301229003c182bc9eedcbdbe42622bf97654
diff --git a/sys-devel/llvm/files/clang-3.5-gentoo-install.patch b/sys-devel/llvm/files/clang-3.5-gentoo-install.patch
index 3e499a4..5d4261d 100644
--- a/sys-devel/llvm/files/clang-3.5-gentoo-install.patch
+++ b/sys-devel/llvm/files/clang-3.5-gentoo-install.patch
@@ -1,27 +1,13 @@
-From fa806920f0bc9cc867360c3d9407e05b3aba1e9f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Tue, 3 Dec 2013 14:51:14 +0100
-Subject: [PATCH] gentoo clang install
-
---
- tools/clang/lib/Driver/Tools.cpp | 4 ++--
+ tools/clang/lib/Driver/Tools.cpp | 2 +-
tools/clang/tools/scan-build/scan-build | 4 ++--
tools/clang/tools/scan-view/scan-view | 2 +-
- 3 files changed, 5 insertions(+), 5 deletions(-)
+ 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
index 187ed38..55bcd99 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));
- }
@@ -1404,7 +1404,7 @@ static void AddGoldPlugin(const ToolChain &ToolChain, const ArgList &Args,
// as gold requires -plugin to come before any -plugin-opt that -Wl might
// forward.
@@ -35,22 +21,22 @@ diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-bu
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 {
-
+@@ -419,7 +419,7 @@
+
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 {
+ if (! -r $JS);
+@@ -429,7 +429,7 @@
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
diff --git a/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch b/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
new file mode 100644
index 0000000..1f81af0
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
@@ -0,0 +1,42 @@
+From 916572e1243633ddf913c8f32771a3a7f70fd853 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 5 Sep 2014 16:49:35 +0200
+Subject: [PATCH] Support obtaining active toolchain from gcc-config.
+
+---
+ tools/clang/lib/Driver/ToolChains.cpp | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
+index b46f69d..2d4374d 100644
+--- a/tools/clang/lib/Driver/ToolChains.cpp
++++ b/tools/clang/lib/Driver/ToolChains.cpp
+@@ -1253,6 +1253,25 @@ 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)
++ {
++ 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"))
++ {
++ 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
+
diff --git a/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch b/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch
new file mode 100644
index 0000000..7da657f
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch
@@ -0,0 +1,43 @@
+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
+ //
diff --git a/sys-devel/llvm/files/llvm-3.5-gentoo-llvm-config.patch b/sys-devel/llvm/files/llvm-3.5-gentoo-llvm-config.patch
deleted file mode 100644
index bac38b6..0000000
--- a/sys-devel/llvm/files/llvm-3.5-gentoo-llvm-config.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 991bf1608473c07ff4ba84d5b2bb128134c2e11b Mon Sep 17 00:00:00 2001
-From: Aaron Watry <awatry@gmail.com>
-Date: Thu, 9 Jan 2014 08:17:33 -0600
-Subject: [PATCH] llvm-config: Print system-libs on the same line as libs
-
-Before r197664, system libraries were produced on the same line as the
-libraries. This goes back to that behavior.
-
-If the user requests only system-libs, then print it on a single line.
-
-If the user requests libnames/libfiles, then split it into separate
-lines because the two have different semantic meanings.
-
-Signed-off-by: Aaron Watry <awatry@gmail.com>
----
- tools/llvm-config/llvm-config.cpp | 13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 53368ff..c654faf 100644
---- a/tools/llvm-config/llvm-config.cpp
-+++ b/tools/llvm-config/llvm-config.cpp
-@@ -365,12 +365,21 @@ int main(int argc, char **argv) {
- OS << ActiveLibDir << '/' << Lib;
- }
- }
-- OS << '\n';
-
- // Print SYSTEM_LIBS after --libs.
- // FIXME: Each LLVM component may have its dependent system libs.
-+
-+ //If we are printing libraries for linking and not lib names/paths, then
-+ //join system libs with a space, otherwise newline
-+ if (PrintLibs && !PrintLibNames && !PrintLibFiles)
-+ OS << ' ';
-+ else
-+ if (PrintLibs || PrintLibNames || PrintLibFiles)
-+ OS << '\n';
-+
- if (PrintSystemLibs)
-- OS << LLVM_SYSTEM_LIBS << '\n';
-+ OS << LLVM_SYSTEM_LIBS;
-+ OS << '\n';
- } else if (!Components.empty()) {
- errs() << "llvm-config: error: components given, but unused\n\n";
- usage();
---
-1.8.3.2
diff --git a/sys-devel/llvm/files/llvm-3.5-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.6-gentoo-install.patch
index 7a8c9f7..c4d0db2 100644
--- a/sys-devel/llvm/files/llvm-3.5-gentoo-install.patch
+++ b/sys-devel/llvm/files/llvm-3.6-gentoo-install.patch
@@ -1,22 +1,21 @@
-From b8846d389ff5e2b768a114f752cf39788accba26 Mon Sep 17 00:00:00 2001
+From bb016afeba4d9e886e776565a508634a261111a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Mon, 19 Aug 2013 13:22:46 +0200
-Subject: [PATCH] gentoo install fixes
+Date: Wed, 31 Dec 2014 11:26:12 +0100
+Subject: [PATCH] gentoo build fixes
---
Makefile.config.in | 6 +++---
- Makefile.rules | 6 +++---
- tools/llvm-config/BuildVariables.inc.in | 2 ++
- tools/llvm-config/Makefile | 4 ++++
- tools/llvm-config/llvm-config.cpp | 5 +++--
- utils/FileCheck/Makefile | 2 +-
- 7 files changed, 17 insertions(+), 10 deletions(-)
+ Makefile.rules | 2 +-
+ tools/llvm-config/BuildVariables.inc.in | 1 +
+ tools/llvm-config/Makefile | 2 ++
+ tools/llvm-config/llvm-config.cpp | 2 +-
+ 5 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/Makefile.config.in b/Makefile.config.in
-index dcca45f..e75ae2e 100644
+index d34a2d5..a26cd08 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
-@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
+@@ -99,10 +99,10 @@ PROJ_internal_prefix := $(prefix)
endif
PROJ_bindir := $(PROJ_prefix)/bin
@@ -31,10 +30,10 @@ index dcca45f..e75ae2e 100644
PROJ_infodir := $(PROJ_prefix)/info
PROJ_mandir := $(PROJ_prefix)/share/man
diff --git a/Makefile.rules b/Makefile.rules
-index e53598b..217f754 100644
+index c8c971f..d1258b1 100644
--- a/Makefile.rules
+++ b/Makefile.rules
-@@ -275,7 +275,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+@@ -283,7 +283,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
BuildMode := Release
# Don't use -fomit-frame-pointer on Darwin or FreeBSD.
ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin Darwin DragonFly FreeBSD GNU/kFreeBSD))
@@ -44,19 +43,19 @@ index e53598b..217f754 100644
CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-index fe87afb..fd9f2c6 100644
+index 3f51f49..513ea89 100644
--- a/tools/llvm-config/BuildVariables.inc.in
+++ b/tools/llvm-config/BuildVariables.inc.in
-@@ -25,3 +25,4 @@
- #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+@@ -26,3 +26,4 @@
+ #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
+#define LLVM_LIBDIR "@LLVM_LIBDIR@"
diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
-index b20b6bf..fc56781 100644
+index 1ff8b6f..5d73c6e 100644
--- a/tools/llvm-config/Makefile
+++ b/tools/llvm-config/Makefile
-@@ -55,6 +55,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+@@ -65,6 +65,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
>> temp.sed
$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
>> temp.sed
@@ -66,18 +65,18 @@ index b20b6bf..fc56781 100644
$(Verb) $(RM) temp.sed
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 3924e2e..f439c60 100644
+index 224035a..57180ac 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
-@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
+@@ -265,7 +265,7 @@ int main(int argc, char **argv) {
ActivePrefix = CurrentExecPrefix;
ActiveIncludeDir = ActivePrefix + "/include";
ActiveBinDir = ActivePrefix + "/bin";
-- ActiveLibDir = ActivePrefix + "/lib";
+- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
+ ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}
--
-1.8.4.2
+2.2.1
diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild
index b01596f..504bbbd 100644
--- a/sys-devel/llvm/llvm-9999.ebuild
+++ b/sys-devel/llvm/llvm-9999.ebuild
@@ -1,13 +1,13 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
-PYTHON_COMPAT=( python{2_5,2_6,2_7} pypy{1_9,2_0} )
+PYTHON_COMPAT=( python2_7 pypy )
-inherit cmake-utils eutils flag-o-matic git-r3 multilib multilib-minimal \
- python-r1 toolchain-funcs pax-utils check-reqs
+inherit cmake-utils eutils flag-o-matic git-r3 multibuild multilib \
+ multilib-minimal python-r1 toolchain-funcs pax-utils check-reqs
DESCRIPTION="Low Level Virtual Machine"
HOMEPAGE="http://llvm.org/"
@@ -18,7 +18,7 @@ EGIT_REPO_URI="http://llvm.org/git/llvm.git
LICENSE="UoI-NCSA"
SLOT="0/${PV}"
KEYWORDS=""
-IUSE="clang debug doc gold +libffi multitarget ncurses ocaml python
+IUSE="clang debug doc gold libedit +libffi multitarget ncurses ocaml python
+static-analyzer test udis86 xml video_cards_radeon kernel_Darwin"
COMMON_DEPEND="
@@ -32,8 +32,9 @@ COMMON_DEPEND="
xml? ( dev-libs/libxml2:2= )
)
gold? ( >=sys-devel/binutils-2.22:*[cxx] )
- libffi? ( virtual/libffi:0=[${MULTILIB_USEDEP}] )
- ncurses? ( sys-libs/ncurses:5=[tinfo(+),${MULTILIB_USEDEP}] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:5=[tinfo(+),${MULTILIB_USEDEP}] )
ocaml? ( dev-lang/ocaml:0= )
udis86? ( dev-libs/udis86:0=[pic(+),${MULTILIB_USEDEP}] )"
DEPEND="${COMMON_DEPEND}
@@ -48,12 +49,13 @@ DEPEND="${COMMON_DEPEND}
|| ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
clang? ( xml? ( virtual/pkgconfig ) )
libffi? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
${PYTHON_DEPS}"
RDEPEND="${COMMON_DEPEND}
- clang? ( !<=sys-devel/clang-9999-r99 )
+ clang? ( !<=sys-devel/clang-${PV}-r99 )
abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
-PDEPEND="clang? ( =sys-devel/clang-9999-r100 )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
# pypy gives me around 1700 unresolved tests due to open file limit
# being exceeded. probably GC does not close them fast enough.
@@ -99,41 +101,23 @@ pkg_pretend() {
local CHECKREQS_DISK_BUILD=${build_size}M
check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- pkg_pretend
-
- # need to check if the active compiler is ok
- broken_gcc=( 3.2.2 3.2.3 3.3.2 4.1.1 )
- broken_gcc_x86=( 3.4.0 3.4.2 )
- broken_gcc_amd64=( 3.4.6 )
-
- gcc_vers=$(gcc-fullversion)
-
- if has "${gcc_vers}" "${broken_gcc[@]}"; then
- elog "Your version of gcc is known to miscompile llvm."
- elog "Check http://www.llvm.org/docs/GettingStarted.html for"
- elog "possible solutions."
- die "Your currently active version of gcc is known to miscompile llvm"
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ echo 'int main() {return 0;}' > "${T}"/test.cxx || die
+ ebegin "Trying to build a C++11 test program"
+ if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then
+ eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler"
+ eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+ eerror "to gcc-4.7 or an equivalent version supporting C++11."
+ die "Currently active compiler does not support -std=c++11"
+ fi
+ eend ${?}
fi
- if use abi_x86_32 && has "${gcc_vers}" "${broken_gcc_x86[@]}"; then
- elog "Your version of gcc is known to miscompile llvm on x86"
- elog "architectures. Check"
- elog "http://www.llvm.org/docs/GettingStarted.html for possible"
- elog "solutions."
- die "Your currently active version of gcc is known to miscompile llvm"
- fi
+}
- if use abi_x86_64 && has "${gcc_vers}" "${broken_gcc_amd64[@]}"; then
- elog "Your version of gcc is known to miscompile llvm in amd64"
- elog "architectures. Check"
- elog "http://www.llvm.org/docs/GettingStarted.html for possible"
- elog "solutions."
- die "Your currently active version of gcc is known to miscompile llvm"
- fi
+pkg_setup() {
+ pkg_pretend
}
src_unpack() {
@@ -160,11 +144,20 @@ src_unpack() {
src_prepare() {
epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch
- epatch "${FILESDIR}"/${PN}-3.5-gentoo-install.patch
- use clang && epatch "${FILESDIR}"/clang-3.5-gentoo-install.patch
+ epatch "${FILESDIR}"/${PN}-3.5-gcc-4.9.patch
+ epatch "${FILESDIR}"/${PN}-3.6-gentoo-install.patch
- # patch for freedesktop.org bug
-# epatch "${FILESDIR}"/${PN}-3.5-gentoo-llvm-config.patch
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
+
+ epatch "${FILESDIR}"/clang-3.5-gentoo-install.patch
+ fi
+
+ if use prefix && use clang; then
+ sed -i -e "/^CFLAGS /s@-Werror@-I${EPREFIX}/usr/include@" \
+ projects/compiler-rt/make/platform/clang_*.mk || die
+ fi
local sub_files=(
Makefile.config.in
@@ -189,6 +182,8 @@ src_prepare() {
# User patches
epatch_user
+
+ python_setup
}
multilib_src_configure() {
@@ -198,18 +193,20 @@ multilib_src_configure() {
--enable-keep-symbols
--enable-shared
--with-optimize-option=
+ $(tc-is-static-only && echo --disable-shared)
$(use_enable !debug optimized)
$(use_enable debug assertions)
$(use_enable debug expensive-checks)
+ $(use_enable libedit)
$(use_enable ncurses terminfo)
$(use_enable libffi)
)
- if use clang; then
- conf_flags+=( --with-clang-resource-dir=../lib/clang/3.5 )
- fi
+# if use clang; then
+# conf_flags+=( --with-clang-resource-dir=../lib/clang/3.5 )
+# fi
# well, it's used only by clang executable c-index-test
- if multilib_build_binaries && use clang && use xml; then
+ if multilib_is_native_abi && use clang && use xml; then
conf_flags+=( XML2CONFIG="$(tc-getPKG_CONFIG) libxml-2.0" )
else
conf_flags+=( ac_cv_prog_XML2CONFIG="" )
@@ -224,7 +221,7 @@ multilib_src_configure() {
fi
conf_flags+=( --enable-targets=${targets} )
- if multilib_build_binaries; then
+ if multilib_is_native_abi; then
use gold && conf_flags+=( --with-binutils-include="${EPREFIX}"/usr/include/ )
# extra commas don't hurt
use ocaml && bindings+=',ocaml'
@@ -242,8 +239,8 @@ multilib_src_configure() {
append-cppflags "$(pkg-config --cflags libffi)"
fi
- # build with a suitable Python version
- python_export_best
+# # build with a suitable Python version
+# python_export_best
# llvm prefers clang over gcc, so we may need to force that
tc-export CC CXX
@@ -251,7 +248,7 @@ multilib_src_configure() {
ECONF_SOURCE=${S} \
econf "${conf_flags[@]}"
- multilib_build_binaries && cmake_configure
+ multilib_is_native_abi && cmake_configure
}
cmake_configure() {
@@ -284,13 +281,13 @@ set_makeargs() {
local tools=( llvm-config )
use clang && tools+=( clang )
- if multilib_build_binaries; then
+ if multilib_is_native_abi; then
tools+=(
opt llvm-as llvm-dis llc llvm-ar llvm-nm llvm-link lli
llvm-extract llvm-mc llvm-bcanalyzer llvm-diff macho-dump
llvm-objdump llvm-readobj llvm-rtdyld llvm-dwarfdump llvm-cov
- llvm-size llvm-stress llvm-mcmarkup llvm-symbolizer obj2yaml
- yaml2obj lto bugpoint
+ llvm-size llvm-stress llvm-mcmarkup llvm-profdata
+ llvm-symbolizer obj2yaml yaml2obj lto bugpoint
)
# the build system runs explicitly specified tools in parallel,
@@ -324,7 +321,7 @@ multilib_src_compile() {
set_makeargs -1
emake "${MAKEARGS[@]}"
- if multilib_build_binaries; then
+ if multilib_is_native_abi; then
set_makeargs
emake -C tools "${MAKEARGS[@]}"
@@ -337,9 +334,11 @@ multilib_src_compile() {
if use debug; then
pax-mark m Debug+Asserts+Checks/bin/llvm-rtdyld
pax-mark m Debug+Asserts+Checks/bin/lli
+ pax-mark m Debug+Asserts+Checks/bin/lli-child-target
else
pax-mark m Release/bin/llvm-rtdyld
pax-mark m Release/bin/lli
+ pax-mark m Release/bin/lli-child-target
fi
}
@@ -361,14 +360,28 @@ multilib_src_test() {
}
src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/bin/llvm-config
+ )
+
local MULTILIB_WRAPPED_HEADERS=(
/usr/include/llvm/Config/config.h
/usr/include/llvm/Config/llvm-config.h
)
- use clang && MULTILIB_WRAPPED_HEADERS+=(
- /usr/include/clang/Config/config.h
- )
+ if use clang; then
+ # note: magic applied below
+ MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/clang
+ /usr/bin/clang++
+ /usr/bin/clang-${PV}
+ /usr/bin/clang++-${PV}
+ )
+
+ MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/clang/Config/config.h
+ )
+ fi
multilib-minimal_src_install
}
@@ -377,25 +390,15 @@ multilib_src_install() {
local MAKEARGS
set_makeargs
- emake "${MAKEARGS[@]}" DESTDIR="${D}" install
-
- # Preserve ABI-variant of llvm-config.
- dodir /tmp
- mv "${ED}"/usr/bin/llvm-config "${ED}"/tmp/"${CHOST}"-llvm-config || die
+ local root=${D}/_${ABI}
- if ! multilib_build_binaries; then
- # Drop all the executables since LLVM doesn't like to
- # clobber when installing.
- rm -r "${ED}"/usr/bin || die
+ emake "${MAKEARGS[@]}" DESTDIR="${root}" install
+ multibuild_merge_root "${root}" "${D}"
+ if ! multilib_is_native_abi; then
# Backwards compat, will be happily removed someday.
- dosym "${CHOST}"-llvm-config /tmp/llvm-config.${ABI}
+ dosym "${CHOST}"-llvm-config /usr/bin/llvm-config.${ABI}
else
- # Move files back.
- mv "${ED}"/tmp/*llvm-config* "${ED}"/usr/bin || die
- # Create a symlink for host's llvm-config.
- dosym "${CHOST}"-llvm-config /usr/bin/llvm-config
-
# Install docs.
doman "${S}"/docs/_build/man/*.1
use clang && doman "${T}"/clang.1
@@ -407,6 +410,34 @@ multilib_src_install() {
dosym ../../../../$(get_libdir)/LLVMgold.so \
/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so
fi
+ fi
+
+ # apply CHOST and PV to clang executables
+ # they're statically linked so we don't have to worry about the lib
+ if use clang; then
+ local clang_tools=( clang clang++ )
+ local i
+
+ # append ${PV} and symlink back
+ # TODO: use alternatives.eclass? does that make any sense?
+ # maybe with USE=-clang on :0 and USE=clang on older
+ for i in "${clang_tools[@]}"; do
+ mv "${ED%/}/usr/bin/${i}"{,-${PV}} || die
+ dosym "${i}"-${PV} /usr/bin/${i}
+ done
+
+ # now prepend ${CHOST} and let the multilib-build.eclass symlink it
+ if ! multilib_is_native_abi; then
+ # non-native? let's replace it with a simple wrapper
+ for i in "${clang_tools[@]}"; do
+ rm "${ED%/}/usr/bin/${i}-${PV}" || die
+ cat > "${T}"/wrapper.tmp <<-_EOF_
+ #!${EPREFIX}/bin/sh
+ exec "${i}-${PV}" $(get_abi_CFLAGS) "\${@}"
+ _EOF_
+ newbin "${T}"/wrapper.tmp "${i}-${PV}"
+ done
+ fi
# install cmake modules
emake -C "${S%/}"_cmake/cmake/modules DESTDIR="${D}" install