Commits

Providence SALUMU committed a3c2833

adds llvm-2.9-includes-for-llseek64.patch

Comments (0)

Files changed (15)

+These are my mods to make the ebuilds in this overlay to compile with the following:
+
+1. gcc-4.7.0
+============
+gcc (Gentoo 4.7.0_alpha20110924) 4.7.0-alpha20110924 20110924 (experimental)
+Copyright (C) 2011 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+2. CFLAGS
+=========
+CFLAGS="-march=corei7 -mno-cx16 -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -mno-sse4.1 -mno-lzcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=corei7 -O2 -pipe"
+
+smunix

sys-devel/llvm/ChangeLog

+# ChangeLog for sys-devel/llvm
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/ChangeLog,v 1.47 2011/10/04 11:43:37 voyageur Exp $
+
+  04 Oct 2011; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.8-r2.ebuild,
+  -llvm-2.8-r4.ebuild, llvm-2.9-r2.ebuild, llvm-9999.ebuild:
+  Fix forced -O3 -fomit-frame-pointer CFLAGS again, bug #385543
+
+  03 Oct 2011; Bernard Cafarelli <voyageur@gentoo.org> -llvm-2.8-r1.ebuild,
+  llvm-2.8-r2.ebuild, llvm-2.8-r4.ebuild, -llvm-2.9-r1.ebuild,
+  llvm-2.9-r2.ebuild, llvm-9999.ebuild, metadata.xml:
+  Rename alltargets USE flag to multitarget, bug #382307. Clean bison
+  dependency, depending only on new enough one. Drop some versions
+
+  28 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> metadata.xml:
+  USE="libffi" is now global USE flag.
+
+  15 Jul 2011; Kacper Kowalik <xarthisius@gentoo.org> llvm-2.8-r2.ebuild:
+  ppc stable wrt #360553
+
+  06 Jun 2011; Bernard Cafarelli <voyageur@gentoo.org> llvm-9999.ebuild:
+  Update live ebuild to sync latest ebuild changes (vim-syntax, libffi, ...)
+
+*llvm-2.9-r2 (23 May 2011)
+
+  23 May 2011; Bernard Cafarelli <voyageur@gentoo.org> +llvm-2.9-r2.ebuild,
+  +files/llvm-2.9-Operator.h-c++0x.patch:
+  Fix header for gcc 4.6, bug #365925
+
+  21 Apr 2011; Fabian Groffen <grobian@gentoo.org> llvm-2.9-r1.ebuild,
+  llvm-9999.ebuild:
+  Fix broken reference that I missed yesterday
+
+  20 Apr 2011; Fabian Groffen <grobian@gentoo.org> llvm-2.9-r1.ebuild,
+  llvm-9999.ebuild:
+  Fix install_name_tooling
+
+*llvm-2.8-r4 (15 Apr 2011)
+
+  15 Apr 2011; Bernard Cafarelli <voyageur@gentoo.org> -llvm-2.8-r3.ebuild,
+  +llvm-2.8-r4.ebuild, -llvm-2.9.ebuild:
+  Also update 2.8 branch with libffi/debug changes
+
+*llvm-2.9-r1 (15 Apr 2011)
+
+  15 Apr 2011; Bernard Cafarelli <voyageur@gentoo.org> +llvm-2.9-r1.ebuild:
+  Fix libffi include search path and debug flags, bugs #363595 and #362567
+
+  10 Apr 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org> llvm-2.8-r2.ebuild:
+  x86 stable wrt bug #360553
+
+*llvm-2.9 (07 Apr 2011)
+
+  07 Apr 2011; Bernard Cafarelli <voyageur@gentoo.org> +llvm-2.9.ebuild:
+  Version bump
+
+  28 Mar 2011; Christoph Mende <angelos@gentoo.org> llvm-2.8-r2.ebuild:
+  Stable on amd64 wrt bug #360553
+
+*llvm-2.8-r3 (28 Mar 2011)
+
+  28 Mar 2011; Bernard Cafarelli <voyageur@gentoo.org>
+  -files/llvm-2.6-nodoctargz.patch, -llvm-2.7.ebuild, -llvm-2.7-r2.ebuild,
+  +llvm-2.8-r3.ebuild:
+  Install vim syntax files with USE=vim-syntax, bug #360147. Also drop 2.7
+  versions
+
+  14 Mar 2011; Fabian Groffen <grobian@gentoo.org> llvm-2.8-r2.ebuild:
+  Marked ~x86-linux
+
+  28 Feb 2011; Bernard Cafarelli <voyageur@gentoo.org>
+  +files/llvm-2.9-nodoctargz.patch, llvm-9999.ebuild:
+  Fix depend on live ebuild, and finally update nodoc patch, bug #348701
+
+  14 Feb 2011; Kacper Kowalik <xarthisius@gentoo.org> llvm-2.8-r1.ebuild:
+  ppc stable wrt #336371
+
+*llvm-2.8-r2 (19 Dec 2010)
+
+  19 Dec 2010; Bernard Cafarelli <voyageur@gentoo.org> +llvm-2.8-r2.ebuild,
+  +files/llvm-2.8-alignof.patch:
+  Backport to rename alignof, fixes C++'0x compilers support
+
+  11 Nov 2010; Markos Chandras <hwoarang@gentoo.org> llvm-2.8-r1.ebuild:
+  Stable on amd64 wrt bug #336371
+
+  09 Nov 2010; Thomas Kahle <tomka@gentoo.org> llvm-2.8-r1.ebuild:
+  x86 stable per bug 336371
+
+  24 Oct 2010; Fabian Groffen <grobian@gentoo.org> llvm-2.8-r1.ebuild,
+  llvm-9999.ebuild:
+  Update reference fixing for Darwin for newer more strict versions of
+  Portage
+
+  23 Oct 2010; Fabian Groffen <grobian@gentoo.org> llvm-2.8-r1.ebuild,
+  +files/llvm-2.8-darwin8.patch, llvm-9999.ebuild:
+  Fix compilation on Mac OS X Tiger (10.4, Darwin 8), fix install_names for
+  new libs also, bug #342289
+
+*llvm-2.8-r1 (08 Oct 2010)
+
+  08 Oct 2010; Bernard Cafarelli <voyageur@gentoo.org> -llvm-2.8.ebuild,
+  +llvm-2.8-r1.ebuild:
+  SRC_URI arrow workaround to fetch updated tarball with correct package
+  version, thanks Alexey Charkov <alchark@gmail.com> in bug #340106 for
+  spotting it
+
+  06 Oct 2010; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.8.ebuild,
+  llvm-9999.ebuild:
+  Tests now use an internal framework, dejagnu not needed anymore
+
+*llvm-2.8 (06 Oct 2010)
+
+  06 Oct 2010; Bernard Cafarelli <voyageur@gentoo.org> +llvm-2.8.ebuild:
+  2.8 version bump
+
+  21 Sep 2010; Bernard Cafarelli <voyageur@gentoo.org> llvm-9999.ebuild:
+  Also fix live ebuild
+
+*llvm-2.7-r2 (21 Sep 2010)
+
+  21 Sep 2010; Bernard Cafarelli <voyageur@gentoo.org> -llvm-2.7-r1.ebuild,
+  +llvm-2.7-r2.ebuild:
+  Fix the rpath sed so llvm-* binaries actually find the llvm shared library
+
+  20 Sep 2010; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.7-r1.ebuild:
+  udis86 needs pic on amd64, bug #337969
+
+*llvm-2.7-r1 (17 Sep 2010)
+
+  17 Sep 2010; Bernard Cafarelli <voyageur@gentoo.org> +llvm-2.7-r1.ebuild,
+  llvm-9999.ebuild:
+  Enable shared library, move libs and plugins to fix bug #337467
+
+  04 Sep 2010; Fabian Groffen <grobian@gentoo.org> llvm-2.7.ebuild:
+  Also fix libEnhancedDisassembly, which is only built on Darwin 10 (Mac OS
+  X Snow Leopard)
+
+  03 Sep 2010; Fabian Groffen <grobian@gentoo.org> llvm-2.7.ebuild:
+  Marked ~amd64-linux
+
+  26 Aug 2010; Fabian Groffen <grobian@gentoo.org> llvm-2.7.ebuild,
+  llvm-9999.ebuild:
+  Bump to EAPI=3, make Prefix aware, add support for Darwin platforms,
+  bug #333387
+
+  20 Jul 2010; Bernard Cafarelli <voyageur@gentoo.org> -llvm-2.6-r2.ebuild,
+  -files/llvm-2.6-cflags.patch:
+  Drop 2.6 version
+
+*llvm-9999 (01 Jun 2010)
+
+  01 Jun 2010; Bernard Cafarelli <voyageur@gentoo.org> +llvm-9999.ebuild:
+  Add live version, bug #320919
+
+  01 Jun 2010; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.6-r2.ebuild,
+  llvm-2.7.ebuild:
+  Really fix bug #293382, llvm-gcc was still in DEPEND
+
+*llvm-2.7 (27 Apr 2010)
+
+  27 Apr 2010; Bernard Cafarelli <voyageur@gentoo.org> -llvm-2.6-r1.ebuild,
+  +llvm-2.7.ebuild, +files/llvm-2.7-nodoctargz.patch:
+  2.7 official release version bump
+
+  26 Apr 2010; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.6-r2.ebuild:
+  --without-udis86 is broken in configure script
+
+*llvm-2.6-r2 (26 Apr 2010)
+
+  26 Apr 2010; Bernard Cafarelli <voyageur@gentoo.org> +llvm-2.6-r2.ebuild,
+  metadata.xml:
+  Add udis86 support, thanks to chithanh in bug #317151
+
+*llvm-2.6-r1 (18 Mar 2010)
+
+  18 Mar 2010; Bernard Cafarelli <voyageur@gentoo.org> -llvm-2.6.ebuild,
+  +llvm-2.6-r1.ebuild, +files/llvm-2.6-cflags.patch:
+  Remove forced -O3 -fomit-frame-pointer CFLAGS, bug #308145
+
+  17 Nov 2009; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.6.ebuild:
+  Drop llvm-gcc depend, as it triggers circular dependency on first install
+  (warn the user if it is not found instead), bug #293382
+
+  26 Oct 2009; Bernard Cafarelli <voyageur@gentoo.org>
+  files/llvm-2.6-commandguide-nops.patch:
+  Fix the patch, after test by flameeyes
+
+  26 Oct 2009; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.6.ebuild,
+  +files/llvm-2.6-commandguide-nops.patch:
+  Disable .ps doc generation, these are just the man pages. Bug #290581
+
+  26 Oct 2009; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.6.ebuild,
+  metadata.xml:
+  Fix libffi automagic dependency, bug #289933
+
+*llvm-2.6 (25 Oct 2009)
+
+  25 Oct 2009; Bernard Cafarelli <voyageur@gentoo.org>
+  -llvm-2.6_pre2.ebuild, +llvm-2.6.ebuild:
+  Bump to final 2.6 release
+
+  07 Oct 2009; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.6_pre2.ebuild,
+  +files/llvm-2.6-nodoctargz.patch, -files/llvm-2.6-nohtmltargz.patch:
+  Add USE flag for ocaml bindings, complete doc patch to fix ocmal doc
+  failure, see bug #186279
+
+  07 Oct 2009; Bernard Cafarelli <voyageur@gentoo.org> llvm-2.6_pre2.ebuild:
+  Fix llvm-gcc location, work with ${ROOT}
+
+*llvm-2.6_pre2 (05 Oct 2009)
+
+  05 Oct 2009; Bernard Cafarelli <voyageur@gentoo.org>
+  +llvm-2.6_pre2.ebuild, +files/llvm-2.6-nohtmltargz.patch, +metadata.xml:
+  Initial commit, thanks everyone in bug #186279 and others
+

