[LLVMdev] llc -load....

Chris Lattner sabre at nondot.org
Mon Jan 24 21:38:30 PST 2005


On Tue, 25 Jan 2005, s88 wrote:

> Thank you...
> I am preparing to build a simple C compiler for our new architecture.
> According to your suggestion. I try to dynamically load my backend.
> But I got the error message :
> llc :  target 'Your_Arch' does not support static compilation!
> could you tell me where is this problem?

A useful tool in llvm is named 'llvmgrep'.  You can use it like this:

$ cd ~/llvm (or whatever)
$ ./utils/llvmgrep 'does not support static compilation!'
tools/llc/llc.cpp:159:                << "' does not support static compilation!\n";

If you look at that file, you'll see that this is because your targets 
addPassesToEmitAssembly(..) method returned true, indicating that it does 
not support static compilation.

-Chris

> On Mon, 24 Jan 2005 22:53:15 -0600 (CST), Chris Lattner
> <sabre at nondot.org> wrote:
>> 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/
>>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-Chris

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




More information about the llvm-dev mailing list