[LLVMdev] llc -load....

Chris Lattner sabre at nondot.org
Mon Jan 24 20:53:15 PST 2005


On Tue, 25 Jan 2005, s88 wrote:

> hello...
> I have finish my backend. But I dont know how to install my backend...
> llc -load=???Load what??
> Can anyone teach me?
> thanx.

There are two ways to do this.  You can either link the backend directly 
into llc (like the X86 or PowerPC backends, see tools/llc/Makefile), or 
you can dynamically load the backend.

To dynamically load the back end, add these two lines to your target 
makefile:

SHARED_LIBRARY = 1
LOADABLE_MODULE = 1

This should build a DSO for your target (which will end with .so if you're 
on most unixy platforms).  You can load this with:

   llc --load ~/llvm/Debug/lib/yourlibrary.so -march=yourarch in.bc -o out.s

BTW, what architecture are you working with?

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list