llvm/clang compile error with Memory exhausted

孤者浪人 提交于 2020-01-12 04:10:36

问题


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?


回答1:


You need to do one of the following:

  1. Add more RAM to your VM, or
  2. Use gold instead of ld as a linker, or
  3. Build Release(-DCMAKE_BUILD_TYPE=Release), not Debug build



回答2:


Another consideration: If you have Make running parallel jobs (e.g., make -j8), the concurrently executing jobs may require too much memory.



来源:https://stackoverflow.com/questions/25197570/llvm-clang-compile-error-with-memory-exhausted

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!