Collect2 fatal error ld terminated with signal 9 killed

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

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.

asked Sep 17, 2017 at 1:04

Old Panda's user avatar

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).

answered Sep 17, 2017 at 11:49

Florian Weimer's user avatar

Florian WeimerFlorian Weimer

31k3 gold badges43 silver badges84 bronze badges

1

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).

answered Dec 21, 2019 at 14:26

houssam's user avatar

houssamhoussam

1,81315 silver badges27 bronze badges

1

you can solve this issue by using :

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

answered Jun 18, 2021 at 7:53

Rishikesh's user avatar

RishikeshRishikesh

1531 silver badge9 bronze badges

2

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

answered Sep 14, 2018 at 17:10

KernelPanic's user avatar

KernelPanicKernelPanic

1013 silver badges7 bronze badges

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.

answered Oct 20, 2021 at 15:27

Dawid's user avatar

DawidDawid

3651 silver badge12 bronze badges

What you were trying to do (and why)

I just trying to install erlang and elixir(in this case llvm, dependency).

What happend(include command output)

==> cmake -G Unix Makefiles /tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INST
==> make
Last 15 lines from /home/algorist/.cache/Homebrew/Logs/llvm/02.make:
cd /tmp/llvm-20170707-2909-229ymp/tools/clang/lib/StaticAnalyzer/Checkers && /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++  -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-20170707-2909-229ymp/tools/clang/lib/StaticAnalyzer/Checkers -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/lib/StaticAnalyzer/Checkers -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/include -I/tmp/llvm-20170707-2909-229ymp/tools/clang/include -I/tmp/llvm-20170707-2909-229ymp/include -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/include  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -DNDEBUG     -o CMakeFiles/clangStaticAnalyzerCheckers.dir/VLASizeChecker.cpp.o -c /tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
[ 72%] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/ValistChecker.cpp.o
cd /tmp/llvm-20170707-2909-229ymp/tools/clang/lib/StaticAnalyzer/Checkers && /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++  -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-20170707-2909-229ymp/tools/clang/lib/StaticAnalyzer/Checkers -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/lib/StaticAnalyzer/Checkers -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/include -I/tmp/llvm-20170707-2909-229ymp/tools/clang/include -I/tmp/llvm-20170707-2909-229ymp/include -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/include  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -DNDEBUG     -o CMakeFiles/clangStaticAnalyzerCheckers.dir/ValistChecker.cpp.o -c /tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
[ 72%] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/VirtualCallChecker.cpp.o
cd /tmp/llvm-20170707-2909-229ymp/tools/clang/lib/StaticAnalyzer/Checkers && /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++  -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-20170707-2909-229ymp/tools/clang/lib/StaticAnalyzer/Checkers -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/lib/StaticAnalyzer/Checkers -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/include -I/tmp/llvm-20170707-2909-229ymp/tools/clang/include -I/tmp/llvm-20170707-2909-229ymp/include -I/tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/include  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -DNDEBUG     -o CMakeFiles/clangStaticAnalyzerCheckers.dir/VirtualCallChecker.cpp.o -c /tmp/llvm-20170707-2909-1mqja1w/llvm-4.0.1.src/tools/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
[ 72%] Linking CXX static library ../../../../../lib/libclangStaticAnalyzerCheckers.a
cd /tmp/llvm-20170707-2909-229ymp/tools/clang/lib/StaticAnalyzer/Checkers && /home/linuxbrew/.linuxbrew/Cellar/cmake/3.8.2/bin/cmake -P CMakeFiles/clangStaticAnalyzerCheckers.dir/cmake_clean_target.cmake
cd /tmp/llvm-20170707-2909-229ymp/tools/clang/lib/StaticAnalyzer/Checkers && /home/linuxbrew/.linuxbrew/Cellar/cmake/3.8.2/bin/cmake -E cmake_link_script CMakeFiles/clangStaticAnalyzerCheckers.dir/link.txt --verbose=1
/home/linuxbrew/.linuxbrew/bin/ar qc ../../../../../lib/libclangStaticAnalyzerCheckers.a  CMakeFiles/clangStaticAnalyzerCheckers.dir/AllocationDiagnostics.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/AnalysisOrderChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/AnalyzerStatsChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ArrayBoundChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ArrayBoundCheckerV2.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/BasicObjCFoundationChecks.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/BlockInCriticalSectionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/BoolAssignmentChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/BuiltinFunctionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CStringChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CStringSyntaxChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CallAndMessageChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CastSizeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CastToStructChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckObjCDealloc.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckObjCInstMethSignature.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckSecuritySyntaxOnly.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckSizeofPointer.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckerDocumentation.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ChrootChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ClangCheckers.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CloneChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ConversionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CXXSelfAssignmentChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DeadStoresChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DebugCheckers.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DereferenceChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DirectIvarAssignment.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DivZeroChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DynamicTypePropagation.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DynamicTypeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ExprInspectionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/FixedAddressChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/GenericTaintChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/GTestChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/IdenticalExprChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/IteratorPastEndChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/IvarInvalidationChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/LLVMConventionsChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/LocalizationChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MacOSKeychainAPIChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MacOSXAPIChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MallocChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MallocOverflowSecurityChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MallocSizeofChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIBugReporter.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIFunctionClassifier.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NSAutoreleasePoolChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NSErrorChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NoReturnFunctionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NonNullParamChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NullabilityChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NumberObjectConversionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCAtSyncChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCContainersASTChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCContainersChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCMissingSuperCallChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCPropertyChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCSelfInitChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCSuperDeallocChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCUnusedIVarsChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/PaddingChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/PointerArithChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/PointerSubChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/PthreadLockChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/RetainCountChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ReturnPointerRangeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ReturnUndefChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/SimpleStreamChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/StdLibraryFunctionsChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/StreamChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/TaintTesterChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/TestAfterDivZeroChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/TraversalChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefBranchChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefCapturedBlockVarChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefResultChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefinedArraySubscriptChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefinedAssignmentChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UnixAPIChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UnreachableCodeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/VforkChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/VLASizeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ValistChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/VirtualCallChecker.cpp.o
/home/linuxbrew/.linuxbrew/bin/ranlib ../../../../../lib/libclangStaticAnalyzerCheckers.a
make[2]: Leaving directory '/tmp/llvm-20170707-2909-229ymp'
[ 72%] Built target clangStaticAnalyzerCheckers
make[1]: Leaving directory '/tmp/llvm-20170707-2909-229ymp'
Makefile:154: recipe for target 'all' failed
make: *** [all] Error 2

