Please commit this, it's better than the solution I made :)
Cheers,
Gary
Xerxes Rånby wrote:
> Index: icedtea6/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
> ===================================================================
> --- icedtea6.orig/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
> +++ icedtea6/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
> @@ -43,7 +43,15 @@ SharkCompiler::SharkCompiler()
> #endif
>
> // Create a module to build our functions into
> +#if SHARK_LLVM_VERSION >= 26
> + // LLVM 2.6 and later requires passing a LLVMContext during module
> + // creation. The LLVM API getGlobalContext() returns a LLVMContext that
> + // can be used safely as long as the shark compiler stays single threaded
> + // and only uses one module.
> + _module = new Module("shark", getGlobalContext());
> +#else
> _module = new Module("shark");
> +#endif
>
> // Create the builder to build our functions
> _builder = new SharkBuilder(this);
> Index: icedtea6/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
> ===================================================================
> --- icedtea6.orig/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
> +++ icedtea6/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
> @@ -32,6 +32,9 @@
> #include <llvm/DerivedTypes.h>
> #include <llvm/ExecutionEngine/ExecutionEngine.h>
> #include <llvm/Instructions.h>
> +#if SHARK_LLVM_VERSION >= 26
> +#include <llvm/LLVMContext.h>
> +#endif
> #include <llvm/Module.h>
> #include <llvm/ModuleProvider.h>
> #include <llvm/Support/IRBuilder.h>
--
http://gbenson.net/