[LLVMdev] Unable to link in X86AsmParser.cpp into lli
Ashok Nalkund
ashoknn at qualcomm.com
Sat May 12 21:10:26 PDT 2012
I made the attached changes to get this working, now lli compiles
without compiling about undefined InitializeNativeTargetAsmParser() and
'lli -use-mcjit' runs without complaining about inline asm not supported.
Note that I had to manually make changes to tools/lli/Makefile since it
didnt seem to be regenerated.
Can somebody comment on the changes?
tia,
ashok
On 5/12/2012 8:00 PM, Ashok Nalkund wrote:
> Hi,
> Using the trunk of svn. I'm trying to get inline-asm working on X86.
> So I added call to:
>
>> InitializeNativeTargetAsmParser()
>
> during initialization. However, this causes a linking error:
>> llvm[2]: Linking Debug+Asserts executable lli
>> /local/mnt/workspace/ashoknn/crd/neo/llvm/proto/llvmsvn/build/tools/lli/Debug+Asserts/lli.o: In function `llvm::InitializeNativeTargetAsmParser()':
>> /local/mnt/workspace/ashoknn/crd/neo/llvm/proto/llvmsvn/llvm/include/llvm/Support/TargetSelect.h:149: undefined reference to `LLVMInitializeX86AsmParser'
>> collect2: ld returned 1 exit status
>
> I've been scratching my head trying to figure out why? I tried to
> look at llc's CMakeLists.txt and it seems very similar to lli's
> CMakeLists.txt file (both include asmparser in link components list).
>
> Any idea whats missing?
>
> TIA,
> ashok
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
Index: tools/lli/lli.cpp
===================================================================
191a192
> InitializeNativeTargetAsmParser();
Index: tools/lli/CMakeLists.txt
===================================================================
4c4
< set(LLVM_LINK_COMPONENTS mcjit jit interpreter nativecodegen bitreader asmparser selectiondag)
---
> set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} mcjit jit interpreter nativecodegen bitreader asmparser selectiondag)
Index: tools/lli/Makefile
===================================================================
15c15
< LINK_COMPONENTS := mcjit jit interpreter nativecodegen bitreader asmparser selectiondag
---
> LINK_COMPONENTS := all-targets mcjit jit interpreter nativecodegen bitreader asmparser selectiondag
More information about the llvm-dev
mailing list