sys-devel/llvm/Manifest

+AUX llvm-2.6-commandguide-nops.patch 975 RMD160 1178c27a8845c2c86d6d381ba3d95b4b9b627f1e SHA1 41b9d8c3ae0ed1023ec72bf629c53fa8981e0264 SHA256 0e36fb43e020fa380230a8c6f2a79b9a19e12e857e833ef856e2b41aaa283649
+AUX llvm-2.7-nodoctargz.patch 1878 RMD160 a6134fd292a1a2c6a594e787ce73b15012be04bb SHA1 9d32a0e15791789d8bf58dfecf9580a00d150319 SHA256 983657329ebede731b397ba0256d729b3958f39faea64c9f7d065ab8d2a3e7fd
+AUX llvm-2.8-alignof.patch 2522 RMD160 6a359ba15b1943929541c5e7bbd6a2a6480e85bc SHA1 41f11ba3fdb4d6cd8761380594bd777fd83e2f96 SHA256 a9f7add4f4002bf9af438c0c4d1ca86875d6214a5044334325a60cdcbc8a3cdc
+AUX llvm-2.8-darwin8.patch 576 RMD160 ed1d9c8d9eda3fecf55b7848eee76cdd92a59a13 SHA1 60d0772513d66e7a79d70f0a98f03c67ab1d1d0f SHA256 6db04d9bb5fe65f8a92972988477328a7358e325abca32f30a716ff454d0fe21
+AUX llvm-2.9-Operator.h-c++0x.patch 2062 RMD160 3f137dc80cac2d77b978a332a731e443a15e6a7c SHA1 8bc7357b793cb5cc83e54f056d54d311ec93853d SHA256 1c37346b0f412556dc979fd510585f3e20d2d45319ec095dbdec37a582d590c7
+AUX llvm-2.9-includes-for-llseek64.patch 463 RMD160 be597d7e0dd850661b17409d2603d994673a67eb SHA1 0b04d13109485fcfd510a5c16b83bedd361a68bb SHA256 e1bb461146bbca029b72ffaa9821cb85e69bfe41f6fc8c57f11102517c639435
+AUX llvm-2.9-nodoctargz.patch 1569 RMD160 6589aa0a41f47e915ce93fe6dcf68dd601c3bcdc SHA1 19795ec9c34e6ec5539ec6a77944ceb51abdef72 SHA256 62f1b080364d94e528bb34f0063562d16a59395aa7f97277bba88fbd93e00b84
+DIST llvm-2.8-r1.tgz 9112527 RMD160 3f5a71d07e105a7cf46eafc7a9006a927035012c SHA1 6d49fe039d28e8664de25491c775cb2c599e30c1 SHA256 25addb742f1c6cc12877ed0ee924dda962d848368ee095be8e48342ae613d43b
+DIST llvm-2.9.tgz 9574781 RMD160 caeaa067fda1eb34196b356a087645f83731cfb7 SHA1 500f587f840199ac53c4fc7572839d08fa9d9123 SHA256 661236cfa17428b48cfa9cbb9909f7569c64b8ecd219fd91dbc00e3b557b3779
+EBUILD llvm-2.8-r2.ebuild 6156 RMD160 9e76bf90d103993330bcf8701c8ee490117c3ab1 SHA1 f691fe35a6a02da441fd9aa1c52a04a2aff298a9 SHA256 9bc669e88d0a49b5fa7c5ada8da9752cade9876fb03bb16cbad1afebee507d1b
+EBUILD llvm-2.9-r2.ebuild 6191 RMD160 582e6a24e96d3ee58652139de333ccf00a74a0cf SHA1 d25ee98c874154127fa6b24cd878b9dbfaeb81d3 SHA256 de960b206f958a212366348edc732f67d345ff4c89a958321c767705d3bdabbd
+EBUILD llvm-9999.ebuild 6016 RMD160 4976ef4a36d8df3f6e572239e1f72bb76016f994 SHA1 99bd699bf214e7474719da3a48ef86dac0d3dd93 SHA256 c2ac834a217cc3826d6d486b68332c3b1a562496f477f15804802c435af59e17
+MISC ChangeLog 7819 RMD160 7a450a3763661fb8cef6e2f728df2c3fba20eebe SHA1 6179ad1ff54f098d36605da79b205f9870137775 SHA256 4356332d05c5632a4ef096b73b82bbc24e30bd6ef6d05995392d1f290e8ed239
+MISC metadata.xml 2234 RMD160 b14138857d612a9f5568760b1e70b80f344d978c SHA1 53d1e496b0e80e9acc24fd1cb8858e9efc93d7c0 SHA256 83a322d633e38210fe9946ea92902a17142863fe26578bb1b1bad773952b0419

sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch

+--- docs/CommandGuide/Makefile.orig	2009-10-26 16:54:33.000000000 +0100
++++ docs/CommandGuide/Makefile	2009-10-26 17:32:03.000000000 +0100
+@@ -19,7 +19,7 @@
+ DST_PS_DIR=ps/
+ 
+ # If we are in BUILD_FOR_WEBSITE mode, default to the all target.
+-all:: html man ps
++all:: html man
+ 
+ clean:
+ 	rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
+@@ -81,7 +81,7 @@
+ MAN_DIR  := $(PROJ_mandir)/man1
+ PS_DIR   := $(PROJ_docsdir)/ps
+ 
+-install-local:: $(HTML) $(INSTALL_MANS) $(PS)
++install-local:: $(HTML) $(INSTALL_MANS)
+ 	$(Echo) Installing HTML CommandGuide Documentation
+ 	$(Verb) $(MKDIR) $(HTML_DIR)
+ 	$(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
+@@ -90,9 +90,6 @@
+ 	$(Echo) Installing MAN CommandGuide Documentation
+ 	$(Verb) $(MKDIR) $(MAN_DIR)
+ 	$(Verb) $(DataInstall) $(INSTALL_MANS) $(MAN_DIR)
+-	$(Echo) Installing PS CommandGuide Documentation
+-	$(Verb) $(MKDIR) $(PS_DIR)
+-	$(Verb) $(DataInstall) $(PS) $(PS_DIR)
+ 
+ uninstall-local::
+ 	$(Echo) Uninstalling CommandGuide Documentation

sys-devel/llvm/files/llvm-2.7-nodoctargz.patch

+--- docs/Makefile.orig	2010-04-26 15:00:58.000000000 +0200
++++ docs/Makefile	2010-04-26 15:03:12.000000000 +0200
+@@ -46,13 +46,12 @@
+ # 'make generated BUILD_FOR_WEBSITE=1'
+ generated:: doxygen ocamldoc
+ 
+-install-html: $(PROJ_OBJ_DIR)/html.tar.gz
++install-html:
+ 	$(Echo) Installing HTML documentation
+ 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
+ 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
+ 	$(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
+ 	$(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
+-	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ 
+ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
+ 	$(Echo) Packaging HTML documentation
+@@ -64,12 +63,11 @@
+ install-doxygen: doxygen
+ 	$(Echo) Installing doxygen documentation
+ 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
+-	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ 	$(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
+ 	  $(FIND) . -type f -exec \
+ 	    $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
+ 
+-doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
++doxygen: regendoc
+ 
+ regendoc:
+ 	$(Echo) Building doxygen documentation
+@@ -95,7 +93,6 @@
+ install-ocamldoc: ocamldoc
+ 	$(Echo) Installing ocamldoc documentation
+ 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
+-	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ 	$(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
+ 	  $(FIND) . -type f -exec \
+ 	    $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
+@@ -105,7 +102,6 @@
+ 	$(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar*
+ 	$(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
+ 	$(Verb) $(GZIP) $(PROJ_OBJ_DIR)/ocamldoc.tar
+-	$(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/
+ 
+ regen-ocamldoc:
+ 	$(Echo) Building ocamldoc documentation

sys-devel/llvm/files/llvm-2.8-alignof.patch

+Index: include/llvm/ADT/StringMap.h
+===================================================================
+--- include/llvm/ADT/StringMap.h	(révision 117773)
++++ include/llvm/ADT/StringMap.h	(révision 117774)
+@@ -167,7 +167,7 @@
+ 
+     unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
+       KeyLength+1;
+-    unsigned Alignment = alignof<StringMapEntry>();
++    unsigned Alignment = alignOf<StringMapEntry>();
+ 
+     StringMapEntry *NewItem =
+       static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));
+Index: include/llvm/Support/AlignOf.h
+===================================================================
+--- include/llvm/Support/AlignOf.h	(révision 117773)
++++ include/llvm/Support/AlignOf.h	(révision 117774)
+@@ -49,12 +49,12 @@
+ 
+ };
+ 
+-/// alignof - A templated function that returns the mininum alignment of
++/// alignOf - A templated function that returns the mininum alignment of
+ ///  of a type.  This provides no extra functionality beyond the AlignOf
+ ///  class besides some cosmetic cleanliness.  Example usage:
+-///  alignof<int>() returns the alignment of an int.
++///  alignOf<int>() returns the alignment of an int.
+ template <typename T>
+-static inline unsigned alignof() { return AlignOf<T>::Alignment; }
++static inline unsigned alignOf() { return AlignOf<T>::Alignment; }
+ 
+ } // end namespace llvm
+ #endif
+Index: include/llvm/Support/Allocator.h
+===================================================================
+--- include/llvm/Support/Allocator.h	(révision 117773)
++++ include/llvm/Support/Allocator.h	(révision 117774)
+@@ -201,7 +201,7 @@
+       char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
+                                               (char *)Slab + Slab->Size;
+       for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
+-        Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
++        Ptr = Allocator.AlignPtr(Ptr, alignOf<T>());
+         if (Ptr + sizeof(T) <= End)
+           reinterpret_cast<T*>(Ptr)->~T();
+       }
+Index: include/llvm/CodeGen/SlotIndexes.h
+===================================================================
+--- include/llvm/CodeGen/SlotIndexes.h	(révision 117773)
++++ include/llvm/CodeGen/SlotIndexes.h	(révision 117774)
+@@ -393,7 +393,7 @@
+       IndexListEntry *entry =
+         static_cast<IndexListEntry*>(
+           ileAllocator.Allocate(sizeof(IndexListEntry),
+-          alignof<IndexListEntry>()));
++          alignOf<IndexListEntry>()));
+ 
+       new (entry) IndexListEntry(mi, index);
+ 

sys-devel/llvm/files/llvm-2.8-darwin8.patch

+Avoid like in Makefile.rules
+ld: -rpath can only be used when targeting Mac OS X 10.5 or later
+
+--- unittests/Makefile.unittest
++++ unittests/Makefile.unittest
+@@ -37,7 +37,9 @@
+ ifeq ($(ENABLE_SHARED), 1)
+   # Add the absolute path to the dynamic library.  This is ok because
+   # we'll never install unittests.
++ifneq ($(DARWIN_MAJVERS),4)
+   LD.Flags += $(RPATH) -Wl,$(SharedLibDir)
++endif
+   # Also set {DYLD,LD}_LIBRARY_PATH because OSX ignores the rpath most
+   # of the time.
+   Run.Shared := $(SHLIBPATH_VAR)="$(SharedLibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)"

sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch

+--- llvm/trunk/include/llvm/Operator.h	2011/02/07 16:40:21	125006
++++ llvm/trunk/include/llvm/Operator.h	2011/05/08 01:59:22	131062
+@@ -186,28 +186,46 @@
+ };
+ 
+ class AddOperator
+-  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {};
++  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
++  ~AddOperator(); // DO NOT IMPLEMENT
++};
+ class SubOperator
+-  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {};
++  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
++  ~SubOperator(); // DO NOT IMPLEMENT
++};
+ class MulOperator
+-  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {};
++  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
++  ~MulOperator(); // DO NOT IMPLEMENT
++};
+ class ShlOperator
+-  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {};
++  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
++  ~ShlOperator(); // DO NOT IMPLEMENT
++};
+ 
+   
+ class SDivOperator
+-  : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {};
++  : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
++  ~SDivOperator(); // DO NOT IMPLEMENT
++};
+ class UDivOperator
+-  : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {};
++  : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
++  ~UDivOperator(); // DO NOT IMPLEMENT
++};
+ class AShrOperator
+-  : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {};
++  : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
++  ~AShrOperator(); // DO NOT IMPLEMENT
++};
+ class LShrOperator
+-  : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {};
++  : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
++  ~LShrOperator(); // DO NOT IMPLEMENT
++};
+   
+   
+   
+ class GEPOperator
+   : public ConcreteOperator<Operator, Instruction::GetElementPtr> {
++  ~GEPOperator(); // DO NOT IMPLEMENT
++
+   enum {
+     IsInBounds = (1 << 0)
+   };

sys-devel/llvm/files/llvm-2.9-includes-for-llseek64.patch

+--- lib/ExecutionEngine/JIT/Intercept.cpp
++++ lib/ExecutionEngine/JIT/Intercept.cpp
+@@ -52,6 +52,8 @@ static void runAtExitHandlers() {
+ #include <sys/stat.h>
+ #endif
+ #include <fcntl.h>
++#include <sys/types.h>
++#include <unistd.h>
+ /* stat functions are redirecting to __xstat with a version number.  On x86-64 
+  * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat' 
+  * available as an exported symbol, so we have to add it explicitly.

sys-devel/llvm/files/llvm-2.9-nodoctargz.patch

+--- docs/Makefile.orig	2011-02-28 21:30:46.000000000 +0100
++++ docs/Makefile	2011-02-28 21:35:22.000000000 +0100
+@@ -53,13 +53,12 @@
+ # 'make generated BUILD_FOR_WEBSITE=1'
+ generated:: $(generated_targets)
+ 
+-install-html: $(PROJ_OBJ_DIR)/html.tar.gz
++install-html:
+ 	$(Echo) Installing HTML documentation
+ 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
+ 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
+ 	$(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
+ 	$(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
+-	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ 
+ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
+ 	$(Echo) Packaging HTML documentation
+@@ -71,12 +70,11 @@
+ install-doxygen: doxygen
+ 	$(Echo) Installing doxygen documentation
+ 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
+-	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ 	$(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
+ 	  $(FIND) . -type f -exec \
+ 	    $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
+ 
+-doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
++doxygen: regendoc
+ 
+ regendoc:
+ 	$(Echo) Building doxygen documentation
+@@ -102,7 +100,6 @@
+ install-ocamldoc: ocamldoc
+ 	$(Echo) Installing ocamldoc documentation
+ 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
+-	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ 	$(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
+ 	  $(FIND) . -type f -exec \
+ 	    $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;

sys-devel/llvm/llvm-2.8-r2.ebuild

+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-2.8-r2.ebuild,v 1.7 2011/10/04 11:43:37 voyageur Exp $
+
+EAPI="3"
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+# Upstream silently re-released the tarball...
+# drop the -> in 2.9
+SRC_URI="http://llvm.org/releases/${PV}/${P}.tgz -> ${P}-r1.tgz"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="debug +libffi llvm-gcc multitarget ocaml test udis86"
+
+DEPEND="dev-lang/perl
+	>=sys-devel/make-3.79
+	>=sys-devel/flex-2.5.4
+	>=sys-devel/bison-1.875d
+	|| ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1 )
+	|| ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
+	libffi? ( virtual/libffi )
+	ocaml? ( dev-lang/ocaml )
+	udis86? ( amd64? ( dev-libs/udis86[pic] )
+		!amd64? ( dev-libs/udis86 ) )"
+RDEPEND="dev-lang/perl"
+
+S=${WORKDIR}/${PN}-${PV/_pre*}
+
+pkg_setup() {
+	# 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 [[ ${broken_gcc} == *" ${version} "* ]] ; 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 [[ ${CHOST} == i*86-* && ${broken_gcc_x86} == *" ${version} "* ]] ; 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 [[ ${CHOST} == x86_64-* && ${broken_gcc_amd64} == *" ${version} "* ]];
+	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_prepare() {
+	# unfortunately ./configure won't listen to --mandir and the-like, so take
+	# care of this.
+	einfo "Fixing install dirs"
+	sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
+		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
+		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
+		-i Makefile.config.in || die "Makefile.config sed failed"
+	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
+		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
+
+	einfo "Fixing rpath and CFLAGS"
+	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
+		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
+		-i Makefile.rules || die "rpath sed failed"
+
+	epatch "${FILESDIR}"/${PN}-2.7-nodoctargz.patch
+	epatch "${FILESDIR}"/${PN}-2.6-commandguide-nops.patch
+	epatch "${FILESDIR}"/${PN}-2.8-darwin8.patch
+	# Upstream backport, r117774
+	epatch "${FILESDIR}"/${P}-alignof.patch
+}
+
+src_configure() {
+	local CONF_FLAGS="--enable-shared"
+
+	if use debug; then
+		CONF_FLAGS="${CONF_FLAGS} --disable-optimized"
+		einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries"
+		# ...and you probably shouldn't use tmpfs, unless it can hold 900MB
+	else
+		CONF_FLAGS="${CONF_FLAGS} \
+			--enable-optimized \
+			--with-optimize-option= \
+			--disable-assertions \
+			--disable-expensive-checks"
+	fi
+
+	if use multitarget; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-targets=all"
+	else
+		CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only"
+	fi
+
+	if use amd64; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-pic"
+	fi
+
+	# things would be built differently depending on whether llvm-gcc is
+	# used or not.
+	local LLVM_GCC_DIR=/dev/null
+	local LLVM_GCC_DRIVER=nope ; local LLVM_GPP_DRIVER=nope
+	if use llvm-gcc ; then
+		if has_version sys-devel/llvm-gcc; then
+			LLVM_GCC_DIR=$(ls -d ${EROOT}/usr/$(get_libdir)/llvm-gcc* 2> /dev/null)
+			LLVM_GCC_DRIVER=$(find ${LLVM_GCC_DIR} -name 'llvm*-gcc' 2> /dev/null)
+			if [[ -z ${LLVM_GCC_DRIVER} ]] ; then
+				die "failed to find installed llvm-gcc, LLVM_GCC_DIR=${LLVM_GCC_DIR}"
+			fi
+			einfo "Using $LLVM_GCC_DRIVER"
+			LLVM_GPP_DRIVER=${LLVM_GCC_DRIVER/%-gcc/-g++}
+		else
+			eerror "llvm-gcc USE flag enabled, but sys-devel/llvm-gcc was not found"
+			eerror "Building with standard gcc, re-merge this package after installing"
+			eerror "llvm-gcc to build with it"
+			eerror "This is normal behavior on first LLVM merge"
+		fi
+	fi
+
+	CONF_FLAGS="${CONF_FLAGS} \
+		--with-llvmgccdir=${LLVM_GCC_DIR} \
+		--with-llvmgcc=${LLVM_GCC_DRIVER} \
+		--with-llvmgxx=${LLVM_GPP_DRIVER}"
+
+	if use ocaml; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-bindings=ocaml"
+	else
+		CONF_FLAGS="${CONF_FLAGS} --enable-bindings=none"
+	fi
+
+	if use udis86; then
+		CONF_FLAGS="${CONF_FLAGS} --with-udis86"
+	fi
+	CONF_FLAGS="${CONF_FLAGS} $(use_enable libffi)"
+	econf ${CONF_FLAGS} || die "econf failed"
+}
+
+src_compile() {
+	emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 || die "emake failed"
+}
+
+src_install() {
+	emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
+
+	# Fix install_names on Darwin.  The build system is too complicated
+	# to just fix this, so we correct it post-install
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		for lib in lib{EnhancedDisassembly,LLVM-${PV},BugpointPasses,LLVMHello,LTO,profile_rt}.dylib ; do
+			# libEnhancedDisassembly is Darwin10 only, so non-fatal
+			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
+			ebegin "fixing install_name of $lib"
+			install_name_tool \
+				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
+				"${ED}"/usr/lib/${PN}/${lib}
+			eend $?
+		done
+		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
+			ebegin "fixing install_name reference to libLLVM-${PV}.dylib of ${f##*/}"
+			install_name_tool \
+				-change "${S}"/Release/lib/libLLVM-${PV}.dylib \
+					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
+				"${f}"
+			eend $?
+		done
+	fi
+}

sys-devel/llvm/llvm-2.9-r2.ebuild

+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-2.9-r2.ebuild,v 1.3 2011/10/04 11:43:37 voyageur Exp $
+
+EAPI="3"
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+SRC_URI="http://llvm.org/releases/${PV}/${P}.tgz"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="debug +libffi llvm-gcc multitarget ocaml test udis86 vim-syntax"
+
+DEPEND="dev-lang/perl
+	>=sys-devel/make-3.79
+	>=sys-devel/flex-2.5.4
+	>=sys-devel/bison-1.875d
+	|| ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1 )
+	|| ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
+	libffi? ( dev-util/pkgconfig
+		virtual/libffi )
+	ocaml? ( dev-lang/ocaml )
+	udis86? ( amd64? ( dev-libs/udis86[pic] )
+		!amd64? ( dev-libs/udis86 ) )"
+RDEPEND="dev-lang/perl
+	libffi? ( virtual/libffi )
+	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
+
+S=${WORKDIR}/${PN}-${PV/_pre*}
+
+pkg_setup() {
+	# 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 [[ ${broken_gcc} == *" ${version} "* ]] ; 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 [[ ${CHOST} == i*86-* && ${broken_gcc_x86} == *" ${version} "* ]] ; 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 [[ ${CHOST} == x86_64-* && ${broken_gcc_amd64} == *" ${version} "* ]];
+	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_prepare() {
+	# unfortunately ./configure won't listen to --mandir and the-like, so take
+	# care of this.
+	einfo "Fixing install dirs"
+	sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
+		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
+		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
+		-i Makefile.config.in || die "Makefile.config sed failed"
+	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
+		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
+
+	einfo "Fixing rpath and CFLAGS"
+	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
+		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
+		-i Makefile.rules || die "rpath sed failed"
+
+	epatch "${FILESDIR}"/${PN}-2.6-commandguide-nops.patch
+	epatch "${FILESDIR}"/${PN}-2.9-nodoctargz.patch
+
+	# Upstream commit r131062
+	epatch "${FILESDIR}"/${P}-Operator.h-c++0x.patch
+
+	# llseek64 includes
+	epatch "${FILESDIR}"/${P}-includes-for-llseek64.patch
+}
+
+src_configure() {
+	local CONF_FLAGS="--enable-shared
+		--with-optimize-option=
+		$(use_enable !debug optimized)
+		$(use_enable debug assertions)
+		$(use_enable debug expensive-checks)"
+
+	if use multitarget; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-targets=all"
+	else
+		CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only"
+	fi
+
+	if use amd64; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-pic"
+	fi
+
+	# things would be built differently depending on whether llvm-gcc is
+	# used or not.
+	local LLVM_GCC_DIR=/dev/null
+	local LLVM_GCC_DRIVER=nope ; local LLVM_GPP_DRIVER=nope
+	if use llvm-gcc ; then
+		if has_version sys-devel/llvm-gcc; then
+			LLVM_GCC_DIR=$(ls -d ${EROOT}/usr/$(get_libdir)/llvm-gcc* 2> /dev/null)
+			LLVM_GCC_DRIVER=$(find ${LLVM_GCC_DIR} -name 'llvm*-gcc' 2> /dev/null)
+			if [[ -z ${LLVM_GCC_DRIVER} ]] ; then
+				die "failed to find installed llvm-gcc, LLVM_GCC_DIR=${LLVM_GCC_DIR}"
+			fi
+			einfo "Using $LLVM_GCC_DRIVER"
+			LLVM_GPP_DRIVER=${LLVM_GCC_DRIVER/%-gcc/-g++}
+		else
+			eerror "llvm-gcc USE flag enabled, but sys-devel/llvm-gcc was not found"
+			eerror "Building with standard gcc, re-merge this package after installing"
+			eerror "llvm-gcc to build with it"
+			eerror "This is normal behavior on first LLVM merge"
+		fi
+	fi
+
+	CONF_FLAGS="${CONF_FLAGS} \
+		--with-llvmgccdir=${LLVM_GCC_DIR} \
+		--with-llvmgcc=${LLVM_GCC_DRIVER} \
+		--with-llvmgxx=${LLVM_GPP_DRIVER}"
+
+	if use ocaml; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-bindings=ocaml"
+	else
+		CONF_FLAGS="${CONF_FLAGS} --enable-bindings=none"
+	fi
+
+	if use udis86; then
+		CONF_FLAGS="${CONF_FLAGS} --with-udis86"
+	fi
+
+	if use libffi; then
+		append-cppflags "$(pkg-config --cflags libffi)"
+	fi
+	CONF_FLAGS="${CONF_FLAGS} $(use_enable libffi)"
+	econf ${CONF_FLAGS} || die "econf failed"
+}
+
+src_compile() {
+	emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 || die "emake failed"
+}
+
+src_install() {
+	emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
+
+	if use vim-syntax; then
+		insinto /usr/share/vim/vimfiles/syntax
+		doins utils/vim/*.vim
+	fi
+
+	# Fix install_names on Darwin.  The build system is too complicated
+	# to just fix this, so we correct it post-install
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO}.dylib {BugpointPasses,LLVMHello,profile_rt}.dylib ; do
+			# libEnhancedDisassembly is Darwin10 only, so non-fatal
+			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
+			ebegin "fixing install_name of $lib"
+			install_name_tool \
+				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
+				"${ED}"/usr/lib/${PN}/${lib}
+			eend $?
+		done
+		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
+			ebegin "fixing install_name reference to libLLVM-${PV}.dylib of ${f##*/}"
+			install_name_tool \
+				-change "@executable_path/../lib/libLLVM-${PV}.dylib" \
+					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
+				"${f}"
+			eend $?
+		done
+	fi
+}

