summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-devel/llvm/ChangeLog10
-rw-r--r--sys-devel/llvm/Manifest33
-rw-r--r--sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch117
-rw-r--r--sys-devel/llvm/llvm-3.3-r2.ebuild475
4 files changed, 618 insertions, 17 deletions
diff --git a/sys-devel/llvm/ChangeLog b/sys-devel/llvm/ChangeLog
index 1ba9f6c5e9ed..e35f4af79881 100644
--- a/sys-devel/llvm/ChangeLog
+++ b/sys-devel/llvm/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-devel/llvm
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/ChangeLog,v 1.159 2013/12/28 14:02:19 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/ChangeLog,v 1.160 2013/12/28 14:04:46 mgorny Exp $
+
+*llvm-3.3-r2 (28 Dec 2013)
+
+ 28 Dec 2013; Michał Górny <mgorny@gentoo.org>
+ +files/llvm-3.3-r2-gentoo-install.patch, +llvm-3.3-r2.ebuild:
+ Backport all the fixes and install design changes from -9999 to -3.3. Fixes
+ bugs #425844 (install CMake modules), #462554 (install bfd-plugins symlink),
+ #489586 (multilib portage compat.), #488216, #492554 (RPATH issues).
28 Dec 2013; Michał Górny <mgorny@gentoo.org> llvm-9999.ebuild:
Add bugpoint to built tools. Switch llvm-config wrapping to use $CHOST-llvm-
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index 4e721b872e7a..8570950ba596 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -27,7 +27,7 @@ AUX llvm-3.2-nodoctargz.patch 1761 SHA256 e17494aef638d2fe3fb0b669516ffcc9e56016
AUX llvm-3.3-R600_debug.patch 909 SHA256 84ebe63a557e3734dc8ed4545f098e2496d815e6bf4a99dfcb65d649a23d2c1b SHA512 cd1b92c713edf895ab7a15494c6092e44082b40b9bb5b0fdfdc438e919456c7fcafab9a840adb165c191454948c0b42bc78ce2b4d2cfbdf371917b16351c6928 WHIRLPOOL 0f08c58c78c1d04b8e701b0b817956a37271115c1fc83ea8f0f54bf965fbc659e418abf7f429c2a29581351050346cb783f0aa9147757d4cfdfa24fd8b28d09e
AUX llvm-3.3-gentoo-install.patch 5321 SHA256 4f2e80f5567227e3539052a743ef0432f108d76e6fb9ba373dc51dbf159e0410 SHA512 90075d4bb5bdefb76bfb191dcb1b618de464434d9d084b2f99cc5034d33b112378f9aae1d289d30a2f8926132c17ea32ba1bf4049c3a61a418d37f903634b259 WHIRLPOOL 39b3ce4e937985483be7b4d19a37c0837b3c27f308f09fe8aee185b9fb43782b540f6b6be042b8f6dc4b5037be64284e2e233e65b3558e4b4eb1095a7d586a4f
AUX llvm-3.3-insecure-rpath.patch 881 SHA256 27d893e5f551d245f15c01a94df81dd9ad069c2a980cf6a8860fb429eb37a5d8 SHA512 f03d1f522d0153fcbef677bf85202a6ddff408362d9ebc3e4f9f21814b43d28b033b0efb3ee86f5c11a4ac3a91b8afc80d022bddcd839ba503b29cf946e40218 WHIRLPOOL cfca8d189f88c0e26b4c3091db6c4267a90307c5728e64ee3ca55272a884389e56ed186904d9d66b44b870792eaae049cf6e66ee38efaf757655a4be4a0cec6e
-AUX llvm-3.3-r2-gentoo-install.patch.old 3428 SHA256 d8cd7b88b1b672f994fb2c9cc70a8957ea20e325273a1cfdbe4e8b84daf6a578 SHA512 35361b4cae95ee18c760208a81ea57e6474f890cd00dfe1fb04a527dec854e1de38fc12d219c06f14b8f99298c88f21fbee4ba5975b7c231f531bf607e386abe WHIRLPOOL cb01ab3a9c821d5b3ace0e5ac39a4998e96fbd1ee082965da01eddbeae45ce830085c3506475a536fcd8fc25cf731558a56d148c0779e3eaa717ed14397191f8
+AUX llvm-3.3-r2-gentoo-install.patch 4043 SHA256 a8e24328888dc0459fb5c24e244c30baf7f8ec75875fc7293f9e1029d75fb1f2 SHA512 f829d9f8e0d5730a8221a8be9a1d87c7c79a09f498f00d5f9cb7d1172dcdcb2ba1b68b8b5454225dde230d642240d0f647439f34befa23b64156b2f7c2247027 WHIRLPOOL e937127359c474bb843cef34116d2ca8651c4d22ef7ebfc8cd2a22537e483cfdad7e78c1fc4a7d4bee92fa19995bdab9dc8b7cd96594f114ddc9a6af4604ac63
AUX llvm-3.4-gentoo-install.patch 3528 SHA256 fa2de6dd186091b255832a9b5cb654edddd4c4a16f0f138357c813a40aa9a75b SHA512 e946e1fd422f49d2e150bd641bac0ffe6ea6757b2e6119465090a3c7f5cf69e17c00221bcf67a7fcf29628d93463fb1c57d0d009ff7834151440d779f2d33484 WHIRLPOOL 171f167802ee289716232e16a2c507e3b8dc7913b40df29c55a815ff88596871a1a970c891b0e9b361186cada4d8898e65920d014b4e6eb2178cc207f61bf6da
AUX llvm-3.5-gentoo-install.patch 3204 SHA256 0c97173613505ea92f0aa79d4e04e797f1917fdc33b34daee05752bb52336d53 SHA512 f60b04f1fc7798f7869f3d80e4c163086c398e01b81220d60ccff42be5899fa036d5ab95257933e89e4c5efd04267a09015917c6a617b86b82d7ab4f5d0de221 WHIRLPOOL 81ce5835b9eb1fe1b162f35d6e37762cc8d613e67c5791f078ecd0e354a87eb92e52452bd6e9a7f70953dabea99d197786e87ed64dc802223149b8e97d6de265
DIST cfe-3.3.src.tar.gz 9425539 SHA256 b1b55de4ab3a57d3e0331a83e0284610191c77d924e3446498d9113d08dfb996 SHA512 06773f43f7d3529f06edb029f7de398f06a700a0f2476e00c4727e70c291028221bfac23625dfd2c220d6ac91a21670848187a934b99a21801c695127371afcc WHIRLPOOL 8b97b527f19015dd3283b9e174615170e639793f64c635ccc4ee4d8216f8de759fd0121a8ef3513fa1c6ad19b31aa3529091ffb44a01ee858edfef400881596a
@@ -46,26 +46,27 @@ EBUILD llvm-3.0-r2.ebuild 5767 SHA256 62fca1169c63516f29102a3a1bb4ea74408dfd151d
EBUILD llvm-3.1-r2.ebuild 6033 SHA256 9b9a587d30419fa646764a96e12fc6272f73f7246138c76ba577f0d6ab3afe59 SHA512 8b969084210af4203c029bb33d5b984e0b17f6770fd489dad818154ac9f6a87bfad069eff71776f678d9eb5d5136af472d3008d5bc73fab9dc1f36811af906c4 WHIRLPOOL 928459551d7cf6e8d18244026ba82cc3dbaf2b65bd6eac8adb617695c95535ba65bd013909730d5922de5764e9d6c6c4cf007aa6acd0b493826aa938d0389a5d
EBUILD llvm-3.2.ebuild 6534 SHA256 eb16cc91887fdb035722d268caaa3e4843825403786fcf74643be2c6f8099f11 SHA512 e781a4e4416a4acee667029744dab7f8e52022df4fcbb89d4d9acf855549f1c0a1661b79ee0067fd052a36bad278f08a2ff7f6e6e44d8c3ea7f82910ac573d9b WHIRLPOOL 115d13959a22867266dd7c0133109ccba063e97972cc2c807fb7a6dd7d3fbef1726caf314e262f6683a97a2c3a6ff776f808de7d80923472fc692554eccbca27
EBUILD llvm-3.3-r1.ebuild 12007 SHA256 343a88ba35b67f4d86c20e29e1f4919640a9c4fbf9942fb1733945480ba1e8f5 SHA512 3db9e2ad26e803ac663b696ff615eed83a4342e4b771f161b74304bb83c61f171e02f2b176cf62663724206a57e20be52ec22cf49de234f72b32673bb2588512 WHIRLPOOL 1c423485f6161b40daa5a7ebdc38838b4bd2d6a9c540881eb3cfbf5f592b454da32758ad23c2607fe7a875c65891f7b64f3079a53ac77af5b2decb6490a6b8b4
+EBUILD llvm-3.3-r2.ebuild 13443 SHA256 f1748532e0c56258430e5ea551e2aa739a254b32f4afe12b67189dbb1da0f676 SHA512 9a8c827f819433a585cbdf078429b387ff316a16727159c1737c8b2a51b0c69e481243477a249761fe1cde2483e9f909db16a3154541e3fcc11c7de951d41348 WHIRLPOOL 9c1c8804d9a06d746a1c6766b441ba942d9c0b875d8d445474e20c047adc753a6385873a78e01978bc27eb59c15173e22f8dbfa271aabc924bc323800b2303f8
EBUILD llvm-3.3.ebuild 6798 SHA256 4e53042e76ce97e6a460cda74c5dbadc1cee9009345e8f0232e28d53c8f77579 SHA512 5513887c3b5a25a678713b68c216a40801ddecbf5a4dc58d7ad01c1ec8411589e20d8662c34f117e6d64924302504c8ce74b48f3edca1f292b56881eb6176271 WHIRLPOOL 79d6adefc281699477a271f76cb8eb7992d0946b6fcda9149a0976c30138ac882f735eff08c25c0edf37ccc8e31700f6d2d51d38c354c82c06695962e8f9243b
EBUILD llvm-9999.ebuild 13167 SHA256 4c68b7655c08bb28b784a1fde982eb211e1c794dd82ac823f9cdf454684084b7 SHA512 5d9de71db741e6efd46d6b0261454f910a45ea1894a8e4337ac5dc50c5e34df4201ee5d2674498ddb483ad9dfa7a164776788d3222497d00159691c239ba36bd WHIRLPOOL 9f63c196c8b20e43b6cc2fdd15a1ce1c61c184218f7550da179fc3c7e37dd50ede2352978183ec4eaf47489ec9feae18db28782547c6bbef64151a5291dfcfea
-MISC ChangeLog 26622 SHA256 f194ddf229968fc7421c813653bc0128acccad656b29e59b53bced1e8f1f1780 SHA512 689599fbf60735638452de5ff803b0ba3b5c313657c9f1dd1c5cb03717d1075810f628a0c66e47c1e6674f5ff07237228b2723c1792a14caa32058287d6142ef WHIRLPOOL b7a84af7c49395f309353d063c1a81cbf1c7bdabd8d3bab4b3ad0433c9bb166496ea14aa781ac0e6830c5de792098093b0c21e0681926eea434efea4ce82c9da
+MISC ChangeLog 26993 SHA256 2a3916a571a437ddae28e33c8478303f3c9abb5ed57959ad4ed474be04bdc465 SHA512 fff74673cc2222d42c166206cd441015f2843fc6bf61fa7abb7dd02439a32c5b3711bbafd75ef490ecfd79d7e0dbdb294efb20a2203543ca8fd35f0672fea6d8 WHIRLPOOL 8425c8f0ec35942197d8e5fbe2e2bd501c6c4504cf9e37071393964a14165d911e9272598f59c711f37c15286098ca0056edb7b36e757e75dc38ab5e1d14027c
MISC metadata.xml 2723 SHA256 d1bbe72da2553592ad60522f744b8339bce17487343abf372d966c1fe9cd163d SHA512 800f72039a5f0fdb175a8ddab7ae8f184907865802ffd5f139006f3a8c77053f114e2f7b01cef3f41f6fffb3f8f8b2b474fdf95461f27b2dc8ae31cbd732a14e WHIRLPOOL 462d3d2f22e29d3678621a9f89ed98a58ee60fde57da7be21fbca7fd61e106abbcb19c0e491424869302c19ca93b15c480cd7ca2a3181f2148174d44e891e190
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
-iQJ8BAEBCABmBQJSvtnxXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
+iQJ8BAEBCABmBQJSvtp/XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2REJCMDdDQzRGMERBRDA2RUEwQUZFNDFC
-MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZO4BAP+wVIeaK+FFBd6E5uArxujJWF
-I9GG4k+3WxeZ0I+9ci2M8yUUGjRn9CBNC+mOAFt4tCpmVoNxotAZ2dHwMr1GG4sz
-LiBMJhlOf4HCDuSYV9CFqRmjWtbmdRpY+dZlr18qak4xqqeoD7a7NWxDVCXuDVfh
-Pl5nXdBZS5jQ5BsZMYbQjMXwlR2OhKRGxf2EXP9pMemYMrTY7q8cWGHlb9MA17LC
-U8VA2JffKAKv9JHU+TgmejsPdR3J+f+d/upF3eoF/NluZvhrcX7KfQmxryIOGk2e
-bEnq1dejghRerw9ygmXf98Eo1GsUfihLfRTiZ7nTTjCw1rQujN2fejnIlhVY7VyA
-GvWWFjhEi7JNgtu2RlASwXgwSmwk/0lXNUbTt6bgTXHQNw+X4zdaIe94ELq6s2Ph
-gA+PgbYjduEywHdv/jwPbqkyt6VIUB01uxiAC7hsfByID9i6L9Udtgco9jaRvsxE
-ynqy8tYZetMTU2j0tNxUfEDoVpFWKfDFnZL5zvrcFRIfBCFzD4cBmHwMDXQOl3u+
-oFNajSZv3iK6vjNWdVCvcbw/XcQ/Gfy5p0Pu1kdSQur1YXyrTchZ7uIJq5XIP3M4
-H3GSTxP4bPQJPW8mxO8nI4sGAPcm3iemyHlryXzkSk1TKkv7N0z+KyQtFerGLSYR
-DpE+hG+9ElrigA81xna2
-=h1n7
+MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZO+zcP/RhtC5mSKLLggjIMDDLnC58J
+1MoctK2QAWsT+XmkNaBEMlPu/zmekoH+VWyU77bdOTN0wvsy7Tp7oqgCi5+5blyK
+019FEp/WE/Al4eb/BEFerH+QnDHant8AE1QkFaITtFFVaF1UHxsz1HTywA1b5eJB
+lUonrdYbRyy+A6Hreu/moWOM3p4gbNOSXE/4n1f7iO55ALVDDJFG2DP0qqUorDIx
+N96MfFrh3+IauPj4qABtOwxA6NDv/CQayMQTeOtQ6ZuynRkFn6OkRCYOc1fuv/+h
+eVDmRgoSiZna8lZ37rO/fPcy0Rdxm1sH4UdgLchNCeqbbRY/elwKm5rAMzPN+6dt
+4vmp6w5PICyw+jtL0ilsUU/sBwWXSNcT/XKPYhOUjQC2iGjQxTGwKgv75B00t3zL
+r1cJuG3I+wN3uEUbf/FnP9YS//WXc+ExI/sfyRdnjgirkLkIC1k73HTsqMdzIzX1
+GKY+DkI/7z6VUiMUQwkL2W+dosH1oPHCy71sJqkiG7xfdG8MyshNTSSzdZfoj6j1
+JBNNrmTkPMa95JRzPFIBRtCABfFQkmmWcxLSeVKiiaRWsPwDYeVsuB6vPav1OKlN
+nGBtwJf+bfGnRtwCjhkE2qML9yXiJ2xqSB0qH4sKM++Ks5mtRYsHY8Baam/tyogH
+sZExc5+vt0lHpejEGi78
+=MuU/
-----END PGP SIGNATURE-----
diff --git a/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch
new file mode 100644
index 000000000000..c5bd8b8695b0
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch
@@ -0,0 +1,117 @@
+From a554809b6bdbe29b1f775c89104c1088300685ef Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 28 Dec 2013 10:30:28 +0100
+Subject: [PATCH] Update for gentoo install layout.
+
+---
+ Makefile.config.in | 6 +++---
+ Makefile.rules | 8 ++++----
+ tools/llvm-config/BuildVariables.inc.in | 1 +
+ tools/llvm-config/Makefile | 2 ++
+ tools/llvm-config/llvm-config.cpp | 2 +-
+ utils/FileCheck/Makefile | 2 +-
+ 6 files changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile.config.in b/Makefile.config.in
+index fd4f6ef..b63786c 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
+ endif
+
+ PROJ_bindir := $(PROJ_prefix)/bin
+-PROJ_libdir := $(PROJ_prefix)/lib
++PROJ_libdir := $(PROJ_prefix)/$(GENTOO_LIBDIR)
+ PROJ_datadir := $(PROJ_prefix)/share
+-PROJ_docsdir := $(PROJ_prefix)/docs/llvm
+-PROJ_etcdir := $(PROJ_prefix)/etc/llvm
++PROJ_docsdir := $(PROJ_prefix)/share/doc/@PF@
++PROJ_etcdir := @EPREFIX@/etc/llvm
+ PROJ_includedir := $(PROJ_prefix)/include
+ PROJ_infodir := $(PROJ_prefix)/info
+ PROJ_mandir := $(PROJ_prefix)/share/man
+diff --git a/Makefile.rules b/Makefile.rules
+index f0c542b..6cc19fd 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -276,7 +276,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+ # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+ ifneq ($(HOST_OS),FreeBSD)
+ ifneq ($(HOST_OS),Darwin)
+- OmitFramePointer := -fomit-frame-pointer
++ OmitFramePointer :=
+ endif
+ endif
+
+@@ -601,7 +601,7 @@ endif
+ ifdef SHARED_LIBRARY
+ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ ifneq ($(HOST_OS),Darwin)
+- LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
++ LD.Flags +=
+ endif
+ endif
+ endif
+@@ -641,9 +641,9 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ ifdef TOOLNAME
+ LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
+ ifdef EXAMPLE_TOOL
+- LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
++ LD.Flags += $(DynamicFlag)
+ else
+- LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
++ LD.Flags += $(DynamicFlag)
+ endif
+ endif
+ else
+diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
+index fe87afb..908acd4 100644
+--- a/tools/llvm-config/BuildVariables.inc.in
++++ b/tools/llvm-config/BuildVariables.inc.in
+@@ -25,3 +25,4 @@
+ #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+ #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..0aeba45 100644
+--- a/tools/llvm-config/Makefile
++++ b/tools/llvm-config/Makefile
+@@ -55,6 +55,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+ >> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
+ >> temp.sed
++ $(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
++ >> temp.sed
+ $(Verb) $(SED) -f temp.sed < $< > $@
+ $(Verb) $(RM) temp.sed
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 7edf5ec..c09b702 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) {
+ ActivePrefix = CurrentExecPrefix;
+ ActiveIncludeDir = ActivePrefix + "/include";
+ ActiveBinDir = ActivePrefix + "/bin";
+- ActiveLibDir = ActivePrefix + "/lib";
++ ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+
+diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile
+index 268b7bc..e7674f9 100644
+--- a/utils/FileCheck/Makefile
++++ b/utils/FileCheck/Makefile
+@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a
+ TOOL_NO_EXPORTS = 1
+
+ # Don't install this utility
+-NO_INSTALL = 1
++#NO_INSTALL = 1
+
+ include $(LEVEL)/Makefile.common
+
+--
+1.8.5.2
+
diff --git a/sys-devel/llvm/llvm-3.3-r2.ebuild b/sys-devel/llvm/llvm-3.3-r2.ebuild
new file mode 100644
index 000000000000..929a685cdf26
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.3-r2.ebuild
@@ -0,0 +1,475 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.3-r2.ebuild,v 1.1 2013/12/28 14:04:46 mgorny Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7} pypy2_0 )
+
+inherit cmake-utils eutils flag-o-matic multilib multilib-minimal \
+ python-r1 toolchain-funcs pax-utils check-reqs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz
+ clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.gz
+ http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.gz )
+ !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
+
+LICENSE="UoI-NCSA"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="clang debug doc gold +libffi multitarget ocaml python
+ +static-analyzer test udis86 xml video_cards_radeon
+ kernel_Darwin kernel_FreeBSD"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ clang? (
+ python? ( ${PYTHON_DEPS} )
+ static-analyzer? (
+ dev-lang/perl:*
+ ${PYTHON_DEPS}
+ )
+ xml? ( dev-libs/libxml2:2= )
+ )
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libffi? ( virtual/libffi:0=[${MULTILIB_USEDEP}] )
+ ocaml? ( dev-lang/ocaml:0= )
+ udis86? ( dev-libs/udis86:0=[pic(+),${MULTILIB_USEDEP}] )"
+DEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
+ clang? ( xml? ( virtual/pkgconfig ) )
+ doc? ( dev-python/sphinx )
+ libffi? ( virtual/pkgconfig )
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-9999-r99 )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# pypy gives me around 1700 unresolved tests due to open file limit
+# being exceeded. probably GC does not close them fast enough.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ test? ( || ( $(python_gen_useflags 'python*') ) )"
+
+S=${WORKDIR}/${P}.src
+
+pkg_pretend() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if use debug; then
+ ewarn "USE=debug is known to increase the size of package considerably"
+ ewarn "and cause the tests to fail."
+ ewarn
+
+ (( build_size *= 14 ))
+ elif is-flagq -g || is-flagq -ggdb; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ # Multiply by number of ABIs :).
+ local abis=( $(multilib_get_enabled_abis) )
+ (( build_size *= ${#abis[@]} ))
+
+ 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"
+ 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
+}
+
+src_unpack() {
+ default
+
+ rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \
+ || die "symlinks removal failed"
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-${PV}.src "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch
+ epatch "${FILESDIR}"/${PN}-3.3-r2-gentoo-install.patch
+ use clang && epatch "${FILESDIR}"/clang-3.4-gentoo-install.patch
+
+ local sub_files=(
+ Makefile.config.in
+ Makefile.rules
+ tools/llvm-config/llvm-config.cpp
+ )
+ use clang && sub_files+=(
+ tools/clang/lib/Driver/Tools.cpp
+ tools/clang/tools/scan-build/scan-build
+ )
+
+ # unfortunately ./configure won't listen to --mandir and the-like, so take
+ # care of this.
+ # note: we're setting the main libdir intentionally.
+ # where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make.
+ einfo "Fixing install dirs"
+ sed -e "s,@libdir@,$(get_libdir),g" \
+ -e "s,@PF@,${PF},g" \
+ -e "s,@EPREFIX@,${EPREFIX},g" \
+ -i "${sub_files[@]}" \
+ || die "install paths sed failed"
+
+ # User patches
+ epatch_user
+}
+
+multilib_src_configure() {
+ # disable timestamps since they confuse ccache
+ local conf_flags=(
+ --disable-timestamps
+ --enable-keep-symbols
+ --enable-shared
+ --with-optimize-option=
+ $(use_enable !debug optimized)
+ $(use_enable debug assertions)
+ $(use_enable debug expensive-checks)
+ $(use_enable libffi)
+ )
+
+ if use clang; then
+ conf_flags+=( --with-clang-resource-dir=../lib/clang/${PV} )
+ fi
+ # well, it's used only by clang executable c-index-test
+ if multilib_build_binaries && use clang && use xml; then
+ conf_flags+=( XML2CONFIG="$(tc-getPKG_CONFIG) libxml-2.0" )
+ else
+ conf_flags+=( ac_cv_prog_XML2CONFIG="" )
+ fi
+
+ local targets bindings
+ if use multitarget; then
+ targets='all'
+ else
+ targets='host,cpp'
+ use video_cards_radeon && targets+=',r600'
+ fi
+ conf_flags+=( --enable-targets=${targets} )
+
+ if multilib_build_binaries; then
+ use gold && conf_flags+=( --with-binutils-include="${EPREFIX}"/usr/include/ )
+ # extra commas don't hurt
+ use ocaml && bindings+=',ocaml'
+ fi
+
+ [[ ${bindings} ]] || bindings='none'
+ conf_flags+=( --enable-bindings=${bindings} )
+
+ if use udis86; then
+ conf_flags+=( --with-udis86 )
+ fi
+
+ if use libffi; then
+ local CPPFLAGS=${CPPFLAGS}
+ append-cppflags "$(pkg-config --cflags libffi)"
+ fi
+
+ # 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
+
+ ECONF_SOURCE=${S} \
+ econf "${conf_flags[@]}"
+
+ multilib_build_binaries && cmake_configure
+}
+
+cmake_configure() {
+ # sadly, cmake doesn't seem to have host autodetection
+ # but it's fairly easy to steal this from configured autotools
+ local targets=$(sed -n -e 's/^TARGETS_TO_BUILD=//p' Makefile.config || die)
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLLVM_TARGETS_TO_BUILD="${targets// /;}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ )
+
+ BUILD_DIR=${S%/}_cmake \
+ cmake-utils_src_configure
+}
+
+set_makeargs() {
+ MAKEARGS=(
+ VERBOSE=1
+ REQUIRES_RTTI=1
+ GENTOO_LIBDIR=$(get_libdir)
+ )
+
+ # for tests, we want it all! otherwise, we may use a little filtering...
+ # adding ONLY_TOOLS also disables unittest building...
+ if [[ ${EBUILD_PHASE_FUNC} != src_test ]]; then
+ local tools=( llvm-config )
+ use clang && tools+=( clang )
+
+ if multilib_build_binaries; 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 llvm-prof llvm-ranlib bugpoint
+ )
+
+ # those tools require 'lto' built first, so we need to delay
+ # building them to a second run
+ if [[ ${1} != -1 ]]; then
+ use gold && tools+=( gold )
+ fi
+ fi
+
+ MAKEARGS+=(
+ # filter tools + disable unittests implicitly
+ ONLY_TOOLS="${tools[*]}"
+
+ # this disables unittests & docs from clang
+ BUILD_CLANG_ONLY=YES
+ )
+ fi
+}
+
+multilib_src_compile() {
+ local MAKEARGS
+ set_makeargs -1
+ emake "${MAKEARGS[@]}"
+
+ if multilib_build_binaries; then
+ set_makeargs
+ emake -C tools "${MAKEARGS[@]}"
+
+ if use doc; then
+ emake -C "${S}"/docs -f Makefile.sphinx man
+ emake -C "${S}"/tools/clang/docs/tools \
+ BUILD_FOR_WEBSITE=1 DST_MAN_DIR="${T}"/ man
+ emake -C "${S}"/docs -f Makefile.sphinx html
+ fi
+ fi
+
+ if use debug; then
+ pax-mark m Debug+Asserts+Checks/bin/llvm-rtdyld
+ pax-mark m Debug+Asserts+Checks/bin/lli
+ else
+ pax-mark m Release/bin/llvm-rtdyld
+ pax-mark m Release/bin/lli
+ fi
+}
+
+multilib_src_test() {
+ local MAKEARGS
+ set_makeargs
+
+ # build the remaining tools & unittests
+ emake "${MAKEARGS[@]}"
+
+ pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests
+ pax-mark m unittests/ExecutionEngine/MCJIT/Release/MCJITTests
+ pax-mark m unittests/Support/Release/SupportTests
+
+ emake "${MAKEARGS[@]}" check
+ use clang && emake "${MAKEARGS[@]}" -C tools/clang test
+}
+
+src_install() {
+ 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
+ )
+
+ multilib-minimal_src_install
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ use kernel_FreeBSD && use clang && rm "${ED}"usr/lib/clang/${PV}/include/{arm_neon,std,float,iso,limits,tgmath,varargs}*.h
+}
+
+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
+
+ if ! multilib_build_binaries; then
+ # Drop all the executables since LLVM doesn't like to
+ # clobber when installing.
+ rm -r "${ED}"/usr/bin || die
+
+ # Backwards compat, will be happily removed someday.
+ dosym "${CHOST}"-llvm-config /tmp/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.
+ if use doc; then
+ doman "${S}"/docs/_build/man/*.1
+ use clang && doman "${T}"/clang.1
+ dohtml -r "${S}"/docs/_build/html/
+ else
+ doman "${WORKDIR}"/${P}-manpages/*.1
+ fi
+
+ # Symlink the gold plugin.
+ if use gold; then
+ dodir /usr/${CHOST}/binutils-bin/lib/bfd-plugins
+ dosym ../../../../$(get_libdir)/LLVMgold.so \
+ /usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so
+ fi
+
+ # install cmake modules
+ emake -C "${S%/}"_cmake/cmake/modules DESTDIR="${D}" install
+ fi
+
+ # Fix install_names on Darwin. The build system is too complicated
+ # to just fix this, so we correct it post-install
+ local lib= f= odylib= libpv=${PV}
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ eval $(grep PACKAGE_VERSION= configure)
+ [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
+ for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib ; do
+ # libEnhancedDisassembly is Darwin10 only, so non-fatal
+ # + omit clang libs if not enabled
+ [[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+ ebegin "fixing install_name of $lib"
+ install_name_tool \
+ -id "${EPREFIX}"/usr/lib/${lib} \
+ "${ED}"/usr/lib/${lib}
+ eend $?
+ done
+ for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib{LTO,clang}.dylib ; do
+ # omit clang libs if not enabled
+ [[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+ odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib)
+ ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
+ install_name_tool \
+ -change "${odylib}" \
+ "${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib \
+ -change "@rpath/libclang.dylib" \
+ "${EPREFIX}"/usr/lib/libclang.dylib \
+ -change "${S}"/Release/lib/libclang.dylib \
+ "${EPREFIX}"/usr/lib/libclang.dylib \
+ "${f}"
+ eend $?
+ done
+ fi
+}
+
+multilib_src_install_all() {
+ insinto /usr/share/vim/vimfiles/syntax
+ doins utils/vim/*.vim
+
+ if use clang; then
+ cd tools/clang || die
+
+ if use static-analyzer ; then
+ dobin tools/scan-build/ccc-analyzer
+ dosym ccc-analyzer /usr/bin/c++-analyzer
+ dobin tools/scan-build/scan-build
+
+ insinto /usr/share/${PN}
+ doins tools/scan-build/scanview.css
+ doins tools/scan-build/sorttable.js
+ fi
+
+ python_inst() {
+ if use static-analyzer ; then
+ pushd tools/scan-view >/dev/null || die
+
+ python_doscript scan-view
+
+ touch __init__.py || die
+ python_moduleinto clang
+ python_domodule __init__.py Reporter.py Resources ScanView.py startfile.py
+
+ popd >/dev/null || die
+ fi
+
+ if use python ; then
+ pushd bindings/python/clang >/dev/null || die
+
+ python_moduleinto clang
+ python_domodule __init__.py cindex.py enumerations.py
+
+ popd >/dev/null || die
+ fi
+
+ # AddressSanitizer symbolizer (currently separate)
+ python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
+ }
+ python_foreach_impl python_inst
+ fi
+}