[LLVMdev] Getting Started with LLVM

Chris Lattner sabre at nondot.org
Wed Mar 15 23:16:45 PST 2006

On Wed, 15 Mar 2006, Eric Kidd wrote:
> 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 
> configuration.

Sounds great.

> 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 configuration.


> 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.

I would be quite happy to have a hard-coded list of library dependencies, 
even if it means that we need to manually maintain them.  This will force 
us to realize and think about what dependencies there are between 

>> 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.




More information about the llvm-dev mailing list