[LLVMdev] Getting Started with LLVM

Eric Kidd emk.lists at gmail.com
Wed Mar 15 05:35:44 PST 2006

On Mar 14, 2006, at 2:22 PM, Chris Lattner wrote:
>> Gnome (and many other Unix projects with massively ugly  
>> dependencies) can be linked trivially using a "foo-config" script.  
>> If LLVM had something similar, it might save new LLVM developers  
>> several hours of digging through manuals and Makefiles.
> This would be very very cool to have.

OK! Would something like the following interface be a reasonable  
first approach?

   llvm-config (--cxxflags | --ldflags | --libs) (all | jit)
     --cxxflags: Flags to use when compiling C++ source code.
     --ldflags: Linker flags to use when linking against LLVM.
     --libs: Libraries needed to link the current configuration.
     all: Link all LLVM libraries for the current platform.
     jit: Link the libraries needed by the standard JIT/interpreter  

This fits nicely into the autoconf/autoconf view of the world, and  
would only take an evening to get working. If llvm-gcc 4.0 requires a  
specific subset of libraries, we could add a third hard-coded  

Later on, we could consider adding fine-grained control over which  
libraries get linked, perhaps based on output from GenLibDeps.pl. But  
that would require making GenLibDeps.pl more portable (it currently  
uses some non-portable nm flags). In any case, I'm mostly focused on  
making things easy for first-time LLVM users.

> For what it's worth, linking is significantly faster for a release  
> build than a debug build.  Also, if you're on linux, updating to a  
> new binutils can help things significantly.

Thanks for the tips! I've been writing a (very primitive) llvm-grep  
program as a warmup exercise, and I was able to JIT good code within  
a day of getting started.

Many thanks for releasing such a cool project!


More information about the llvm-dev mailing list