Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

gcc

ubuntu

ld

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.

like image 692
Old Panda Avatar asked Sep 17 '17 01:09

Old Panda


5 Answers

you can solve this issue by using :

 cargo run --release --verbose --jobs 1
like image 178
Rishikesh Avatar answered Nov 06 '22 06:11

Rishikesh


It is memory exhaustion. The sampling interval for the memory measurement is just not small enough that it covers the exact point where the OOM killer kicks in.

Depending on the container/VM technology, you may be able to set vm.overcommit_memory=2 before the build, so that the process is not killed (but doing so actually requires more memory and swap space to get the build to complete).

like image 35
Florian Weimer Avatar answered Nov 06 '22 05:11

Florian Weimer


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).
like image 24
houssam Avatar answered Nov 06 '22 04:11

houssam


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

like image 4
KernelPanic Avatar answered Nov 06 '22 04:11

KernelPanic


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.

like image 1
Dawid Avatar answered Nov 06 '22 06:11

Dawid