[LLVMdev] current state of building analysis passes out-of-tree with llvm-config?

Timo Juhani Lindfors timo.lindfors at iki.fi
Mon Oct 12 06:52:26 PDT 2009


Hi,

what's the current state of being able to build simple analysis passes
out-of-tree against only llvm headers and libraries with llvm-config?

I see that clang and klee do not use llvm-config but for example
rubinius does. Should both approaches be documented?

Currently for example docs/WritingAnLLVMPass.html says

   "you need to create a new directory somewhere in the LLVM source
    base."

while people who only want to experiment with simple passes might feel
more comfortable if they didn't need to create directories inside llvm
source tree. I ended up with the following Makefile:

all:
        g++ -c -o LLVMHello.o `llvm-config --cxxflags` Hello.cpp
        gcc -shared -Wl,-soname,LLVMHello.so -o LLVMHello.so LLVMHello.o

clean:
        rm -f LLVMHello.so LLVMHello.o

(I can not use Makefile.common since it is not installed by 'make
install')

best regards,
Timo Lindfors



More information about the llvm-dev mailing list