[cfe-dev] collect2: fatal error: ld terminated with signal 9 [Killed] clang

Robinson, Paul via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 25 12:35:44 PDT 2020


The error message is typical of the ran-out-of-memory condition.
It appears you are using ld as your linker? (it is the default on Ubuntu) Our usual next suggestion is to use gold or lld instead, as they consume less memory.  There are instructions on the web for making gold your default linker.
If that is not practical, the other suggestion is to reduce the number of threads (the -j option to make or ninja).  If you are doing a Debug build, likely you would need to use -j1.
Best regards,
--paulr

From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of suyash singh via cfe-dev
Sent: Wednesday, March 25, 2020 2:07 PM
To: cfe-dev at lists.llvm.org
Subject: [cfe-dev] collect2: fatal error: ld terminated with signal 9 [Killed] clang

I was building clang on Ubuntu 18.04
https://clang.llvm.org/get_started.html#build

and got the error message
collect2: fatal error: ld terminated with signal 9 [Killed] clang

I have 8 GB ram
and increased the Linux swap to 40 GB but still same problem.

Full error message
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
tools/lto/CMakeFiles/LTO.dir/build.make:270: recipe for target 'lib/libLTO.so.11git' failed
make[2]: *** [lib/libLTO.so.11git] Error 1
make[2]: *** Deleting file 'lib/libLTO.so.11git'
CMakeFiles/Makefile2:23538: recipe for target 'tools/lto/CMakeFiles/LTO.dir/all' failed
make[1]: *** [tools/lto/CMakeFiles/LTO.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200325/26325d3d/attachment.html>


More information about the cfe-dev mailing list