[LLVMdev] How much memory clang llvm needs for debug compiling?

Tim Northover t.p.northover at gmail.com
Mon Jun 2 07:18:22 PDT 2014


Hi,

> What should I do to make debug enabled compiling successful? Anyone
> can tell me a tiny configuration which can save memory? I only have 3G
> RAM, Ubuntu kylin.

3GB is probably going to be painful no matter what you do, but there
are a few things to try.

First, you could switch to ld.gold instead of ld.bfd. It uses much
less memory when linking. It can also be helpful to reduce the
parallelism of the build so that only one thing is linking at any one
time.

Finally, you can build clang with the debug info in separate files.
This needs a newer gdb & gcc/clang to work properly, but 14.04 should
be fine. This made a massive difference to me, so I'm really keen on
the idea. I think for autoconf you need ".../configure
--enable-split-dwarf" to use this.

Good luck!

Tim.



More information about the llvm-dev mailing list