diff options
Diffstat (limited to 'community/rubinius')
-rw-r--r-- | community/rubinius/PKGBUILD | 10 | ||||
-rw-r--r-- | community/rubinius/llvm34.patch | 182 |
2 files changed, 188 insertions, 4 deletions
diff --git a/community/rubinius/PKGBUILD b/community/rubinius/PKGBUILD index 1d4d24942..3d1c47fa8 100644 --- a/community/rubinius/PKGBUILD +++ b/community/rubinius/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 103201 2013-12-29 21:58:18Z heftig $ +# $Id: PKGBUILD 103864 2014-01-12 20:24:24Z foutrelis $ # Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> pkgbase=rubinius pkgname=(rubinius rubinius-ruby) pkgver=2.2.3 -pkgrel=1 +pkgrel=2 pkgdesc="Ruby runtime written in Ruby, designed for concurrency" arch=(i686 x86_64) url="http://rubini.us" @@ -13,16 +13,18 @@ depends=(llvm-libs libffi openssl libyaml) makedepends=(llvm rubinius-ruby) options=(!emptydirs) source=(http://releases.rubini.us/${pkgbase}-${pkgver}.tar.bz2 - gemrc dirs.patch) + gemrc dirs.patch llvm34.patch) sha256sums=('b3426aa6996420f1d9d8a7926a94160b84d8bdf725793c64462b27b74f2f2acf' '4bb7eb2fe66e396ed16b589cdb656831407b39ad4e138d88536754c0448ac614' - '93f3918dc2a5679e281e724f9b3cb712ffa784c1e52e6fa7ce75f74ce6655a66') + '93f3918dc2a5679e281e724f9b3cb712ffa784c1e52e6fa7ce75f74ce6655a66' + 'a24850f34a8a308ce4a4e1da12d75a669095a38b6b5da5082eb4d3bd41770095') prepare() { export GEM_HOME="$srcdir/gemdir" LANG="en_US.UTF-8" cd $pkgbase-$pkgver patch -Np1 -i ../dirs.patch + patch -Np1 -i ../llvm34.patch mkdir -p "$GEM_HOME" gem install --no-user-install -N vendor/cache/bundler-*.gem diff --git a/community/rubinius/llvm34.patch b/community/rubinius/llvm34.patch new file mode 100644 index 000000000..ca8f2d289 --- /dev/null +++ b/community/rubinius/llvm34.patch @@ -0,0 +1,182 @@ +diff --git i/vm/llvm/disassembler.cpp w/vm/llvm/disassembler.cpp +index 79c74ff..b3ea424 100644 +--- i/vm/llvm/disassembler.cpp ++++ w/vm/llvm/disassembler.cpp +@@ -46,20 +46,27 @@ namespace rubinius { + #if RBX_LLVM_API_VER > 300 + llvm::TargetOptions options; + options.NoFramePointerElim = true; ++#if RBX_LLVM_API_VER < 304 + options.NoFramePointerElimNonLeaf = true; ++#endif + target_machine = target->createTargetMachine(host, llvm::sys::getHostCPUName(), "", options); + #else + target_machine = target->createTargetMachine(host, llvm::sys::getHostCPUName(), ""); + #endif + + sub_target = target->createMCSubtargetInfo(host, llvm::sys::getHostCPUName(), ""); +- asm_info = target->createMCAsmInfo(host); + + #if RBX_LLVM_API_VER > 300 + instr_info = target->createMCInstrInfo(); + reg_info = target->createMCRegInfo(host); + #endif + ++#if RBX_LLVM_API_VER > 303 ++ asm_info = target->createMCAsmInfo(*reg_info, host); ++#else ++ asm_info = target->createMCAsmInfo(host); ++#endif ++ + if(asm_info) { + disassembler = target->createMCDisassembler(*sub_target); + memory_object = new JITMemoryObject((const uint8_t*)buffer, (uint64_t) size); +diff --git i/vm/llvm/jit_builder.cpp w/vm/llvm/jit_builder.cpp +index 652350f..c479aab 100644 +--- i/vm/llvm/jit_builder.cpp ++++ w/vm/llvm/jit_builder.cpp +@@ -56,12 +56,21 @@ namespace jit { + "", "rubinius", true, "", 0); + DIFile file = debug_builder().createFile(file_str, ""); + ++#if RBX_LLVM_API_VER > 303 ++ DIType dummy_return_type = debug_builder().createNullPtrType(); ++ Value* dummy_signature[] = { ++ &*dummy_return_type, ++ }; ++ DICompositeType dummy_subroutine_type = debug_builder().createSubroutineType(file, ++ debug_builder().getOrCreateArray(dummy_signature)); ++#else + DIType dummy_return_type = debug_builder().createNullPtrType("dummy type"); + Value* dummy_signature[] = { + &*dummy_return_type, + }; + DIType dummy_subroutine_type = debug_builder().createSubroutineType(file, + debug_builder().getOrCreateArray(dummy_signature)); ++#endif + + #if RBX_LLVM_API_VER > 300 + DISubprogram subprogram = debug_builder().createFunction(file, "", "", +diff --git i/vm/llvm/jit_context.cpp w/vm/llvm/jit_context.cpp +index e555adb..594a63a 100644 +--- i/vm/llvm/jit_context.cpp ++++ w/vm/llvm/jit_context.cpp +@@ -84,7 +84,9 @@ namespace rubinius { + #if RBX_LLVM_API_VER > 300 + llvm::TargetOptions opts; + opts.NoFramePointerElim = true; ++#if RBX_LLVM_API_VER < 304 + opts.NoFramePointerElimNonLeaf = true; ++#endif + opts.JITEmitDebugInfo = true; + + factory.setTargetOptions(opts); +diff --git i/vm/llvm/jit_memory_manager.hpp w/vm/llvm/jit_memory_manager.hpp +index 8a58a09..7205f89 100644 +--- i/vm/llvm/jit_memory_manager.hpp ++++ w/vm/llvm/jit_memory_manager.hpp +@@ -202,7 +202,7 @@ namespace jit { + + public: + RubiniusJITMemoryManager(); +- ~RubiniusJITMemoryManager(); ++ virtual ~RubiniusJITMemoryManager(); + + /// allocateNewSlab - Allocates a new MemoryBlock and remembers it as the + /// last slab it allocated, so that subsequent allocations follow it. +@@ -356,8 +356,13 @@ namespace jit { + } + + /// allocateCodeSection - Allocate memory for a code section. ++#if RBX_LLVM_API_VER > 303 ++ virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, ++ unsigned SectionID, StringRef SectionName) { ++#else + uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, + unsigned SectionID) { ++#endif + utilities::thread::SpinLock::LockGuard guard(lock_); + // Grow the required block size to account for the block header + Size += sizeof(*CurBlock); +@@ -397,11 +402,21 @@ namespace jit { + } + + /// allocateDataSection - Allocate memory for a data section. +- uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, +- unsigned SectionID) { ++ /// TODO: currently IsReadOnly is ignored. ++#if RBX_LLVM_API_VER > 303 ++ virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, ++ unsigned SectionID, StringRef SectionName, ++ bool IsReadOnly) { + utilities::thread::SpinLock::LockGuard guard(lock_); + return (uint8_t*)DataAllocator.Allocate(Size, Alignment); + } ++#else ++ uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, ++ unsigned SectionID, bool IsReadOnly) { ++ utilities::thread::SpinLock::LockGuard guard(lock_); ++ return (uint8_t*)DataAllocator.Allocate(Size, Alignment); ++ } ++#endif + + /// startExceptionTable - Use startFunctionBody to allocate memory for the + /// function's exception table. +@@ -495,7 +510,7 @@ namespace jit { + , GOTBase(NULL) + {} + +- ~RubiniusRequestJITMemoryManager() { ++ virtual ~RubiniusRequestJITMemoryManager() { + if(GOTBase) delete[] GOTBase; + } + +@@ -504,17 +519,32 @@ namespace jit { + return mgr_->getPointerToNamedFunction(Name, AbortOnFailure); + } + ++#if RBX_LLVM_API_VER >= 304 ++ virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, ++ unsigned SectionID, StringRef SectionName) { ++ return mgr_->allocateCodeSection(Size, Alignment, SectionID, ++ SectionName); ++ } ++#else + uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, + unsigned SectionID) { + return mgr_->allocateCodeSection(Size, Alignment, SectionID); + } ++#endif + + /// allocateDataSection - Allocate memory for a data section. +-#if RBX_LLVM_API_VER >= 303 ++#if RBX_LLVM_API_VER >= 304 ++ virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, ++ unsigned SectionID, StringRef SectionName, ++ bool IsReadOnly) { ++ return mgr_->allocateDataSection(Size, Alignment, SectionID, ++ SectionName, IsReadOnly); ++ } ++#elif RBX_LLVM_API_VER >= 303 + uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, + unsigned SectionID, bool IsReadOnly) { +- // TODO: currently IsReadOnly is ignored. +- return mgr_->allocateDataSection(Size, Alignment, SectionID); ++ return mgr_->allocateDataSection(Size, Alignment, SectionID, ++ IsReadOnly); + } + #else + uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, +@@ -601,6 +631,12 @@ namespace jit { + void resetGeneratedFunction() { + GeneratedFunction = NULL; + } ++ ++#if RBX_LLVM_API_VER > 303 ++ virtual bool finalizeMemory(std::string* ErrMsg = 0) { ++ return false; ++ } ++#endif + }; + + |