[LLVMdev] Re: standalone llvm

Simon Burton
Fri, 14 Apr 2006 12:08:06 -0000

On Fri, 14 Apr 2006 04:05:10 +0200
Oscar Fuentes <oscarfv at telefonica.net> wrote:

>
> This indicates that the JIT is not working and your code is being
> interpreted. I don't know about "llvm-config --libs jit" you
are using
> but I would try adding LLVMJIT.o to your link command the same way you
> do with LLVMInterpreter.o

Actually if I _remove_ those other library link arguments and just left the
ones provided by "llvm-config --libs" it works fine (yay!). Except
it's a huge
executable: 168Mb. And the linker warns about some symbols:
/usr/bin/ld:
`.gnu.linkonce.t._ZNK4llvm14TargetLowering12getValueTypeEPKNS_4TypeE'
referenced in section `.rodata' of /home//users//simonb//lib/LLVMPowerPC.o:
defined in discarded section
`.gnu.linkonce.t._ZNK4llvm14TargetLowering12getValueTypeEPKNS_4TypeE' of
/home//users//simonb//lib/LLVMPowerPC.o

etc.

If instead I use "llvm config --libs jit asmparser" it compiles but
segfaults in the usual
place. Here are the libs it uses in this case:
$ llvm-config --libnames jit asmparser
LLVMAsmParser.o LLVMJIT.o LLVMExecutionEngine.o LLVMCodeGen.o LLVMSelectionDAG.o
libLLVMAnalysis.a libLLVMTarget.a libLLVMTransformUtils.a libLLVMipa.a
libLLVMAnalysis.a libLLVMTarget.a libLLVMTransformUtils.a libLLVMipa.a
LLVMCore.o libLLVMSupport.a libLLVMSystem.a LLVMbzip2.o

Somewhat better is when I use "--libs engine asmparser". It works, and
generates
an exe around 77Mb. And no complaints when linking.

thanks for your help Oscar.

Simon.

--
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940