[LLVMdev] large linking time

Chris Lattner sabre at nondot.org
Mon Nov 3 17:17:01 PST 2003


On Mon, 3 Nov 2003, Rahul Joshi wrote:

> I have observed that the LLVM build takes pretty long time
> to link executables (i.e. tools). Is that a normal behavior?

You can thank the binutils people for this.  From what I've heard, they've
been doing some work to improve link times with "optimizations" like not
using a fixed number of buckets in critical hash tables.

In terms of practical suggestions, here's some ideas:

1. Try getting a newer binutils (ie, ld) than you already have.  It may be
   improved.
2. If you can, build stuff into shared objects and load it with -load.
   This is only really feasible if you're working on llvm-to-llvm passes.
3. Debugging information is what really slows stuff down.  If it is
   useful, compile with ENABLE_OPTIMIZED on.  Without debug information,
   link times are _very_ short.
4. Like Misha said, you can get away with not rebuilding some of the tools
   if you're not using them.  Be careful though, because you don't want to
   accidentally get out of date and not know it.  The makefiles already
   only rebuild the correct set of tools based on which libraries get
   modified.

Hopefully this will help, if not, the binutils sources are available.  :)

-Chris

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




More information about the llvm-dev mailing list