[LLVMdev] Linking issue

Vania Joloboff vania.joloboff at inria.fr
Mon Feb 4 01:15:21 PST 2013


Hi,

I would like to link my code with a Makefile like

target : $(OBJECTS)
               $(LLVM_LINK) `llvm-config --ldflags` $(OBJECTS) 
`llvm-config --libs`


But this does not work because
`llvm-config --ldflags` output is

-L/usr/local/llvm/3.2/lib  -lpthread -ldl -lm

and `llvm-config --libs` output is a long list of libraries
-lLLVMAsmParser -lLLVMInstrumentation -lLLVMLinker -lLLVMArchive 
-lLLVMBitReader -lLLVMDebugInfo -lLLVMJIT etc.

But the problem is that "-lpthread -ldl -lm" should be placed after OBJECTS
although -L/usr/local/llvm/3.2/lib should indeed be placed before.

Any advice ?

Vania




More information about the llvm-dev mailing list