[LLVMdev] Using LLVM to compile system programs

Chris Lattner sabre at nondot.org
Mon Nov 7 15:43:34 PST 2005


On Mon, 7 Nov 2005, Sean Peisert wrote:
> I'm having a bit of difficulty using LLVM to compile system programs
> (e.g. rsh) on FreeBSD 5.x.  Basically 'lli' is bombing out with
> "ERROR: Program used external function 'blah' which could not be
> resolved!"  I was hoping that you could please point me to a sample
> Makefile that might both use external (i.e. system) libraries as well
> as the LLVM libraries & programs.  At this point, LLVM makefiles seem
> clear, as do the makefiles that the system programs use, but merging
> them is proving complicated.  Thanks.

There are three basic options here:

1. Build all your code with LLVM.
2. Build the non-llvm parts into a dynamic library, and use "lli -load
    x.so <other options>" to load it.
3. Link the non-llvm parts into LLI.

The best one depends on what you're trying to do.  If you're interested in 
the LLVM makefiles, there is a good doc in http://llvm.org/docs/ on the 
makefiles.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list