[LLVMdev] Unable to Run Inline Asm with MCJIT

Jim Grosbach grosbach at apple.com
Mon Nov 5 11:50:30 PST 2012


Nope, not a waste of time at all. It was a bug in lli that I'm glad to get resolved in top of tree. Thanks for reporting the issue!

-Jim

On Nov 5, 2012, at 11:15 AM, Amit Arya <aarya at cs.stonybrook.edu> wrote:

> Hi Jim,
> 
> Thanks for the reply. I was able to figure out the problem in 'lli'. InitializeNativeTargetAsmParser() was missing in lli.
> I should have replied back saying that the problem was resolved. Hope I didn't waste your time.
> 
> Regards,
> Amit
> From: Jim Grosbach [grosbach at apple.com]
> Sent: Monday, November 05, 2012 2:07 PM
> To: Amit Arya
> Cc: LLVM Developers Mailing List; Varinder Singh
> Subject: Re: [LLVMdev] Unable to Run Inline Asm with MCJIT
> 
> Hi Amit,
> 
> You're not doing anything wrong. This is an error in 'lli' not properly initializing the native target libraries. Fixed in SVN trunk r167392.
> 
> -Jim
> 
> On Nov 4, 2012, at 4:09 PM, Amit Arya <aarya at cs.stonybrook.edu> wrote:
> 
>> Hi,
>> 
>> I am first year PhD student at Stony Brook University. For one of my projects I am trying to JIT compile and run a C program containing inline assembly using MCJIT but I am not able to.
>> 
>> I have cloned and build LLVM-3.1. Below are more details.
>> 
>> Arch : x86 
>> OS :  Linux ubuntu 2.6.35-22-generic
>> 
>> Sample program : test_inline_asm.c
>> -------------------
>> #include <stdio.h>
>> int main(){
>>     int a=0;
>>     __asm __volatile("movl $5,%%eax\t"
>>     "\n movl %%eax,%0":"=r"(a)::"cc","memory"
>>     );
>>     printf("a= %d\n",a);
>> }
>> 
>> Commands 
>> -------------
>> clang -emit-llvm -S test_inline_asm.c
>> lli -use-mcjit test_inline_asm.s
>> 
>> throws,
>> 
>> LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target
>> 
>> Any pointers to what mistake I have been doing.Any help would be much appreciated.
>> 
>> Thanks & Regards,
>> Amit Arya
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121105/d447e791/attachment.html>


More information about the llvm-dev mailing list