diff options
author | Stefan Kuhn <wuodan@hispeed.ch> | 2012-07-02 15:56:04 +0200 |
---|---|---|
committer | Stefan Kuhn <wuodan@hispeed.ch> | 2012-07-02 15:56:04 +0200 |
commit | 44f37cb28e88aa87cf871533f42b167ab223bf61 (patch) | |
tree | 57c11bd322d539df876b5a2a8042e5d5cf6a97f5 | |
parent | sys-app/seabios: (diff) | |
download | wuodan-44f37cb28e88aa87cf871533f42b167ab223bf61.tar.gz wuodan-44f37cb28e88aa87cf871533f42b167ab223bf61.tar.bz2 wuodan-44f37cb28e88aa87cf871533f42b167ab223bf61.zip |
Fix for:
Bug 399825 - sys-devel/llvm-2.9-r2 fails test on hardened
https://bugs.gentoo.org/show_bug.cgi?id=399825
inherit: added pax=utils
src_compile(): added the following
pax-mark m Release/bin/lli
if use test; then
pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests
fi
19 files changed, 1208 insertions, 0 deletions
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest new file mode 100644 index 0000000..87fc483 --- /dev/null +++ b/sys-devel/llvm/Manifest @@ -0,0 +1,21 @@ +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-nodoctargz.patch 1569 RMD160 6589aa0a41f47e915ce93fe6dcf68dd601c3bcdc SHA1 19795ec9c34e6ec5539ec6a77944ceb51abdef72 SHA256 62f1b080364d94e528bb34f0063562d16a59395aa7f97277bba88fbd93e00b84 +AUX llvm-3.0-PPCCompilationCallbackC_static.patch 1046 RMD160 8c6fde4d798f1e6a6c356589c2eee793a51f6083 SHA1 4ff7cebce881544d4bbb2c8a891d31a49b5f642a SHA256 f197920fb1ffbebeb2f43689619d637c5102bfc73295a8edb139cca46094ec5b +AUX llvm-3.0-PPC_macro.patch 1825 RMD160 d991c5c8c05cdc6e4ce6bf4b43059f54822d69b8 SHA1 11a5439873ed00152f2ee2635313aec22ec58452 SHA256 e56947d9744549ef6903238653c6569b5f91a1eb1bd84ec5d69d32ce5b20d6e4 +AUX llvm-3.0-gold_LTO_link.patch 442 RMD160 f480458cc7ef79bbfb948c2f6d2e4122eb55c564 SHA1 a92ac6454a751daf6643c1b402d102ce3c304b73 SHA256 62dc70a1d1f581b7f768ca728dcca688a741e03e64566d5f38e02e33c6372ab8 +AUX llvm-3.0-ocaml_install.patch 664 RMD160 c439931f952e7e053b726435ae0a8e502ebe5080 SHA1 15c8a81baa0e6e78d734f5451b319bf6d896eb2a SHA256 6f451130ed8fcced98691361d33d4d44d8866e703673c293cf7f88af8362e694 +AUX llvm-3.0-set_soname.patch 522 RMD160 84f8b4fe1f1f52a9503e4d5a2192b58c493f9047 SHA1 52ec640907aaca7c37ec0b96dba261529d8aded2 SHA256 0f4fe63baa74a963929dc39359cccb6eb4fba73176d72d4a354ebf50e51318a5 +AUX llvm-3.1-ivybridge_support.patch 405 RMD160 514663856b0788ccd7976d58d65abf268c637d74 SHA1 532bdef7c855f7a843cf9f66a935df61937caad2 SHA256 cc91a69be3d0f7f216a4d0484284fd054d4b0273f1c4dda7afcc005564867725 +AUX llvm-3.2-nodoctargz.patch 1761 RMD160 334a821b1b367e593407b918ec9df2f7585e29db SHA1 b68c794a34dadd9b5c3a5e4607da34ff50812f41 SHA256 e17494aef638d2fe3fb0b669516ffcc9e560161903e1e165de0eecba684c8c1b +DIST llvm-2.9.tgz 9574781 RMD160 caeaa067fda1eb34196b356a087645f83731cfb7 SHA1 500f587f840199ac53c4fc7572839d08fa9d9123 SHA256 661236cfa17428b48cfa9cbb9909f7569c64b8ecd219fd91dbc00e3b557b3779 +DIST llvm-3.0.tar.gz 10350539 RMD160 85211cafbed1c5d838ac54669017b5298613f975 SHA1 b683e7294fcf69887c0d709025d4640f5dca755b SHA256 519eb11d3499ce99c6ffdb8718651fc91425ed7690eac91c8d6853474f7c0477 +DIST llvm-3.1.src.tar.gz 11077429 RMD160 ceb0ef36ab6109da7a8568b04de759752dbee5a7 SHA1 234c96e73ef81aec9a54da92fc2a9024d653b059 SHA256 1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab +EBUILD llvm-2.9-r3.ebuild 6248 RMD160 da2fc30c1e87df527ce2b1e1ae8076b70f228afa SHA1 d218de5308e2a9ccc90ce4de92f3523ae4ffca01 SHA256 119d2f82b277a5ceccbefb776c9c7a2deb2444dbdb900f4736215d082a5ef441 +EBUILD llvm-3.0-r3.ebuild 5750 RMD160 93dc1201abbf12b437699437999ab9472ffc2f6a SHA1 c1fa7009525d3e01210adc5ea2a77b9952d38106 SHA256 5efe852486a4426af92a1bdefa38147a8ae177c6237a230065ae96d485e567ee +EBUILD llvm-3.1-r1.ebuild 5687 RMD160 9372c2bbe002978e3c03621ef66b87c066c0919a SHA1 cdf603ffc02059de0b8cd1c6186538a0ae35bd09 SHA256 a7644da160a0590a3be40822108102ed7f246b6220df6eaef758f15c5e429872 +EBUILD llvm-9999.ebuild 5933 RMD160 dd6a598fd5f1037608d8708ddbd4d6adce3dc22a SHA1 96612e9fd2e6cad493f3fe6d4a4003746856f651 SHA256 56cc0493d7a2005d320d75d918ae3f7f131d12f25a5f6df3ef8f6466fdb53ca0 +MISC metadata.xml 2384 RMD160 a1b7ecfa8999a3bc77cc7365e3efa7bdcfbccdbe SHA1 040998e45e7adbcef69ac194253342b64192face SHA256 c0f936ccdd15b17a06d712f1d7a58ff0fec818ee618279778fbc37abd50f76d6 diff --git a/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch b/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch new file mode 100644 index 0000000..583fdf9 --- /dev/null +++ b/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch @@ -0,0 +1,30 @@ +--- 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 diff --git a/sys-devel/llvm/files/llvm-2.7-nodoctargz.patch b/sys-devel/llvm/files/llvm-2.7-nodoctargz.patch new file mode 100644 index 0000000..cce09eb --- /dev/null +++ b/sys-devel/llvm/files/llvm-2.7-nodoctargz.patch @@ -0,0 +1,47 @@ +--- 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 diff --git a/sys-devel/llvm/files/llvm-2.8-alignof.patch b/sys-devel/llvm/files/llvm-2.8-alignof.patch new file mode 100644 index 0000000..ae7f314 --- /dev/null +++ b/sys-devel/llvm/files/llvm-2.8-alignof.patch @@ -0,0 +1,59 @@ +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); + diff --git a/sys-devel/llvm/files/llvm-2.8-darwin8.patch b/sys-devel/llvm/files/llvm-2.8-darwin8.patch new file mode 100644 index 0000000..284ab47 --- /dev/null +++ b/sys-devel/llvm/files/llvm-2.8-darwin8.patch @@ -0,0 +1,15 @@ +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)" diff --git a/sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch b/sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch new file mode 100644 index 0000000..b95d7d7 --- /dev/null +++ b/sys-devel/llvm/files/llvm-2.9-Operator.h-c++0x.patch @@ -0,0 +1,57 @@ +--- 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) + }; diff --git a/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch b/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch new file mode 100644 index 0000000..9507817 --- /dev/null +++ b/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch @@ -0,0 +1,39 @@ +--- 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 \; diff --git a/sys-devel/llvm/files/llvm-3.0-PPCCompilationCallbackC_static.patch b/sys-devel/llvm/files/llvm-3.0-PPCCompilationCallbackC_static.patch new file mode 100644 index 0000000..04e4024 --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.0-PPCCompilationCallbackC_static.patch @@ -0,0 +1,27 @@ +https://bugs.gentoo.org/show_bug.cgi?id=403519 +http://llvm.org/viewvc/llvm-project?view=rev&revision=153938 + +--- llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp 2011/06/15 15:29:47 133059 ++++ llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp 2012/04/03 06:59:28 153938 +@@ -291,9 +291,10 @@ + } + #endif + +-extern "C" void *PPCCompilationCallbackC(unsigned *StubCallAddrPlus4, +- unsigned *OrigCallAddrPlus4, +- bool is64Bit) { ++extern "C" { ++static void* LLVM_ATTRIBUTE_USED PPCCompilationCallbackC(unsigned *StubCallAddrPlus4, ++ unsigned *OrigCallAddrPlus4, ++ bool is64Bit) { + // Adjust the pointer to the address of the call instruction in the stub + // emitted by emitFunctionStub, rather than the instruction after it. + unsigned *StubCallAddr = StubCallAddrPlus4 - 1; +@@ -337,6 +338,7 @@ + // stack after we restore all regs. + return Target; + } ++} + + + diff --git a/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch b/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch new file mode 100644 index 0000000..c485e9b --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch @@ -0,0 +1,43 @@ +Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h +=================================================================== +--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h 2011-07-25 23:24:55.000000000 +0000 ++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h 2011-12-02 13:06:48.000000000 +0000 +@@ -34,6 +34,10 @@ + + } // End llvm namespace + ++// Generated files will use "namespace PPC". To avoid symbol clash, ++// undefine PPC here. PPC may be predefined on some hosts. ++#undef PPC ++ + // Defines symbolic names for PowerPC registers. This defines a mapping from + // register name to register number. + // +Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h +=================================================================== +--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h 2011-07-26 00:24:13.000000000 +0000 ++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h 2011-12-02 13:06:48.000000000 +0000 +@@ -14,6 +14,10 @@ + #ifndef LLVM_TARGET_POWERPC_PPCPREDICATES_H + #define LLVM_TARGET_POWERPC_PPCPREDICATES_H + ++// Generated files will use "namespace PPC". To avoid symbol clash, ++// undefine PPC here. PPC may be predefined on some hosts. ++#undef PPC ++ + namespace llvm { + namespace PPC { + /// Predicate - These are "(BI << 5) | BO" for various predicates. +Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h +=================================================================== +--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h 2011-07-25 19:53:23.000000000 +0000 ++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h 2011-12-02 16:21:23.000000000 +0000 +@@ -12,6 +12,8 @@ + + #include "llvm/MC/MCFixup.h" + ++#undef PPC ++ + namespace llvm { + namespace PPC { + enum Fixups { diff --git a/sys-devel/llvm/files/llvm-3.0-gold_LTO_link.patch b/sys-devel/llvm/files/llvm-3.0-gold_LTO_link.patch new file mode 100644 index 0000000..031448d --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.0-gold_LTO_link.patch @@ -0,0 +1,10 @@ +--- tools/gold/Makefile 2011/11/23 03:03:21 145094 ++++ tools/gold/Makefile 2011/11/23 03:07:25 145095 +@@ -24,6 +24,6 @@ + # Because off_t is used in the public API, the largefile parts are required for + # ABI compatibility. + CXXFLAGS+=-I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +-CXXFLAGS+=$(SharedLibDir)/$(SharedPrefix)LTO$(SHLIBEXT) ++CXXFLAGS+=-L$(SharedLibDir)/$(SharedPrefix) -lLTO + + include $(LEVEL)/Makefile.common diff --git a/sys-devel/llvm/files/llvm-3.0-ocaml_install.patch b/sys-devel/llvm/files/llvm-3.0-ocaml_install.patch new file mode 100644 index 0000000..18f5cf6 --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.0-ocaml_install.patch @@ -0,0 +1,16 @@ +https://bugs.gentoo.org/show_bug.cgi?id=393023 +http://llvm.org/bugs/show_bug.cgi?id=11177 + +Index: llvm-3.0-3.0/bindings/ocaml/llvm/Makefile +=================================================================== +--- llvm-3.0-3.0.orig/bindings/ocaml/llvm/Makefile 2011-11-15 12:17:02.785987852 +0100 ++++ llvm-3.0-3.0/bindings/ocaml/llvm/Makefile 2011-11-15 12:20:12.661983615 +0100 +@@ -30,7 +30,7 @@ + $(OcamlDir)/META.llvm: META.llvm + $(Verb) $(CP) -f $< $@ + +-install-meta:: $(ObjDir)/META.llvm ++install-meta:: $(ObjDir)/../META.llvm + $(Echo) "Install $(BuildMode) $(DestMETA)" + $(Verb) $(MKDIR) $(PROJ_libocamldir) + $(Verb) $(DataInstall) META.llvm "$(DestMETA)" diff --git a/sys-devel/llvm/files/llvm-3.0-set_soname.patch b/sys-devel/llvm/files/llvm-3.0-set_soname.patch new file mode 100644 index 0000000..69ba74d --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.0-set_soname.patch @@ -0,0 +1,12 @@ +https://bugs.gentoo.org/show_bug.cgi?id=409267 +http://llvm.org/bugs/show_bug.cgi?id=12334 +--- tools/llvm-shlib/Makefile.orig 2012-03-26 18:14:13.071797115 +0200 ++++ tools/llvm-shlib/Makefile 2012-03-26 17:31:12.491196254 +0200 +@@ -67,6 +67,7 @@ + # Include everything from the .a's into the shared library. + LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \ + -Wl,--no-whole-archive ++ LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT) + endif + + ifeq ($(HOST_OS),Linux) diff --git a/sys-devel/llvm/files/llvm-3.1-ivybridge_support.patch b/sys-devel/llvm/files/llvm-3.1-ivybridge_support.patch new file mode 100644 index 0000000..a03ec42 --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.1-ivybridge_support.patch @@ -0,0 +1,13 @@ +--- llvm/trunk/lib/Support/Host.cpp 2012/04/23 22:22:46 155401 ++++ llvm/trunk/lib/Support/Host.cpp 2012/04/23 22:41:39 155402 +@@ -230,6 +230,10 @@ + case 45: + return "corei7-avx"; + ++ // Ivy Bridge: ++ case 58: ++ return "core-avx-i"; ++ + case 28: // Intel Atom processor. All processors are manufactured using + // the 45 nm process + return "atom"; diff --git a/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch b/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch new file mode 100644 index 0000000..3a622b5 --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch @@ -0,0 +1,45 @@ +--- docs/Makefile.orig 2012-04-30 17:00:01.000000000 +0200 ++++ docs/Makefile 2012-04-30 17:15:52.000000000 +0200 +@@ -52,11 +52,10 @@ + # '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) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html +- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir) + + $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML) + $(Echo) Packaging HTML documentation +@@ -68,12 +67,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 +@@ -99,7 +97,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 \; +@@ -109,7 +106,6 @@ + $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar* + $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc + $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/ocamldoc.tar +- $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/ + + regen-ocamldoc: + $(Echo) Building ocamldoc documentation diff --git a/sys-devel/llvm/llvm-2.9-r3.ebuild b/sys-devel/llvm/llvm-2.9-r3.ebuild new file mode 100644 index 0000000..5f98895 --- /dev/null +++ b/sys-devel/llvm/llvm-2.9-r3.ebuild @@ -0,0 +1,191 @@ +# Copyright 1999-2012 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.8 2012/05/04 07:24:15 jdhore Exp $ + +EAPI="3" +inherit eutils flag-o-matic multilib toolchain-funcs pax-utils + +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" +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? ( virtual/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 +} + +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" + + pax-mark m Release/bin/lli + if use test; then + pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests + fi +} + +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 + local lib= f= odylib= + 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 + odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib) + ebegin "fixing install_name reference to ${odylib} of ${f##*/}" + install_name_tool \ + -change "${odylib}" \ + "${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \ + "${f}" + eend $? + done + fi +} diff --git a/sys-devel/llvm/llvm-3.0-r3.ebuild b/sys-devel/llvm/llvm-3.0-r3.ebuild new file mode 100644 index 0000000..564430d --- /dev/null +++ b/sys-devel/llvm/llvm-3.0-r3.ebuild @@ -0,0 +1,182 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.0-r2.ebuild,v 1.5 2012/06/04 20:23:35 mgorny Exp $ + +EAPI="3" +PYTHON_DEPEND="2" +inherit eutils flag-o-matic multilib toolchain-funcs python pax-utils + +DESCRIPTION="Low Level Virtual Machine" +HOMEPAGE="http://llvm.org/" +SRC_URI="http://llvm.org/releases/${PV}/${P}.tar.gz" + +LICENSE="UoI-NCSA" +SLOT="0" +KEYWORDS="~amd64" +IUSE="debug gold +libffi 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 ) + gold? ( >=sys-devel/binutils-2.22[cxx] ) + libffi? ( virtual/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}/${P}.src + +pkg_setup() { + # Required for test and build + python_set_active_version 2 + python_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" + + # Specify python version + python_convert_shebangs -r 2 test/Scripts + + epatch "${FILESDIR}"/${PN}-2.6-commandguide-nops.patch + epatch "${FILESDIR}"/${PN}-2.9-nodoctargz.patch + epatch "${FILESDIR}"/${P}-ocaml_install.patch + epatch "${FILESDIR}"/${P}-PPC_macro.patch + epatch "${FILESDIR}"/${P}-PPCCompilationCallbackC_static.patch + epatch "${FILESDIR}"/${P}-gold_LTO_link.patch + epatch "${FILESDIR}"/${P}-set_soname.patch + + # User patches + epatch_user +} + +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 + + if use gold; then + CONF_FLAGS="${CONF_FLAGS} --with-binutils-include=${EPREFIX}/usr/include/" + fi + 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" + + pax-mark m Release/bin/lli + if use test; then + pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests + fi +} + +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 + local lib= f= odylib= + if [[ ${CHOST} == *-darwin* ]] ; then + for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.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 + odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib) + ebegin "fixing install_name reference to ${odylib} of ${f##*/}" + install_name_tool \ + -change "${odylib}" \ + "${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \ + "${f}" + eend $? + done + fi +} diff --git a/sys-devel/llvm/llvm-3.1-r1.ebuild b/sys-devel/llvm/llvm-3.1-r1.ebuild new file mode 100644 index 0000000..33e80bc --- /dev/null +++ b/sys-devel/llvm/llvm-3.1-r1.ebuild @@ -0,0 +1,183 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.1.ebuild,v 1.6 2012/06/14 16:22:07 voyageur Exp $ + +EAPI="4" +PYTHON_DEPEND="2" +inherit eutils flag-o-matic multilib toolchain-funcs python pax-utils + +DESCRIPTION="Low Level Virtual Machine" +HOMEPAGE="http://llvm.org/" +SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz" + +LICENSE="UoI-NCSA" +SLOT="0" +KEYWORDS="~amd64" +IUSE="debug gold +libffi 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 ) + gold? ( >=sys-devel/binutils-2.22[cxx] ) + libffi? ( virtual/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}/${P}.src + +pkg_setup() { + # Required for test and build + python_set_active_version 2 + python_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 "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \ + -i tools/llvm-config/llvm-config.cpp || 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" + if use gold; then + sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \ + -i tools/gold/Makefile || die "gold rpath sed failed" + fi + + # Specify python version + python_convert_shebangs -r 2 test/Scripts + + epatch "${FILESDIR}"/${PN}-2.6-commandguide-nops.patch + epatch "${FILESDIR}"/${PN}-2.9-nodoctargz.patch + epatch "${FILESDIR}"/${PN}-3.0-PPC_macro.patch + epatch "${FILESDIR}"/${P}-ivybridge_support.patch + + # User patches + epatch_user +} + +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 + + if use gold; then + CONF_FLAGS="${CONF_FLAGS} --with-binutils-include=${EPREFIX}/usr/include/" + fi + 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} +} + +src_compile() { + emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 + + pax-mark m Release/bin/lli + if use test; then + pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests + fi +} + +src_install() { + emake KEEP_SYMBOLS=1 DESTDIR="${D}" install + + 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 + local lib= f= odylib= + if [[ ${CHOST} == *-darwin* ]] ; then + for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.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 + odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib) + ebegin "fixing install_name reference to ${odylib} of ${f##*/}" + install_name_tool \ + -change "${odylib}" \ + "${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \ + "${f}" + eend $? + done + fi +} diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild new file mode 100644 index 0000000..853ab26 --- /dev/null +++ b/sys-devel/llvm/llvm-9999.ebuild @@ -0,0 +1,195 @@ +# Copyright 1999-2012 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.33 2012/06/08 13:18:25 mgorny Exp $ + +EAPI="4" +PYTHON_DEPEND="2" +inherit subversion eutils flag-o-matic multilib toolchain-funcs python pax-utils + +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 gold +libffi multitarget ocaml test udis86 vim-syntax" + +DEPEND="dev-lang/perl + dev-python/docutils + >=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 ) + gold? ( >=sys-devel/binutils-2.22[cxx] ) + libffi? ( virtual/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 ) )" + +pkg_setup() { + # Required for test and build + python_set_active_version 2 + python_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 "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \ + -i tools/llvm-config/llvm-config.cpp || 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" + if use gold; then + sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \ + -i tools/gold/Makefile || die "gold rpath sed failed" + fi + + # Specify python version + python_convert_shebangs -r 2 test/Scripts + + epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch + epatch "${FILESDIR}"/${PN}-3.0-PPC_macro.patch + + # User patches + epatch_user +} + +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,cpp" + fi + + if use amd64; then + CONF_FLAGS="${CONF_FLAGS} --enable-pic" + fi + + if use gold; then + CONF_FLAGS="${CONF_FLAGS} --with-binutils-include=${EPREFIX}/usr/include/" + fi + 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} +} + +src_compile() { + # generate the manpages +# cd docs/CommandGuide || die +# local infiles=( *.rst ) +# +# cat > Makefile <<EOF || die +#%.1: %.rst +# rst2man.py \$< > \$@ +#EOF +# emake ${infiles[@]/.rst/.1} + + emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 + + pax-mark m Release/bin/lli + if use test; then + pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests + fi +} + +src_install() { + emake KEEP_SYMBOLS=1 DESTDIR="${D}" install + + 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 + 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}.dylib {BugpointPasses,LLVMHello}.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 + 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/${PN}/libLLVM-${libpv}.dylib \ + "${f}" + eend $? + done + fi +# +# doman docs/CommandGuide/*.1 +} diff --git a/sys-devel/llvm/metadata.xml b/sys-devel/llvm/metadata.xml new file mode 100644 index 0000000..e5a362b --- /dev/null +++ b/sys-devel/llvm/metadata.xml @@ -0,0 +1,23 @@ +<?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> + <maintainer> + <email>mgorny@gentoo.org</email> + <name>Michał Górny</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='gold'>Build the gold linker plugin</flag> + <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> |