RFC: Shark llvm2.6 api changes to Threads and JIT Initialization

Xerxes Rånby xerxes at zafena.se
Wed Jun 17 07:35:07 PDT 2009


Hi this the second issue of the Shark daily digest, today we will talk 
about changes to the llvm API for the next llvm version 2.6 that are 
allready in use in the 2.6svn trunk.
If you want to be a early shark then this is for you!

API issue 1
LLVM are adding multi-threaded support and clients who make us of the 
LLVM API have to change accordingly.
http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-June/023080.html
Quote
"The major CHANGE is: the JIT will no longer be safe for executing
threaded applications without first invoking llvm_start_multithreaded ()."

API issue 2
Another change are to the Initialization of the JIT.
Before the creation of the ExecutionEngine the JIT for the target shark 
are running on have to explicitly be initialized.
Without the initialization creation of the execution engine will return 
null and makes shark segfault.
The functions used for this Initialization are named:

llvm::InitializeMSILTarget()
llvm::InitializeMSP430Target()
llvm::InitializeXCoreTarget()
llvm::InitializePIC16Target()
llvm::InitializeCellSPUTarget()
llvm::InitializeMipsTarget()
llvm::InitializeARMTarget()
llvm::InitializeIA64Target()
llvm::InitializeAlphaTarget()
llvm::InitializePowerPCTarget()
llvm::InitializeSparcTarget()
llvm::InitializeX86Target()

fix 1: we have to invent a large #if block to deal with this
fix 2: or persuade the llvm people to create a llvm::InitializeMyTarget()
fix 3: do like llvm internally and add some macros to convert 
LLVM_NATIVE_ARCH into the correct methodname: here are the llvm fix for lli
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090615/078864.html

Patch
The attached patch fixes issue 1 and gives an example for issue 2 on X86.

Cheers
Xerxes


-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm_api_breakage_3.patch
Type: text/x-patch
Size: 1621 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090617/3f4ac711/llvm_api_breakage_3.patch 


More information about the distro-pkg-dev mailing list