Skip to content

Build fails with LLVM trunk. #55714

Closed
Closed
@vext01

Description

@vext01

Hi,

I'm not sure if you target LLVM trunk, but I guess this will have to be fixed some day anyway.

Using LLVM trunk as of today (commit 5bc1446f3bee779c5a15a0256169bc7623682121 in git) and Rust master (commit 24e66c28980442a48d9458f1a4f9b76cc722dc8a in git), I have the following compilation error when building src/libstd:

   Compiling libc v0.2.43
   Compiling rustc-demangle v0.1.9
   Compiling memmap v0.6.2
   Compiling num_cpus v1.8.0
   Compiling rustc_llvm v0.0.0 (/home/vext01/source/rust/src/librustc_llvm)
error: failed to run custom build command for `rustc_llvm v0.0.0 (/home/vext01/source/rust/src/librustc_llvm)`
process didn't exit successfully: `/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-codegen/release/build/rustc_llvm-05b28adcfb95b2e9/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=/opt/llvm/bin/llvm-config
cargo:rerun-if-env-changed=LLVM_CONFIG
cargo:rustc-cfg=llvm_component="aarch64"
cargo:rustc-cfg=llvm_component="amdgpu"
cargo:rustc-cfg=llvm_component="arm"
cargo:rustc-cfg=llvm_component="asmparser"
cargo:rustc-cfg=llvm_component="bitreader"
cargo:rustc-cfg=llvm_component="bitwriter"
cargo:rustc-cfg=llvm_component="hexagon"
cargo:rustc-cfg=llvm_component="instrumentation"
cargo:rustc-cfg=llvm_component="interpreter"
cargo:rustc-cfg=llvm_component="ipo"
cargo:rustc-cfg=llvm_component="linker"
cargo:rustc-cfg=llvm_component="lto"
cargo:rustc-cfg=llvm_component="mcjit"
cargo:rustc-cfg=llvm_component="mips"
cargo:rustc-cfg=llvm_component="msp430"
cargo:rustc-cfg=llvm_component="nvptx"
cargo:rustc-cfg=llvm_component="powerpc"
cargo:rustc-cfg=llvm_component="sparc"
cargo:rustc-cfg=llvm_component="systemz"
cargo:rustc-cfg=llvm_component="webassembly"
cargo:rustc-cfg=llvm_component="x86"
cargo:rerun-if-changed-env=LLVM_RUSTLLVM
cargo:rerun-if-changed=../rustllvm/llvm-rebuild-trigger
cargo:rerun-if-changed=../rustllvm/.editorconfig
cargo:rerun-if-changed=../rustllvm/RustWrapper.cpp
cargo:rerun-if-changed=../rustllvm/rustllvm.h
cargo:rerun-if-changed=../rustllvm/ArchiveWrapper.cpp
cargo:rerun-if-changed=../rustllvm/PassWrapper.cpp
cargo:rerun-if-changed=../rustllvm/Linker.cpp
cargo:rerun-if-changed=../rustllvm/README
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("2")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_x86_64-unknown-linux-gnu = Some("c++")
CXXFLAGS_x86_64-unknown-linux-gnu = Some("-ffunction-sections -fdata-sections -fPIC -m64")
DEBUG = Some("false")
running: "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-I/opt/llvm/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-std=c++11" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic" "-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor" "-Wno-comment" "-g" "-fno-exceptions" "-fno-rtti" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-o" "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-e2b8d44760d75287/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp"
exit code: 0
running: "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-I/opt/llvm/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-std=c++11" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic" "-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor" "-Wno-comment" "-g" "-fno-exceptions" "-fno-rtti" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-o" "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-e2b8d44760d75287/out/../rustllvm/RustWrapper.o" "-c" "../rustllvm/RustWrapper.cpp"
cargo:warning=../rustllvm/RustWrapper.cpp: In function ‘LLVMOpaqueMetadata* LLVMRustDIBuilderCreateStaticVariable(LLVMRustDIBuilderRef, LLVMMetadataRef, const char*, const char*, LLVMMetadataRef, unsigned int, LLVMMetadataRef, bool, LLVMValueRef, LLVMMetadataRef, uint32_t)’:
cargo:warning=../rustllvm/RustWrapper.cpp:799:55: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘llvm::MDTuple*’ [-fpermissive]
cargo:warning=       InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
cargo:warning=                                                       ^
cargo:warning=In file included from ../rustllvm/rustllvm.h:63:0,
cargo:warning=                 from ../rustllvm/RustWrapper.cpp:11:
cargo:warning=/opt/llvm/include/llvm/IR/DIBuilder.h:582:33: note:   initializing argument 10 of ‘llvm::DIGlobalVariableExpression* llvm::DIBuilder::createGlobalVariableExpression(llvm::DIScope*, llvm::StringRef, llvm::StringRef, llvm::DIFile*, unsigned int, llvm::DIType*, bool, llvm::DIExpression*, llvm::MDNode*, llvm::MDTuple*, uint32_t)’
cargo:warning=     DIGlobalVariableExpression *createGlobalVariableExpression(
cargo:warning=                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-I/opt/llvm/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-std=c++11" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic" "-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor" "-Wno-comment" "-g" "-fno-exceptions" "-fno-rtti" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-o" "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-e2b8d44760d75287/out/../rustllvm/RustWrapper.o" "-c" "../rustllvm/RustWrapper.cpp" with args "c++" did not execute successfully (status code exit code: 1).

', /home/vext01/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.25/src/lib.rs:2260:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:345
   7: cc::fail
   8: cc::Build::compile
   9: build_script_build::main
  10: std::rt::lang_start::{{closure}}
  11: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  12: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  13: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  14: main
  15: __libc_start_main
  16: _start

command did not execute successfully: "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--manifest-path" "/home/vext01/source/rust/src/librustc_codegen_llvm/Cargo.toml" "--features" "" "--message-format" "json"
expected success, got: exit code: 101
thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1101:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::begin_panic
             at libstd/panicking.rs:410
   6: bootstrap::compile::run_cargo
             at bootstrap/compile.rs:1101
   7: <bootstrap::compile::CodegenBackend as bootstrap::builder::Step>::run
             at bootstrap/compile.rs:686
   8: bootstrap::builder::Builder::ensure
             at bootstrap/builder.rs:1215
   9: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
             at bootstrap/compile.rs:964
  10: bootstrap::builder::Builder::ensure
             at bootstrap/builder.rs:1215
  11: bootstrap::builder::Builder::compiler
             at bootstrap/builder.rs:579
  12: <bootstrap::compile::Test as bootstrap::builder::Step>::make_run
             at bootstrap/compile.rs:328
  13: bootstrap::builder::StepDescription::maybe_run
             at bootstrap/builder.rs:191
  14: bootstrap::builder::StepDescription::run
             at bootstrap/builder.rs:234
  15: bootstrap::builder::Builder::run_step_descriptions
             at bootstrap/builder.rs:571
  16: bootstrap::builder::Builder::execute_cli
             at bootstrap/builder.rs:561
  17: bootstrap::Build::build
             at bootstrap/lib.rs:479
  18: bootstrap::main
             at bootstrap/bin/main.rs:29
  19: std::rt::lang_start::{{closure}}
             at libstd/rt.rs:74
  20: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  21: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  22: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  23: std::rt::lang_start
             at libstd/rt.rs:74
  24: main
  25: __libc_start_main
  26: _start
failed to run: /home/vext01/source/rust/build/bootstrap/debug/bootstrap build --config .buildbot.toml --stage 1 src/libtest
Build completed unsuccessfully in 0:09:54

My config.toml:

[rust]
codegen-units = 0
debuginfo = true

[target.x86_64-unknown-linux-gnu]
llvm-config = "/opt/llvm/bin/llvm-config"

I'm using Debian 9.

I'll try to get a fix, but I'm no LLVM expert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions