collect2: fatal error: ld terminated with signal 9 [Killed]

Viewed 22602

I'm trying to build precimonious on Ubuntu 16.04.3 x64. I allocated 1GB memory for it. My file structure looks like

~
|--- llvm/
|--- precimonious/

where the llvm is on version 3.0 as mentioned at https://github.com/corvette-berkeley/precimonious#requirement. Then I followed the steps on the README but command make ended with

...
llvm[1]: Linking Debug Shared Library libLLVM-3.0.so
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
...

I went through some answers online and they say it might because there's not enough memory to perform the link. But the memory usage is like enter image description here

The gcc version on my machine is gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) and was installed via apt-get install build-essential. This is a fresh droplet I just created on DigitalOcean btw. Any help is appreciated.

5 Answers

I had this problem, and solved by:

  • Increase SWAP disk (8 GB working with me).
  • Increase Memory (I was on virtual machine, 8 GB).
  • You need 27 GB (LLVM 6.0.0) free disk space (check with df -h in Terminal).

Sometimes system kills linker due to CPU overload. If your build is parallel, try -l option (make and ninja support it). Looks similar to your case.

To decrease system load, build release version of llvm. Linking of debug version is much more expensive.

llvm[1]: Linking Debug Shared Library libLLVM-3.0.so

you can solve this issue by using :

 cargo run --release --verbose --jobs 1

I had the same error while installing snort on the Ubuntu inside a virtual box with 2 GB of RAM. I increased the RAM to 4 GB and it worked for me.

Related