Howto: Faster LLVM development

From LLVM

Jump to: navigation, search

[edit] Overview

  • Multiple source trees
  • ccache
  • distcc
  • gold linker, if applicable

[edit] Detailed discussion

If you are spending a lot of time re-building LLVM tools and re-running the test suite, consider using multiple parallel LLVM development trees. Each source tree should be used for one logical change. You can build/test one while working on the other one. This will naturally require several times the disk space to house the build trees, but you can re-use the object files from one build tree in another by using ccache:

ccache is a compiler cache. It acts as a caching pre-processor to C/C++ compilers, using the -E compiler switch and a hash to detect when a compilation can be satisfied from cache. This often results in a 5 to 10 times speedup in common compilations.

To further speed up your builds, consider using distcc to distribute your compilation to another machine to make your desktop's interactive performance better for a more usable development, or multiple other machines for a much faster compilation.

If your system runs on x86 or x86_64 and uses the ELF binary format (e.g., GNU/Linux), you can use the new gold linker in binutils to speed up your linking significantly, in some cases by a factor of 5.

Personal tools