diff options
author | Jan Pacner | 2015-08-20 14:04:07 +0200 |
---|---|---|
committer | Jan Pacner | 2015-08-20 14:04:07 +0200 |
commit | 11ddfd42d3457fc0ab2ef4bcef4b93d22baf35f1 (patch) | |
tree | 5fb7ad0bebe6e19fc6f6981c937c57c8263151d8 | |
parent | dd5e3d74ad275daef6b9b280efb9855229b903eb (diff) | |
download | aur-11ddfd42d3457fc0ab2ef4bcef4b93d22baf35f1.tar.gz |
update to the newest version - WARNING: tests are temporarily disabled due to bug in daomake
-rw-r--r-- | PKGBUILD | 141 |
1 files changed, 131 insertions, 10 deletions
@@ -4,9 +4,10 @@ _basename=dao pkgname=${_basename}-git -pkgver=1515.67e6061 +pkgver=1555.916dd74 pkgrel=1 -pkgdesc='A very lightweight, portable, optionally typed programming language and VM written in C featuring blazingly fast real concurrency, defer, OOP, AOP, LLVM JIT, bytecode, BNF macros, many advanced modules & bindings and much more!' +# LLVM JIT +pkgdesc='A very lightweight, portable, optionally typed programming language and VM written in C featuring blazingly fast real concurrency, defer, OOP, AOP, bytecode, BNF macros, many advanced modules & bindings and much more!' url='http://www.daovm.net/' license=('BSD') arch=('i686' 'x86_64') @@ -44,7 +45,7 @@ sha256sums=( ) depends=('gcc-libs-multilib') makedepends=( - #'emscripten-git' (wait until clang 3.5 becomes supported) + #'emscripten-git' (wait until clang 3.6 becomes supported) #'genometools' 'glib2' 'gobject-introspection' @@ -105,7 +106,8 @@ build() { mv "DaoGenomeTools/" "$_basename/modules/" # FIXME not getting compiled mv "DaoGObject/" "$_basename/modules/" - mv "DaoGraphics/" "$_basename/modules/" + # FIXME not updated to the current Dao + #mv "DaoGraphics/" "$_basename/modules/" mv "DaoGSL/" "$_basename/modules/" mv "DaoOpenGL/" "$_basename/modules/" mv "DaoSQL/" "$_basename/modules/" @@ -116,7 +118,7 @@ build() { cd "$_basename" # order matters when using gcc - patch -R tools/clangdao/makefile.dao << EOF + patch -R tools/clangdao/makefile.dao <<\EOF @@ -44,9 +44,9 @@ clangdao_exe.AddLinkingFlag( "-lclangSema" ) clangdao_exe.AddLinkingFlag( "-lclangAnalysis" ) @@ -134,8 +136,51 @@ EOF sed -i -r "/-lclangStaticAnalyzerFrontend/a\ clangdao_exe.AddLinkingFlag( \"$(llvm-config --libs)\" )" \ tools/clangdao/makefile.dao + # Clang 3.6 uses std::unique_ptr<> => wrap pointers + patch tools/clangdao/clangdao.cpp <<\EOF +@@ -457,7 +457,7 @@ + compiler.createSourceManager(compiler.getFileManager()); + compiler.createPreprocessor( TU_Complete ); + compiler.createASTContext(); +- compiler.setASTConsumer( new CDaoASTConsumer( & compiler, & module ) ); ++ compiler.setASTConsumer( unique_ptr<clang::ASTConsumer>( new CDaoASTConsumer( & compiler, & module ) ) ); + //XXX compiler.createSema(false, NULL); + //compiler.createSema(TU_Module, NULL); + compiler.createSema(TU_Prefix, NULL); +@@ -478,7 +478,7 @@ + //outs()<<builtinDefines<<"\n"; + + pp.setPredefines( builtinDefines + "\n" + predefines ); +- pp.addPPCallbacks( new CDaoPPCallbacks( & compiler, & module ) ); ++ pp.addPPCallbacks( unique_ptr<clang::PPCallbacks>( new CDaoPPCallbacks( & compiler, & module ) ) ); + + InputKind ik = FrontendOptions::getInputKindForExtension( main_input_file ); + compiler.InitializeSourceManager( FrontendInputFile( main_input_file, ik ) ); +EOF + + # LLVM 3.6 renamed JIT to MCJIT and added std::unique_ptr<> => wrap pointers +patch modules/DaoJIT/daoJIT.cpp <<\EOF +@@ -38,7 +38,7 @@ + #include "llvm/IR/Verifier.h" + #include "llvm/Analysis/Passes.h" + #include "llvm/Transforms/Scalar.h" +-#include "llvm/ExecutionEngine/JIT.h" ++#include "llvm/ExecutionEngine/MCJIT.h" + #include "llvm/ExecutionEngine/Interpreter.h" + #include "llvm/ExecutionEngine/GenericValue.h" + #include "llvm/Support/raw_ostream.h" +@@ -1137,7 +1137,7 @@ + daojit_tan_double = Function::Create( mathft, linkage, "tan", llvm_module ); + daojit_tanh_double = Function::Create( mathft, linkage, "tanh", llvm_module ); + +- llvm_exe_engine = EngineBuilder( llvm_module ).setEngineKind(EngineKind::JIT).create(); ++ llvm_exe_engine = EngineBuilder( std::unique_ptr<llvm::Module>( llvm_module ) ).setEngineKind(EngineKind::JIT).create(); + #if 0 + llvm_exe_engine->addGlobalMapping( daojit_rand_double, (void*) daojit_rand ); + llvm_exe_engine->addGlobalMapping( daojit_pow_double, (void*) pow ); +EOF - # FIXME + # FIXME https://github.com/daokoder/dao/issues/406 sed -i -r 's|-Wl,-rpath=|-Wl,--enable-new-dtags,-rpath=|' \ tools/daomake/platforms/unix.dao @@ -144,6 +189,72 @@ EOF sed -i -r "/-lclangSerialization/a\ project.AddLinkingFlag( \"-lLLVMOption -lLLVMSupport\" )" \ modules/DaoCXX/makefile.dao + # LLVM 3.6 renamed JIT to MCJIT and added std::unique_ptr<> => abandon raw pointers + patch modules/DaoCXX/daoCXX.cpp <<\EOF +@@ -31,7 +31,7 @@ + #include <llvm/Support/MemoryBuffer.h> + #include <llvm/Support/TargetSelect.h> + #include <llvm/IR/LLVMContext.h> +-#include <llvm/ExecutionEngine/JIT.h> ++#include <llvm/ExecutionEngine/MCJIT.h> + #include <llvm/ExecutionEngine/Interpreter.h> + #include <llvm/ExecutionEngine/GenericValue.h> + #include <clang/CodeGen/CodeGenAction.h> +@@ -80,10 +80,10 @@ + + static void DaoCXX_AddVirtualFile( const char *name, const char *source ) + { +- MemoryBuffer* Buffer = llvm::MemoryBuffer::getMemBufferCopy( source, name ); ++ auto Buffer = llvm::MemoryBuffer::getMemBufferCopy( source, name ); + const FileEntry* FE = compiler.getFileManager().getVirtualFile( name, + strlen(Buffer->getBufferStart()), time(NULL) ); +- compiler.getSourceManager().overrideFileContents( FE, Buffer ); ++ compiler.getSourceManager().overrideFileContents( FE, std::move( Buffer ) ); + compiler.getFrontendOpts().Inputs.clear(); + compiler.getFrontendOpts().Inputs.push_back( FrontendInputFile( name, IK_CXX ) ); + } +@@ -418,7 +418,7 @@ + //action.BeginSourceFile( compiler, FrontendInputFile( name, IK_CXX ) ); + if( ! compiler.ExecuteAction( action ) ) return error_compile_failed( out ); + +- llvm::Module *module = action.takeModule(); ++ auto module = action.takeModule(); + if( module == NULL ) return error_compile_failed( out ); + + dao_make_anonymous_name( name, NS, VT, "dao_", "" ); +@@ -475,7 +475,7 @@ + + if( ! compiler.ExecuteAction( action ) ) return error_compile_failed( out ); + +- llvm::Module *module = action.takeModule(); ++ auto module = action.takeModule(); + if( module == NULL ) return error_compile_failed( out ); + + sprintf( proto2, "dao_%s", func->routName->chars ); //XXX buffer size +@@ -553,7 +553,7 @@ + + if( ! compiler.ExecuteAction( action ) ) return error_compile_failed( out ); + +- llvm::Module *module = action.takeModule(); ++ auto module = action.takeModule(); + if( module == NULL ) return error_compile_failed( out ); + + for(i=0; i<funcs->size; i++){ +@@ -701,10 +701,12 @@ + DaoCXX_AddVirtualFile( "dummy-main.cpp", "void dummy_main(){}" ); + + InitializeNativeTarget(); ++ InitializeNativeTargetAsmPrinter(); + if( ! compiler.ExecuteAction( action ) ) return 1; + + std::string Error; +- engine = ExecutionEngine::createJIT( action.takeModule(), &Error ); ++ engine = llvm::EngineBuilder( action.takeModule() ) ++ .setErrorStr( &Error ).create(); + if( engine == NULL ){ + errs() << Error << "\n"; + return 1; +EOF # gl.h is provided by mesa sed -i -r 's|(#include) *"gl.h"|\1 <GL/gl.h>|' \ @@ -186,17 +297,27 @@ EOF # FIXME should dao.conf be installed along with Dao? sed -i -r -e "s/# *(cpu *=).*/\1$(grep '^processor' /proc/cpuinfo | wc -l)/" \ - -e 's/# *(jit *=).*/\1yes/' dao.conf + dao.conf + #-e 's/# *(jit *=).*/\1yes/' dao.conf # stop right after the daomake tool creates the Makefile #sed -i -r 's|^[[:space:]]*\$\(MAKE\)[[:space:]]*$||' Makefile.daomake + # FIXME catch the daomake segfault + #sed -i -r -e 's|([.]/daomake)|valgrind \1|' tools/daomake/bootstrap/Makefile + #sed -i -r -e 's|(\$\(SRCDIR\)/tools/daomake/bootstrap/daomake)|valgrind \1|' \ + # Makefile.daomake + + # FIXME disable testing + #sed -i -r -e 's|^(.*DaoMake::SetTestTool)|#\1|' makefile.dao + sed -i -r -e '/DaoMake::SetTestTool/s|testcmd|"true"|' makefile.dao + # FIXME disable generation of finders, because they contain # compile-time specific paths - make -f Makefile.daomake linux MODE=debug RESET='--reset' \ - OPTIONS="--option-INSTALL-PATH '/usr' --no-local-rpath" - #make -f Makefile.daomake linux MODE=release RESET='--reset' \ + #make -f Makefile.daomake linux MODE=debug RESET='--reset' \ # OPTIONS="--option-INSTALL-PATH '/usr' --no-local-rpath" + make -f Makefile.daomake linux MODE=release RESET='--reset' \ + OPTIONS="--option-INSTALL-PATH '/usr' --no-local-rpath" } pkgver() { |