READ THIS: https://github.com/Linuxbrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting
Please do not report this issue to Homebrew/brew or Homebrew/core, which support macOS only.

These open issues may also help:
llvm: strip executables/libraries/object files https://github.com/Linuxbrew/homebrew-core/pull/3163
llvm: add bottle 4.0.1 for Linuxbrew https://github.com/Linuxbrew/homebrew-core/pull/3144
ldc: undefined reference to llvm::cl::Option::setArgStr https://github.com/Linuxbrew/homebrew-core/issues/441

https://gist.github.com/anonymous/8712ed72f321c5947a9f498fd936b1a2

What you expected to happen

Install without any issue.
(I think there’s no problem few days ago, maybe llvm 4.0.0)

And I followed @sjackman ‘s instruction on #3113, and applied #1771 but it doesn’t help.

Please help!

Please always follow these steps:

  • Confirmed this is a problem with brew installing one, specific formula and not every time you run brew? If it’s a general brew problem please file this issue at https://github.com/Linuxbrew/brew/issues/new.
  • Attempt to replicate the problem on macOS with Homebrew if possible. If you can replicate the problem on macOS with Homebrew, please report the issue to Homebrew/core. If you are unsure, please report the issue to Linuxbrew.
  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed all issues and retried your prior step?
  • [ x Ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • If brew gist-logs didn’t work: ran brew config and brew doctor and included their output with your issue?

Please note we will close your issue without comment if you delete or do not fill out the issue checklist and provide ALL the requested information.

To help us debug your issue please explain:

  • What you were trying to do (and why)
  • What happened (include command output)
  • What you expected to happen
  • Step-by-step reproduction instructions (by running brew install commands)
  • Home
  • Forum
  • Qt
  • Installation and Deployment
  • collect2: ld terminated with signal 9 [Killed]

  1. Default collect2: ld terminated with signal 9 [Killed]

    I am trying to build qt-4.4 and it fails with the following error:
    collect2: ld terminated with signal 9 [Killed]
    make[1]: *** [../../../../lib/libQtWebKit.so.4.4.0] Error 1
    make[1]: Leaving directory `/var/tmp/build-i686-linux/src/3rdparty/webkit/WebCore’
    make: *** [sub-webkit-make_default-ordered] Error 2

    I read some where that it is due to low memory. Can some one tell me how to resolve it?


  2. Default Re: collect2: ld terminated with signal 9 [Killed]

    Do you need webkit? What if you disable it with «./configure -no-webkit»?

    J-P Nurmi


  3. Default Re: collect2: ld terminated with signal 9 [Killed]


Bookmarks

Bookmarks


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.

Понравилась статья? Поделить с друзьями:
  • Collect2 exe fatal error createprocess no such file or directory
  • Collect2 exe fatal error cannot find ld
  • Collect2 exe error ld returned 1 exit status ошибка компиляции
  • Collect2 exe error ld returned 1 exit status как исправить
  • Collect2 exe error ld returned 1 exit status ардуино