I am trying to build the latest llvm/clang code on my ubuntu 14.04 vm, which has 2GB memory.
What I did is a normal configure/make procedure, without any parameters to these two commands.
at last, I have the following error:
llvm[4]: Linking Debug+Asserts executable clang
/usr/bin/ld: failed to set dynamic section sizes: Memory exhausted
collect2: error: ld returned 1 exit status
make[4]: *** [/home/alex/Downloads/llvm_build/Debug+Asserts/bin/clang] Error 1
make[4]: Leaving directory/home/alex/Downloads/llvm_build/tools/clang/tools/driver' make[3]: *** [driver/.makeall] Error 2 make[3]: Leaving directory
/home/alex/Downloads/llvm_build/tools/clang/tools'
make[2]: * [all] Error 1
make[2]: Leaving directory/home/alex/Downloads/llvm_build/tools/clang' make[1]: *** [clang/.makeall] Error 2 make[1]: Leaving directory
/home/alex/Downloads/llvm_build/tools'
make: *** [all] Error 1
Does anyone know how to resolve this?
Note that Debug builds require a lot of time and disk space. An LLVM-only build will need about 1-3 GB of space. A full build of LLVM and Clang will need around 15-20 GB of disk space.
LLVM is a backend compiler meant to build compilers on top of it. It deals with optimizations and production of code adapted to the target architecture. CLang is a front end which parses C, C++ and Objective C code and translates it into a representation suitable for LLVM.
The combination of Clang front-end and LLVM back-end is called Clang/LLVM or simply Clang. The name LLVM was originally an initialism for Low Level Virtual Machine. However, the LLVM project evolved into an umbrella project that has little relationship to what most current developers think of as a virtual machine.
Clang is released as part of regular LLVM releases. You can download the release versions from https://llvm.org/releases/. Clang is also provided in all major BSD or GNU/Linux distributions as part of their respective packaging systems. From Xcode 4.2, Clang is the default compiler for Mac OS X.
You need to do one of the following:
Another consideration: If you have Make running parallel jobs (e.g., make -j8
), the concurrently executing jobs may require too much memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With