Index: icedtea6/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp =================================================================== --- icedtea6.orig/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp 2009-07-08 10:31:09.000000000 +0200 +++ icedtea6/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp 2009-07-08 10:44:05.000000000 +0200 @@ -174,7 +174,14 @@ char name[128]; snprintf(name, sizeof name - 1, "pointer_constant_%p", ptr); - GlobalVariable *value = new GlobalVariable(SharkType::intptr_type(), + GlobalVariable *value = new GlobalVariable( +#if SHARK_LLVM_VERSION >= 26 + // LLVM 2.6 requires a LLVMContext during GlobalVariable construction. + // getGlobalConext() returns one that can be used as long as the shark + // compiler are single-threaded. + getGlobalContext(), +#endif + SharkType::intptr_type(), false, GlobalValue::ExternalLinkage, NULL, name, module()); execution_engine()->addGlobalMapping(value, const_cast<void*>(ptr)); Index: icedtea6/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp =================================================================== --- icedtea6.orig/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp 2009-07-08 10:43:34.000000000 +0200 +++ icedtea6/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp 2009-07-08 10:44:43.000000000 +0200 @@ -187,6 +187,12 @@ Value *name = CreatePtrToInt( CreateStructGEP( new GlobalVariable( +#if SHARK_LLVM_VERSION >= 26 + // LLVM 2.6 requires a LLVMContext during GlobalVariable construction. + // getGlobalConext() returns one that can be used as long as the shark + // compiler are single-threaded. + getGlobalContext(), +#endif const_name->getType(), true, GlobalValue::InternalLinkage, const_name, "dump", module()),