sys-devel/llvm/llvm-9999.ebuild

+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-9999.ebuild,v 1.15 2011/10/04 11:43:37 voyageur Exp $
+
+EAPI="3"
+inherit subversion eutils flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+SRC_URI=""
+ESVN_REPO_URI="http://llvm.org/svn/llvm-project/llvm/trunk"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug +libffi llvm-gcc multitarget ocaml test udis86 vim-syntax"
+
+DEPEND="dev-lang/perl
+	>=sys-devel/make-3.79
+	>=sys-devel/flex-2.5.4
+	>=sys-devel/bison-1.875d
+	|| ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1 )
+	|| ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
+	libffi? ( dev-util/pkgconfig
+		virtual/libffi )
+	ocaml? ( dev-lang/ocaml )
+	udis86? ( amd64? ( dev-libs/udis86[pic] )
+		!amd64? ( dev-libs/udis86 ) )"
+RDEPEND="dev-lang/perl
+	libffi? ( virtual/libffi )
+	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
+
+S=${WORKDIR}/${PN}-${PV/_pre*}
+
+pkg_setup() {
+	# 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 [[ ${broken_gcc} == *" ${version} "* ]] ; 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 [[ ${CHOST} == i*86-* && ${broken_gcc_x86} == *" ${version} "* ]] ; 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 [[ ${CHOST} == x86_64-* && ${broken_gcc_amd64} == *" ${version} "* ]];
+	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_prepare() {
+	# unfortunately ./configure won't listen to --mandir and the-like, so take
+	# care of this.
+	einfo "Fixing install dirs"
+	sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
+		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
+		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
+		-i Makefile.config.in || die "Makefile.config sed failed"
+	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
+		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
+
+	einfo "Fixing rpath and CFLAGS"
+	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
+		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
+		-i Makefile.rules || die "rpath sed failed"
+
+	epatch "${FILESDIR}"/${PN}-2.6-commandguide-nops.patch
+	epatch "${FILESDIR}"/${PN}-2.9-nodoctargz.patch
+}
+
+src_configure() {
+	local CONF_FLAGS="--enable-shared
+		--with-optimize-option=
+		$(use_enable !debug optimized)
+		$(use_enable debug assertions)
+		$(use_enable debug expensive-checks)"
+
+	if use multitarget; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-targets=all"
+	else
+		CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only"
+	fi
+
+	if use amd64; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-pic"
+	fi
+
+	# things would be built differently depending on whether llvm-gcc is
+	# used or not.
+	local LLVM_GCC_DIR=/dev/null
+	local LLVM_GCC_DRIVER=nope ; local LLVM_GPP_DRIVER=nope
+	if use llvm-gcc ; then
+		if has_version sys-devel/llvm-gcc; then
+			LLVM_GCC_DIR=$(ls -d ${EROOT}/usr/$(get_libdir)/llvm-gcc* 2> /dev/null)
+			LLVM_GCC_DRIVER=$(find ${LLVM_GCC_DIR} -name 'llvm*-gcc' 2> /dev/null)
+			if [[ -z ${LLVM_GCC_DRIVER} ]] ; then
+				die "failed to find installed llvm-gcc, LLVM_GCC_DIR=${LLVM_GCC_DIR}"
+			fi
+			einfo "Using $LLVM_GCC_DRIVER"
+			LLVM_GPP_DRIVER=${LLVM_GCC_DRIVER/%-gcc/-g++}
+		else
+			eerror "llvm-gcc USE flag enabled, but sys-devel/llvm-gcc was not found"
+			eerror "Building with standard gcc, re-merge this package after installing"
+			eerror "llvm-gcc to build with it"
+			eerror "This is normal behavior on first LLVM merge"
+		fi
+	fi
+
+	CONF_FLAGS="${CONF_FLAGS} \
+		--with-llvmgccdir=${LLVM_GCC_DIR} \
+		--with-llvmgcc=${LLVM_GCC_DRIVER} \
+		--with-llvmgxx=${LLVM_GPP_DRIVER}"
+
+	if use ocaml; then
+		CONF_FLAGS="${CONF_FLAGS} --enable-bindings=ocaml"
+	else
+		CONF_FLAGS="${CONF_FLAGS} --enable-bindings=none"
+	fi
+
+	if use udis86; then
+		CONF_FLAGS="${CONF_FLAGS} --with-udis86"
+	fi
+
+	if use libffi; then
+		append-cppflags "$(pkg-config --cflags libffi)"
+	fi
+	CONF_FLAGS="${CONF_FLAGS} $(use_enable libffi)"
+	econf ${CONF_FLAGS} || die "econf failed"
+}
+
+src_compile() {
+	emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 || die "emake failed"
+}
+
+src_install() {
+	emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
+
+	if use vim-syntax; then
+		insinto /usr/share/vim/vimfiles/syntax
+		doins utils/vim/*.vim
+	fi
+
+	# Fix install_names on Darwin.  The build system is too complicated
+	# to just fix this, so we correct it post-install
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO}.dylib {BugpointPasses,LLVMHello,profile_rt}.dylib ; do
+			# libEnhancedDisassembly is Darwin10 only, so non-fatal
+			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
+			ebegin "fixing install_name of $lib"
+			install_name_tool \
+				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
+				"${ED}"/usr/lib/${PN}/${lib}
+			eend $?
+		done
+		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
+			ebegin "fixing install_name reference to libLLVM-${PV}.dylib of ${f##*/}"
+			install_name_tool \
+				-change "@executable_path/../lib/libLLVM-${PV}.dylib" \
+					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
+				"${f}"
+			eend $?
+		done
+	fi
+}

