Hi,
I'm using LLVM/clang from release 3.0. I have a program (C++) that will load a library in the form of LLVM bit code using the JIT. However, I see JIT errors when loading the bit code:
"LLVM ERROR: JIT does not support inline asm"
I read that MC JIT intends to fix this. I'm trying to build LLVM from the lastest trunk. Is there any special/extra thing to do to use MCJIT when creating the JIT in my program?
If this is not the right mailing list, please do point me in the correct direction.
TIA,
Ashok
Hi,
I'm using LLVM/clang from release 3.0. I have a program (C++) that will load
a library in the form of LLVM bit code using the JIT. However, I see JIT errors
when loading the bit code:
"LLVM ERROR: JIT does not support inline asm"
I read that MC JIT intends to fix this. I'm trying to build LLVM from the
lastest trunk. Is there any special/extra thing to do to use MCJIT when
creating the JIT in my program?
If this is not the right mailing list, please do point me in the correct direction.
MCJIT is functional in trunk (and the 3.1 branch). While it doesn't include all the features of the old JIT quite yet, it's complete enough to pass all of JIT's execution tests on Linux and Mac OS X (no Windows yet). As for directions on how to enable it, follow the path of the "use-mcjit" flag passed to lli (in tools/lli/lli.cpp).
Good luck,
Eli
<snip>
MCJIT is functional in trunk (and the 3.1 branch). While it doesn't include all the features of the old JIT quite yet, it's complete enough to pass all of JIT's execution tests on Linux and Mac OS X (no Windows yet). As for directions on how to enable it, follow the path of the "use-mcjit" flag passed to lli (in tools/lli/lli.cpp).
I tried to load my bitcode library using lli but it gave a new error now:
$lli -entry-function="ISimEngine_GetVersion" -use-mcjit libengine.bc
LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target
I also tried other variations of the call with the same result:
$lli -entry-function="ISimEngine_GetVersion" -use-mcjit -mattr=+avx -mcpu=corei7-avx libengine.bc
I updated my program looking at lli.cpp and it also gave the same error as above. The info from lli --version is below:
$lli --version
LLVM (http://llvm.org/):
LLVM version 3.2svn
Optimized build with assertions.
Built May 7 2012 (10:54:43).
Default target: x86_64-unknown-linux-gnu
Host CPU: corei7-avx
Any pointers? I saw another thread "Trouble using the MCJIT: "Target does not support MC emission" error" but that didnt seem to have positive ending.
TIA,
Ashok
Sorry, I'm not familiar with these parts (ASM parsing in MC). Perhaps someone else could help here. I wonder, though, did you manage to get some code running without inline ASM?
Eli
<snip>
$lli -entry-function="ISimEngine_GetVersion" -use-mcjit libengine.bc
LLVM ERROR: Inline asm not supported by this streamer because we don't
have an asm parser for this target
I also tried other variations of the call with the same result:
$lli -entry-function="ISimEngine_GetVersion" -use-mcjit -mattr=+avx
-mcpu=corei7-avx libengine.bc
I updated my program looking at lli.cpp and it also gave the same error as
above. The info from lli --version is below:
$lli --version
LLVM (http://llvm.org/):
LLVM version 3.2svn
Optimized build with assertions.
Built May 7 2012 (10:54:43).
Default target: x86_64-unknown-linux-gnu
Host CPU: corei7-avx
Any pointers? I saw another thread "Trouble using the MCJIT: "Target does
not support MC emission" error" but that didnt seem to have positive
ending.
Sorry, I'm not familiar with these parts (ASM parsing in MC). Perhaps someone else could help here. I wonder, though, did you manage to get some code running without inline ASM?
Eli
I tried the attached program, compiled with clang and used lli to run it:
clang -cc1 -O0 -g -emit-llvm test.c
lli -use-mcjit test.ll
The lli prints out what looks like binary data. If I remove the inline asm from the program, it works fine.
TIA,
Ashok
test.c (325 Bytes)
Resending, any pointers are much appreciated.
>>>> $lli -entry-function="ISimEngine_GetVersion" -use-mcjit libengine.bc
>>>> LLVM ERROR: Inline asm not supported by this streamer because we don't
>>>> have an asm parser for this target
You can see the error message comes from lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp.