0

When I tried to build LLVM 8 using gcc tool chains, some problems happened. First ld was killed, and as the build skipped this failure and continued, ld aborted itself with an internal error. Given a situation like this, what should I do to solve the problem and build LLVM successfully? It is known that LLVM demands a great deal of the host compiler.

Below I try to provide as detailed configuration as possible:

  • Host machine: Ubuntu 18.04.1 LTS bionic
  • LLVM version: 8, obtained with command: git clone https://git.llvm.org/git/llvm.git/
  • ld version: 2.30
  • gcc version: 7.3.0
  • cmake version: 3.10.2
  • ninja version: 1.8.2 (I am using it in place of Unix Makefile)
  • cmake command used: cmake -DCMAKE_INSTALL_PREFIX=$HOME -DLLVM_TARGETS_TO_BUILD="Mips;X86" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_OPTIMIZED_TABLEGEN=1 -G Ninja ..

    [2/305] Linking CXX executable bin/llc
    FAILED: bin/llc 
    collect2: fatal error: ld terminated with signal 9 [Killed]
    compilation terminated.
    [5/305] Linking CXX executable bin/bugpoint
    FAILED: bin/bugpoint 
    collect2: fatal error: ld terminated with signal 9 [Killed]
    compilation terminated.
    [6/305] Linking CXX executable bin/dsymutil
    FAILED: bin/dsymutil 
    /usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.30 internal error, aborting at ../../bfd/merge.c:912 in _bfd_merged_section_offset
    
    /usr/bin/ld: Please report this bug.
    
    collect2: error: ld returned 1 exit status
    [7/305] Linking CXX executable bin/lli
    ninja: build stopped: subcommand failed.
    

I deleted the long lines of static libraries of LLVM to shorten the log message. I haven't met such an event before, namely Internal Compiler Error. Anyone tell me what should I do, after mailing a bug report? Should I change tool chains to clang? But doesn't it use ld after all?

  • I am now trying another approach -- using apt to get binaries instead of building from sources. When I succeed, I might close this question. – Cong Feng Nov 30 '18 at 11:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.