sys-devel/llvm/metadata.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer>
+		<email>voyageur@gentoo.org</email>
+		<name>Bernard Cafarelli</name>
+	</maintainer>
+	<longdescription>Low Level Virtual Machine (LLVM) is:
+   1. A compilation strategy designed to enable effective program optimization across the entire lifetime of a program. LLVM supports effective optimization at compile time, link-time (particularly interprocedural), run-time and offline (i.e., after software is installed), while remaining transparent to developers and maintaining compatibility with existing build scripts.
+   2. A virtual instruction set - LLVM is a low-level object code representation that uses simple RISC-like instructions, but provides rich, language-independent, type information and dataflow (SSA) information about operands. This combination enables sophisticated transformations on object code, while remaining light-weight enough to be attached to the executable. This combination is key to allowing link-time, run-time, and offline transformations.
+   3. A compiler infrastructure - LLVM is also a collection of source code that implements the language and compilation strategy. The primary components of the LLVM infrastructure are a GCC-based C and C++ front-end, a link-time optimization framework with a growing set of global and interprocedural analyses and transformations, static back-ends for many popular (and some obscure) architectures, a back-end which emits portable C code, and a Just-In-Time compilers for several architectures.
+   4. LLVM does not imply things that you would expect from a high-level virtual machine. It does not require garbage collection or run-time code generation (In fact, LLVM makes a great static compiler!). Note that optional LLVM components can be used to build high-level virtual machines and other systems that need these services.</longdescription>
+	<use>
+		<flag name='llvm-gcc'>Build LLVM with <pkg>sys-devel/llvm-gcc</pkg></flag>
+		<flag name='multitarget'>Build all host targets (default: host only)</flag>
+		<flag name='udis86'>Enable support for <pkg>dev-libs/udis86</pkg> disassembler library</flag>
+	</use>
+</pkgmetadata>