Unable to link in X86AsmParser.cpp into lli

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

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

lli_inline_asm.patch (763 Bytes)