ziglang/zig-bootstrap

powerpc64le-linux-musl

andrewrk opened this issue · 1 comments

This one crashed clang!

-- Check for working C compiler: /home/andy/dev/bootstrap-zig/out/host/bin/zig -- broken
CMake Error at /nix/store/qbn4f7k7yj5dj8ay292hr2nv0q8854vq-cmake-3.16.3/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/home/andy/dev/bootstrap-zig/out/host/bin/zig"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/andy/dev/bootstrap-zig/out/build-llvm-powerpc64le-linux-musl/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/nix/store/as5612va9alwps1hlggh201iw181md8r-gnumake-4.2.1/bin/make cmTC_76b4c/fast && /nix/store/as5612va9alwps1hlggh201iw181md8r-gnumake-4.2.1/bin/make -f CMakeFiles/cmTC_76b4c.dir/build.make CMakeFiles/cmTC_76b4c.dir/build
    make[1]: Entering directory '/home/andy/dev/bootstrap-zig/out/build-llvm-powerpc64le-linux-musl/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_76b4c.dir/testCCompiler.c.o
    /home/andy/dev/bootstrap-zig/out/host/bin/zig  cc -target powerpc64le-linux-musl    -o CMakeFiles/cmTC_76b4c.dir/testCCompiler.c.o   -c /home/andy/dev/bootstrap-zig/out/build-llvm-powerpc64le-linux-musl/CMakeFiles/CMakeTmp/testCCompiler.c
    fatal error: error in backend: Do not know how to expand the result of this operator!
    Stack dump:
    0.	Program arguments: /home/andy/dev/bootstrap-zig/out/host/bin/zig clang -c -MD -MV -MF zig-cache/tmp/fSpHbprMwAww-testCCompiler.o.d -nostdinc -fno-spell-checking -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/include -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/libc/include/powerpc64-linux-musl -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/libc/include/generic-musl -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/libc/include/powerpc64le-linux-any -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/libc/include/any-linux-any -target powerpc64le-unknown-linux-musl -Xclang -target-cpu -Xclang generic -Xclang -target-feature -Xclang -64bit,-64bitregs,-allow-unaligned-fp-access,-altivec,-booke,-bpermd,-cmpb,-crbits,-crypto,-direct-move,-e500,-extdiv,-fcpsgn,-float128,-fpcvt,-fprnd,-fpu,-fre,-fres,-frsqrte,-frsqrtes,-fsqrt,+hard-float,-htm,-icbt,-invariant-function-descriptors,-isa-v30-instructions,-isel,-ldbrx,-lfiwax,-longcall,-mfocrf,-msync,-partword-atomics,-popcntd,-power8-altivec,-power8-vector,-power9-altivec,-power9-vector,-ppc-postra-sched,-ppc-prera-sched,-ppc4xx,-ppc6xx,-qpx,-recipprec,-secure-plt,-slow-popcntd,-spe,-stfiwx,-two-const-nr,-vectors-use-two-units,-vsx -fno-omit-frame-pointer -fsanitize=undefined -fsanitize-trap=undefined -D_DEBUG -Og -fstack-protector-strong --param ssp-buffer-size=4 -o zig-cache/tmp/fSpHbprMwAww-testCCompiler.o /home/andy/dev/bootstrap-zig/out/build-llvm-powerpc64le-linux-musl/CMakeFiles/CMakeTmp/testCCompiler.c 
    1.	<eof> parser at end of file
    2.	Code generation
    3.	Running pass 'Function Pass Manager' on module '/home/andy/dev/bootstrap-zig/out/build-llvm-powerpc64le-linux-musl/CMakeFiles/CMakeTmp/testCCompiler.c'.
    4.	Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@main'
     #0 0x00000000058ab6ea llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x58ab6ea)
     #1 0x00000000058a9454 llvm::sys::RunSignalHandlers() (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x58a9454)
     #2 0x00000000058a96e1 llvm::sys::CleanupOnSignal(unsigned long) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x58a96e1)
     #3 0x00000000057e8264 llvm::CrashRecoveryContext::HandleExit(int) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x57e8264)
     #4 0x00000000058a2627 llvm::sys::Process::Exit(int) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x58a2627)
     #5 0x0000000000c38943 LLVMErrorHandler(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0xc38943)
     #6 0x00000000057ef487 llvm::report_fatal_error(llvm::Twine const&, bool) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x57ef487)
     #7 0x00000000057ef5d0 llvm::report_fatal_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x57ef5d0)
     #8 0x000000000468eff4 llvm::DAGTypeLegalizer::ExpandIntegerResult(llvm::SDNode*, unsigned int) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x468eff4)
     #9 0x00000000045fad57 llvm::DAGTypeLegalizer::run() (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x45fad57)
    #10 0x00000000045fb0f1 llvm::SelectionDAG::LegalizeTypes() (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x45fb0f1)
    #11 0x000000000459d821 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x459d821)
    #12 0x00000000045a14df llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x45a14df)
    #13 0x00000000045a4614 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x45a4614)
    #14 0x00000000036ac259 (anonymous namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x36ac259)
    #15 0x00000000048cbe74 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x48cbe74)
    #16 0x00000000055820b8 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x55820b8)
    #17 0x0000000005583651 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x5583651)
    #18 0x0000000005583a08 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x5583a08)
    #19 0x0000000000ca037c clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0xca037c)
    #20 0x0000000000c52791 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0xc52791)
    #21 0x0000000002727ff1 clang::ParseAST(clang::Sema&, bool, bool) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x2727ff1)
    #22 0x0000000001130bb9 clang::FrontendAction::Execute() (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x1130bb9)
    #23 0x00000000010ec413 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x10ec413)
    #24 0x0000000000c4435b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0xc4435b)
    #25 0x0000000000c390da cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0xc390da)
    #26 0x0000000000c33c72 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0xc33c72)
    #27 0x0000000001233c85 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x1233c85)
    #28 0x00000000057e80f3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x57e80f3)
    #29 0x000000000123487e clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (.part.0) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x123487e)
    #30 0x000000000120b948 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x120b948)
    #31 0x000000000120c249 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x120c249)
    #32 0x0000000001213fff clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x1213fff)
    #33 0x0000000000c37051 ZigClang_main (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0xc37051)
    #34 0x0000000000a30501 main0(int, char**) (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0xa30501)
    #35 0x00000000009a3127 main (/home/andy/dev/bootstrap-zig/out/host/bin/zig+0x9a3127)
    #36 0x00007f10489b3b8e __libc_start_main (/nix/store/y9zg6ryffgc5c9y67fcmfdkyyiivjzpj-glibc-2.27/lib/libc.so.6+0x22b8e)
    #37 0x0000000000a2ee3a _start /build/glibc-2.27/csu/../sysdeps/x86_64/start.S:122:0
    zig: error: clang frontend command failed with exit code 70 (use -v to see invocation)
    clang version 10.0.0 (/home/andy/dev/bootstrap-zig/clang e1504c160a6174bc3243cc828499d80b727507de)
    Target: powerpc64le-unknown-linux-musl
    Thread model: posix
    InstalledDir: /run/current-system/sw/bin
    zig: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
    zig: note: diagnostic msg: 
    ********************
    
    PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
    Preprocessed source(s) and associated run script(s) are located at:
    zig: note: diagnostic msg: /run/user/1000/testCCompiler-5a2058.c
    zig: note: diagnostic msg: /run/user/1000/testCCompiler-5a2058.sh
    zig: note: diagnostic msg: 
    
    ********************
    terminate called after throwing an instance of 'std::length_error'
      what():  basic_string::_M_create
    
    The following command failed:
    /home/andy/dev/bootstrap-zig/out/host/bin/zig clang -c -MD -MV -MF zig-cache/tmp/fSpHbprMwAww-testCCompiler.o.d -nostdinc -fno-spell-checking -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/include -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/libc/include/powerpc64-linux-musl -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/libc/include/generic-musl -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/libc/include/powerpc64le-linux-any -isystem /home/andy/dev/bootstrap-zig/out/host/lib/zig/libc/include/any-linux-any -target powerpc64le-unknown-linux-musl -Xclang -target-cpu -Xclang generic -Xclang -target-feature -Xclang -64bit,-64bitregs,-allow-unaligned-fp-access,-altivec,-booke,-bpermd,-cmpb,-crbits,-crypto,-direct-move,-e500,-extdiv,-fcpsgn,-float128,-fpcvt,-fprnd,-fpu,-fre,-fres,-frsqrte,-frsqrtes,-fsqrt,+hard-float,-htm,-icbt,-invariant-function-descriptors,-isa-v30-instructions,-isel,-ldbrx,-lfiwax,-longcall,-mfocrf,-msync,-partword-atomics,-popcntd,-power8-altivec,-power8-vector,-power9-altivec,-power9-vector,-ppc-postra-sched,-ppc-prera-sched,-ppc4xx,-ppc6xx,-qpx,-recipprec,-secure-plt,-slow-popcntd,-spe,-stfiwx,-two-const-nr,-vectors-use-two-units,-vsx -fno-omit-frame-pointer -fsanitize=undefined -fsanitize-trap=undefined -D_DEBUG -Og -fstack-protector-strong --param ssp-buffer-size=4 -o zig-cache/tmp/fSpHbprMwAww-testCCompiler.o /home/andy/dev/bootstrap-zig/out/build-llvm-powerpc64le-linux-musl/CMakeFiles/CMakeTmp/testCCompiler.c
    make[1]: *** [CMakeFiles/cmTC_76b4c.dir/build.make:66: CMakeFiles/cmTC_76b4c.dir/testCCompiler.c.o] Error 1
    make[1]: Leaving directory '/home/andy/dev/bootstrap-zig/out/build-llvm-powerpc64le-linux-musl/CMakeFiles/CMakeTmp'
    make: *** [Makefile:121: cmTC_76b4c/fast] Error 2

Currently doesn't crash using x86_64-gentoo-linux-musl as host, execinfo is missing though (possible workaround is to cross-compile the library manually)

[ 15%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o
zig: warning: argument unused during compilation: '-mred-zone' [-Wunused-command-line-argument]
[ 16%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ThreadLocal.cpp.o
zig: warning: argument unused during compilation: '-mred-zone' [-Wunused-command-line-argument]
In file included from /home/user/zig-bootstrap/llvm/lib/Support/Signals.cpp:250:
/home/user/zig-bootstrap/llvm/lib/Support/Unix/Signals.inc:51:11: fatal error: 'execinfo.h' file not found
# include BACKTRACE_HEADER         // For backtrace().
          ^~~~~~~~~~~~~~~~
/home/user/zig-bootstrap/out/build-llvm-powerpc64le-linux-musl-baseline/include/llvm/Config/config.h:29:26: note: expanded from macro 'BACKTRACE_HEADER'
#define BACKTRACE_HEADER <execinfo.h>
                         ^~~~~~~~~~~~
<scratch space>:405:1: note: expanded from here
<execinfo.h>
^~~~~~~~~~~~
1 error generated.
make[2]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/build.make:1994: lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:8259: lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2
make: *** [Makefile:156: all] Error 2