Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: Update to 1.61.0 #11700

Merged
merged 1 commit into from
May 28, 2022
Merged

rust: Update to 1.61.0 #11700

merged 1 commit into from
May 28, 2022

Conversation

filnet
Copy link
Contributor

@filnet filnet commented May 22, 2022

No description provided.

@filnet
Copy link
Contributor Author

filnet commented May 22, 2022

Strange...
I forgot to update the sha for the source package and everything fails as expected except CLANG32 which succeeded.

@lazka
Copy link
Member

lazka commented May 22, 2022

I forgot to update the sha for the source package and everything fails as expected except CLANG32 which succeeded.

there is no rust in clang32, so the job doesn't do anything.

@filnet filnet force-pushed the rust branch 2 times, most recently from d243516 to 22f52b1 Compare May 22, 2022 14:25
@mati865
Copy link
Collaborator

mati865 commented May 22, 2022

I think you will at least need to disable static-libstdcpp to make it build.

@filnet
Copy link
Contributor Author

filnet commented May 22, 2022

Error on CLANG64

error: failed to run custom build command for `rustc_llvm v0.0.0 (C:\_\mingw-w64-rust\src\rustc-1.61.0-src\compiler\rustc_llvm)`
  
  Caused by:
    process didn't exit successfully: `C:\_\mingw-w64-rust\src\CLANG64\build\x86_64-pc-windows-gnu\stage0-rustc\release\build\rustc_llvm-de27bedb70146f02\build-script-build` (exit code: 101)
    --- stdout
    cargo:rerun-if-env-changed=RUST_CHECK
    cargo:rerun-if-env-changed=REAL_LIBRARY_PATH_VAR
    cargo:rerun-if-env-changed=REAL_LIBRARY_PATH
    cargo:rerun-if-env-changed=LLVM_CONFIG
    cargo:rerun-if-changed=D:/M/msys64/clang64/bin/llvm-config.exe
    cargo:rustc-cfg=llvm_component="aarch64"
    cargo:rustc-cfg=llvm_component="amdgpu"
    cargo:rustc-cfg=llvm_component="asmparser"
    cargo:rustc-cfg=llvm_component="bitreader"
    cargo:rustc-cfg=llvm_component="bitwriter"
    cargo:rustc-cfg=llvm_component="coverage"
    cargo:rustc-cfg=llvm_component="instrumentation"
    cargo:rustc-cfg=llvm_component="ipo"
    cargo:rustc-cfg=llvm_component="linker"
    cargo:rustc-cfg=llvm_component="lto"
    cargo:rustc-cfg=llvm_component="webassembly"
    cargo:rustc-cfg=llvm_component="x86"
    cargo:rerun-if-env-changed=LLVM_RUSTLLVM
    cargo:rerun-if-env-changed=LLVM_NDEBUG
    cargo:rerun-if-changed=llvm-wrapper\RustWrapper.cpp
    cargo:rerun-if-changed=llvm-wrapper\README
    cargo:rerun-if-changed=llvm-wrapper\PassWrapper.cpp
    cargo:rerun-if-changed=llvm-wrapper\LLVMWrapper.h
    cargo:rerun-if-changed=llvm-wrapper\Linker.cpp
    cargo:rerun-if-changed=llvm-wrapper\CoverageMappingWrapper.cpp
    cargo:rerun-if-changed=llvm-wrapper\ArchiveWrapper.cpp
    cargo:rerun-if-changed=llvm-wrapper\.editorconfig
    TARGET = Some("x86_64-pc-windows-gnu")
    OPT_LEVEL = Some("3")
    HOST = Some("x86_64-pc-windows-gnu")
    CXX_x86_64-pc-windows-gnu = Some("clang++")
    CXXFLAGS_x86_64-pc-windows-gnu = Some("-ffunction-sections -fdata-sections --target=x86_64-pc-windows-gnu -march=x86-64 -mtune=generic -pipe")
    CRATE_CC_NO_DEFAULTS = None
  
    --- stderr
    thread 'main' panicked at 'assertion failed: !cxxflags.contains(\"stdlib=libc++\")', compiler\rustc_llvm\build.rs:351:13
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  warning: build failed, waiting for other jobs to finish...
  error: build failed
  command did not execute successfully: "\\\\?\\C:\\_\\mingw-w64-rust\\src\\CLANG64\\build\\x86_64-pc-windows-gnu\\stage0\\bin\\cargo.exe" "build" "--target" "x86_64-pc-windows-gnu" "-Zbinary-dep-depinfo" "-j" "2" "-v" "--release" "--color" "always" "--features" "llvm max_level_info" "--manifest-path" "C:\\_\\mingw-w64-rust\\src\\rustc-1.61.0-src\\compiler/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
  expected success, got: exit code: 101
  Traceback (most recent call last):
    File "C:\_\mingw-w64-rust\src\rustc-1.61.0-src\x.py", line 27, in <module>
      bootstrap.main()
    File "C:/_/mingw-w64-rust/src/rustc-1.61.0-src/src/bootstrap/bootstrap.py", line 1330, in main
      bootstrap(help_triggered)
    File "C:/_/mingw-w64-rust/src/rustc-1.61.0-src/src/bootstrap/bootstrap.py", line 1316, in bootstrap
      run(args, env=env, verbose=build.verbose, is_bootstrap=True)
    File "C:/_/mingw-w64-rust/src/rustc-1.61.0-src/src/bootstrap/bootstrap.py", line 185, in run
      raise RuntimeError(err)
  RuntimeError: failed to run: C:/_/mingw-w64-rust/src/CLANG64/build/bootstrap/debug/bootstrap build --verbose --stage 2
  ==> ERROR: A failure occurred in build().
      Aborting...

@filnet
Copy link
Contributor Author

filnet commented May 22, 2022

Error on MINGW64

 thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler\rustc_metadata\src\native_libs.rs:386:74
  stack backtrace:
     0:     0x7ff8d4902636 - std::backtrace_rs::backtrace::trace_unsynchronized::h3cb9fa0b4eb9649b
     1:     0x7ff8d49359b6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h65c026da46caf570
     2:     0x7ff8d49a1e2b - core::fmt::write::hfbd8b4ae8d1d8261
     3:     0x7ff8d492e0a3 - std::io::Write::write_fmt::h51a571397dfc95e2
     4:     0x7ff8d491c4f7 - std::panicking::default_hook::{{closure}}::h6239a46f99031682
     5:     0x7ff8d491c139 - std::panicking::default_hook::hcac462487509d5df
     6:     0x7ff8ac676636 - rustc_driver[ddc4f3ba51bdc44f]::DEFAULT_HOOK::{closure#0}::{closure#0}
     7:     0x7ff8d491ce53 - std::panicking::rust_panic_with_hook::h4e8678b6d74de03a
     8:     0x7ff8d4935db7 - std::panicking::begin_panic_handler::{{closure}}::hd1f47aae2c8008e1
     9:     0x7ff8d4935ae7 - std::sys_common::backtrace::__rust_end_short_backtrace::h2b2de33c83651502
    10:     0x7ff8d491c992 - rust_begin_unwind
    11:     0x7ff8d49a5ff5 - core::panicking::panic_fmt::he9ec58019eef6ddb
    12:     0x7ff8d49a5e3c - core::panicking::panic::h456a135f33f4e076
    13:     0x7ff8ae354939 - <alloc[724c5fba744dfcfc]::vec::drain_filter::DrainFilter<rustc_session[70f13f7fb85729a0]::cstore::NativeLib, <rustc_metadata[c75917afec703090]::native_libs::Collector>::process_command_line::{closure#2}> as core[b46926f3a58ba61]::iter::traits::iterator::Iterator>::next
    14:     0x7ff8ae3f00ab - <alloc[724c5fba744dfcfc]::vec::Vec<rustc_session[70f13f7fb85729a0]::cstore::NativeLib> as alloc[724c5fba744dfcfc]::vec::spec_from_iter::SpecFromIter<rustc_session[70f13f7fb85729a0]::cstore::NativeLib, alloc[724c5fba744dfcfc]::vec::drain_filter::DrainFilter<rustc_session[70f13f7fb85729a0]::cstore::NativeLib, <rustc_metadata[c75917afec703090]::native_libs::Collector>::process_command_line::{closure#2}>>>::from_iter
    15:     0x7ff8ae43cfee - rustc_metadata[c75917afec703090]::native_libs::collect
    16:     0x7ff8ae412f17 - <rustc_metadata[c75917afec703090]::rmeta::decoder::cstore_impl::provide::{closure#5} as core[b46926f3a58ba61]::ops::function::FnOnce<(rustc_middle[eaeac80584ece6a4]::ty::context::TyCtxt, rustc_span[f371218bcd00efc5]::def_id::CrateNum)>>::call_once
    17:     0x7ff8adac1613 - rustc_query_system[440b8cd36ab51988]::query::plumbing::try_execute_query::<rustc_query_impl[428a825d9a5ae547]::plumbing::QueryCtxt, rustc_query_system[440b8cd36ab51988]::query::caches::ArenaCache<rustc_span[f371218bcd00efc5]::def_id::CrateNum, alloc[724c5fba744dfcfc]::vec::Vec<rustc_session[70f13f7fb85729a0]::cstore::NativeLib>>>
    18:     0x7ff8adbfafb5 - rustc_query_system[440b8cd36ab51988]::query::plumbing::get_query::<rustc_query_impl[428a825d9a5ae547]::queries::native_libraries, rustc_query_impl[428a825d9a5ae547]::plumbing::QueryCtxt>
    19:     0x7ff8ae2feb0f - <rustc_metadata[c75917afec703090]::rmeta::encoder::EncodeContext>::encode_crate_root
    20:     0x7ff8ae313d4d - rustc_metadata[c75917afec703090]::rmeta::encoder::encode_metadata_impl
    21:     0x7ff8ae40ee39 - rustc_data_structures[c2a2b29f8eb69237]::sync::join::<rustc_metadata[c75917afec703090]::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata[c75917afec703090]::rmeta::encoder::encode_metadata::{closure#1}, rustc_metadata[c75917afec703090]::rmeta::encoder::EncodedMetadata, ()>
    22:     0x7ff8ae31335b - rustc_metadata[c75917afec703090]::rmeta::encoder::encode_metadata
    23:     0x7ff8ac789cc0 - <rustc_interface[34867592904978ed]::passes::QueryContext>::enter::<<rustc_interface[34867592904978ed]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[b46926f3a58ba61]::result::Result<alloc[724c5fba744dfcfc]::boxed::Box<dyn core[b46926f3a58ba61]::any::Any>, rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>>
    24:     0x7ff8ac83b421 - <rustc_interface[34867592904978ed]::queries::Queries>::ongoing_codegen
    25:     0x7ff8ac6aaa04 - <rustc_interface[34867592904978ed]::interface::Compiler>::enter::<rustc_driver[ddc4f3ba51bdc44f]::run_compiler::{closure#1}::{closure#2}, core[b46926f3a58ba61]::result::Result<core[b46926f3a58ba61]::option::Option<rustc_interface[34867592904978ed]::queries::Linker>, rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>>
    26:     0x7ff8ac632119 - rustc_span[f371218bcd00efc5]::with_source_map::<core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>, rustc_interface[34867592904978ed]::interface::create_compiler_and_run<core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>, rustc_driver[ddc4f3ba51bdc44f]::run_compiler::{closure#1}>::{closure#1}>
    27:     0x7ff8ac6a98f0 - rustc_interface[34867592904978ed]::interface::create_compiler_and_run::<core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>, rustc_driver[ddc4f3ba51bdc44f]::run_compiler::{closure#1}>
    28:     0x7ff8ac62eee0 - <scoped_tls[5f0ff43c88f47810]::ScopedKey<rustc_span[f371218bcd00efc5]::SessionGlobals>>::set::<rustc_interface[34867592904978ed]::interface::run_compiler<core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>, rustc_driver[ddc4f3ba51bdc44f]::run_compiler::{closure#1}>::{closure#0}, core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>>
    29:     0x7ff8ac6904a6 - std[eb09d43dfca15b52]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[34867592904978ed]::util::run_in_thread_pool_with_globals<rustc_interface[34867592904978ed]::interface::run_compiler<core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>, rustc_driver[ddc4f3ba51bdc44f]::run_compiler::{closure#1}>::{closure#0}, core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>>::{closure#0}, core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>>
    30:     0x7ff8ac635bd7 - <<std[eb09d43dfca15b52]::thread::Builder>::spawn_unchecked_<rustc_interface[34867592904978ed]::util::run_in_thread_pool_with_globals<rustc_interface[34867592904978ed]::interface::run_compiler<core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>, rustc_driver[ddc4f3ba51bdc44f]::run_compiler::{closure#1}>::{closure#0}, core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>>::{closure#0}, core[b46926f3a58ba61]::result::Result<(), rustc_errors[be9326e5c57961e0]::ErrorGuaranteed>>::{closure#1} as core[b46926f3a58ba61]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
    31:     0x7ff8d4936ad7 - std::sys::windows::thread::Thread::new::thread_start::h5ae94f48bf461847
    32:     0x7ff8eb8c4ed0 - <unknown>
    33:     0x7ff8ecf2e39b - <unknown>
  
  error: internal compiler error: unexpected panic
  
  note: the compiler unexpectedly panicked. this is a bug.
  
  note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
  
  note: rustc 1.61.0 running on x86_64-pc-windows-gnu
  
  note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C linker=gcc -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -Z tls-model=initial-exec -Z unstable-options -C prefer-dynamic -Z binary-dep-depinfo -Z force-unstable-if-unmarked
  
  note: some of the compiler flags provided by cargo are hidden
  
  Did not run successfully: exit code: 0x80000003
  
  "C:\\_\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage1\\bin\\rustc.exe" "--crate-name" "rustc_llvm" "--edition=2021" "compiler\\rustc_llvm\\src\\lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "opt-level=3" "-C" "embed-bitcode=no" "-C" "debuginfo=0" "-C" "metadata=faaaa3f518e5040d" "-C" "extra-filename=-faaaa3f518e5040d" "--out-dir" "C:\\_\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps" "--target" "x86_64-pc-windows-gnu" "-C" "linker=gcc" "-L" "dependency=C:\\_\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-L" "dependency=C:\\_\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\release\\deps" "--extern" "libc=C:\\_\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\deps\\liblibc-67302588d96e19e1.rmeta" "-Csymbol-mangling-version=v0" "-Zunstable-options" "--check-cfg=names()" "--check-cfg=values()" "--check-cfg=values(bootstrap)" "--check-cfg=values(parallel_compiler)" "--check-cfg=values(no_btreemap_remove_entry)" "--check-cfg=values(crossbeam_loom)" "--check-cfg=values(span_locations)" "-Zmacro-backtrace" "-Ztls-model=initial-exec" "-Zunstable-options" "-Wrustc::internal" "-Cprefer-dynamic" "-Z" "binary-dep-depinfo" "-L" "native=C:\\_\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage1-rustc\\x86_64-pc-windows-gnu\\release\\build\\rustc_llvm-bcb4b05243305d50\\out" "-L" "native=D:/M/msys64/mingw64/lib" "-L" "native=D:/M/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../lib" "--cfg" "llvm_component=\"aarch64\"" "--cfg" "llvm_component=\"amdgpu\"" "--cfg" "llvm_component=\"arm\"" "--cfg" "llvm_component=\"asmparser\"" "--cfg" "llvm_component=\"avr\"" "--cfg" "llvm_component=\"bitreader\"" "--cfg" "llvm_component=\"bitwriter\"" "--cfg" "llvm_component=\"bpf\"" "--cfg" "llvm_component=\"coverage\"" "--cfg" "llvm_component=\"instrumentation\"" "--cfg" "llvm_component=\"ipo\"" "--cfg" "llvm_component=\"linker\"" "--cfg" "llvm_component=\"lto\"" "--cfg" "llvm_component=\"mips\"" "--cfg" "llvm_component=\"msp430\"" "--cfg" "llvm_component=\"nvptx\"" "--cfg" "llvm_component=\"riscv\"" "--cfg" "llvm_component=\"webassembly\"" "--cfg" "llvm_component=\"x86\"" "-l" "static=llvm-wrapper" "-l" "static=LLVMX86TargetMCA" "-l" "static=LLVMX86Disassembler" "-l" "static=LLVMX86AsmParser" "-l" "static=LLVMX86CodeGen" "-l" "static=LLVMX86Desc" "-l" "static=LLVMX86Info" "-l" "static=LLVMWebAssemblyDisassembler" "-l" "static=LLVMWebAssemblyAsmParser" "-l" "static=LLVMWebAssemblyCodeGen" "-l" "static=LLVMWebAssemblyDesc" "-l" "static=LLVMWebAssemblyUtils" "-l" "static=LLVMWebAssemblyInfo" "-l" "static=LLVMRISCVDisassembler" "-l" "static=LLVMRISCVAsmParser" "-l" "static=LLVMRISCVCodeGen" "-l" "static=LLVMRISCVDesc" "-l" "static=LLVMRISCVInfo" "-l" "static=LLVMNVPTXCodeGen" "-l" "static=LLVMNVPTXDesc" "-l" "static=LLVMNVPTXInfo" "-l" "static=LLVMMSP430Disassembler" "-l" "static=LLVMMSP430AsmParser" "-l" "static=LLVMMSP430CodeGen" "-l" "static=LLVMMSP430Desc" "-l" "static=LLVMMSP430Info" "-l" "static=LLVMMipsDisassembler" "-l" "static=LLVMMipsAsmParser" "-l" "static=LLVMMipsCodeGen" "-l" "static=LLVMMipsDesc" "-l" "static=LLVMMipsInfo" "-l" "static=LLVMLTO" "-l" "static=LLVMExtensions" "-l" "static=LLVMCoverage" "-l" "static=LLVMBPFDisassembler" "-l" "static=LLVMBPFAsmParser" "-l" "static=LLVMBPFCodeGen" "-l" "static=LLVMBPFDesc" "-l" "static=LLVMBPFInfo" "-l" "static=LLVMAVRDisassembler" "-l" "static=LLVMAVRAsmParser" "-l" "static=LLVMAVRCodeGen" "-l" "static=LLVMAVRDesc" "-l" "static=LLVMAVRInfo" "-l" "static=LLVMARMDisassembler" "-l" "static=LLVMARMAsmParser" "-l" "static=LLVMARMCodeGen" "-l" "static=LLVMARMDesc" "-l" "static=LLVMARMUtils" "-l" "static=LLVMARMInfo" "-l" "static=LLVMAMDGPUTargetMCA" "-l" "static=LLVMMCA" "-l" "static=LLVMAMDGPUDisassembler" "-l" "static=LLVMAMDGPUAsmParser" "-l" "static=LLVMAMDGPUCodeGen" "-l" "static=LLVMMIRParser" "-l" "static=LLVMAMDGPUDesc" "-l" "static=LLVMAMDGPUUtils" "-l" "static=LLVMAMDGPUInfo" "-l" "static=LLVMPasses" "-l" "static=LLVMObjCARCOpts" "-l" "static=LLVMCoroutines" "-l" "static=LLVMipo" "-l" "static=LLVMInstrumentation" "-l" "static=LLVMVectorize" "-l" "static=LLVMLinker" "-l" "static=LLVMIRReader" "-l" "static=LLVMAsmParser" "-l" "static=LLVMFrontendOpenMP" "-l" "static=LLVMAArch64Disassembler" "-l" "static=LLVMMCDisassembler" "-l" "static=LLVMAArch64AsmParser" "-l" "static=LLVMAArch64CodeGen" "-l" "static=LLVMCFGuard" "-l" "static=LLVMGlobalISel" "-l" "static=LLVMSelectionDAG" "-l" "static=LLVMAsmPrinter" "-l" "static=LLVMDebugInfoMSF" "-l" "static=LLVMCodeGen" "-l" "static=LLVMTarget" "-l" "static=LLVMScalarOpts" "-l" "static=LLVMInstCombine" "-l" "static=LLVMAggressiveInstCombine" "-l" "static=LLVMTransformUtils" "-l" "static=LLVMBitWriter" "-l" "static=LLVMAnalysis" "-l" "static=LLVMProfileData" "-l" "static=LLVMDebugInfoDWARF" "-l" "static=LLVMObject" "-l" "static=LLVMTextAPI" "-l" "static=LLVMMCParser" "-l" "static=LLVMBitReader" "-l" "static=LLVMCore" "-l" "static=LLVMRemarks" "-l" "static=LLVMBitstreamReader" "-l" "static=LLVMAArch64Desc" "-l" "static=LLVMAArch64Utils" "-l" "static=LLVMAArch64Info" "-l" "static=LLVMMC" "-l" "static=LLVMDebugInfoCodeView" "-l" "static=LLVMBinaryFormat" "-l" "static=LLVMSupport" "-l" "static=LLVMDemangle" "-l" "dylib=psapi" "-l" "dylib=shell32" "-l" "dylib=ole32" "-l" "dylib=uuid" "-l" "dylib=advapi32" "-l" "dylib=pthread" "-l" "dylib=z" "-l" "dylib=xml2" "-l" "static:-bundle=stdc++" "-l" "static:-bundle=ffi" "-l" "static:-bundle=pthread" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Wsemicolon_in_expressions_from_macros" "-Dwarnings" "--sysroot" "C:\\_\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage1" "-Z" "force-unstable-if-unmarked"
  -------------
  query stack during panic:
  #0 [native_libraries] looking up the native libraries of a linked crate
  end of query stack
  error: could not compile `rustc_llvm`
  
  Caused by:
    process didn't exit successfully: `C:\_\mingw-w64-rust\src\MINGW64\build\bootstrap\debug\rustc --crate-name rustc_llvm --edition=2021 'compiler\rustc_llvm\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C metadata=faaaa3f518e5040d -C extra-filename=-faaaa3f518e5040d --out-dir 'C:\_\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu\stage1-rustc\x86_64-pc-windows-gnu\release\deps' --target x86_64-pc-windows-gnu -C linker=gcc -L 'dependency=C:\_\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu\stage1-rustc\x86_64-pc-windows-gnu\release\deps' -L 'dependency=C:\_\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu\stage1-rustc\release\deps' --extern 'libc=C:\_\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu\stage1-rustc\x86_64-pc-windows-gnu\release\deps\liblibc-67302588d96e19e1.rmeta' -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=names()' '--check-cfg=values()' '--check-cfg=values(bootstrap)' '--check-cfg=values(parallel_compiler)' '--check-cfg=values(no_btreemap_remove_entry)' '--check-cfg=values(crossbeam_loom)' '--check-cfg=values(span_locations)' -Zmacro-backtrace -Ztls-model=initial-exec -Zunstable-options '-Wrustc::internal' -Cprefer-dynamic -Z binary-dep-depinfo -L 'native=C:\_\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu\stage1-rustc\x86_64-pc-windows-gnu\release\build\rustc_llvm-bcb4b05243305d50\out' -L 'native=D:/M/msys64/mingw64/lib' -L 'native=D:/M/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../lib' --cfg 'llvm_component="aarch64"' --cfg 'llvm_component="amdgpu"' --cfg 'llvm_component="arm"' --cfg 'llvm_component="asmparser"' --cfg 'llvm_component="avr"' --cfg 'llvm_component="bitreader"' --cfg 'llvm_component="bitwriter"' --cfg 'llvm_component="bpf"' --cfg 'llvm_component="coverage"' --cfg 'llvm_component="instrumentation"' --cfg 'llvm_component="ipo"' --cfg 'llvm_component="linker"' --cfg 'llvm_component="lto"' --cfg 'llvm_component="mips"' --cfg 'llvm_component="msp430"' --cfg 'llvm_component="nvptx"' --cfg 'llvm_component="riscv"' --cfg 'llvm_component="webassembly"' --cfg 'llvm_component="x86"' -l static=llvm-wrapper -l static=LLVMX86TargetMCA -l static=LLVMX86Disassembler -l static=LLVMX86AsmParser -l static=LLVMX86CodeGen -l static=LLVMX86Desc -l static=LLVMX86Info -l static=LLVMWebAssemblyDisassembler -l static=LLVMWebAssemblyAsmParser -l static=LLVMWebAssemblyCodeGen -l static=LLVMWebAssemblyDesc -l static=LLVMWebAssemblyUtils -l static=LLVMWebAssemblyInfo -l static=LLVMRISCVDisassembler -l static=LLVMRISCVAsmParser -l static=LLVMRISCVCodeGen -l static=LLVMRISCVDesc -l static=LLVMRISCVInfo -l static=LLVMNVPTXCodeGen -l static=LLVMNVPTXDesc -l static=LLVMNVPTXInfo -l static=LLVMMSP430Disassembler -l static=LLVMMSP430AsmParser -l static=LLVMMSP430CodeGen -l static=LLVMMSP430Desc -l static=LLVMMSP430Info -l static=LLVMMipsDisassembler -l static=LLVMMipsAsmParser -l static=LLVMMipsCodeGen -l static=LLVMMipsDesc -l static=LLVMMipsInfo -l static=LLVMLTO -l static=LLVMExtensions -l static=LLVMCoverage -l static=LLVMBPFDisassembler -l static=LLVMBPFAsmParser -l static=LLVMBPFCodeGen -l static=LLVMBPFDesc -l static=LLVMBPFInfo -l static=LLVMAVRDisassembler -l static=LLVMAVRAsmParser -l static=LLVMAVRCodeGen -l static=LLVMAVRDesc -l static=LLVMAVRInfo -l static=LLVMARMDisassembler -l static=LLVMARMAsmParser -l static=LLVMARMCodeGen -l static=LLVMARMDesc -l static=LLVMARMUtils -l static=LLVMARMInfo -l static=LLVMAMDGPUTargetMCA -l static=LLVMMCA -l static=LLVMAMDGPUDisassembler -l static=LLVMAMDGPUAsmParser -l static=LLVMAMDGPUCodeGen -l static=LLVMMIRParser -l static=LLVMAMDGPUDesc -l static=LLVMAMDGPUUtils -l static=LLVMAMDGPUInfo -l static=LLVMPasses -l static=LLVMObjCARCOpts -l static=LLVMCoroutines -l static=LLVMipo -l static=LLVMInstrumentation -l static=LLVMVectorize -l static=LLVMLinker -l static=LLVMIRReader -l static=LLVMAsmParser -l static=LLVMFrontendOpenMP -l static=LLVMAArch64Disassembler -l static=LLVMMCDisassembler -l static=LLVMAArch64AsmParser -l static=LLVMAArch64CodeGen -l static=LLVMCFGuard -l static=LLVMGlobalISel -l static=LLVMSelectionDAG -l static=LLVMAsmPrinter -l static=LLVMDebugInfoMSF -l static=LLVMCodeGen -l static=LLVMTarget -l static=LLVMScalarOpts -l static=LLVMInstCombine -l static=LLVMAggressiveInstCombine -l static=LLVMTransformUtils -l static=LLVMBitWriter -l static=LLVMAnalysis -l static=LLVMProfileData -l static=LLVMDebugInfoDWARF -l static=LLVMObject -l static=LLVMTextAPI -l static=LLVMMCParser -l static=LLVMBitReader -l static=LLVMCore -l static=LLVMRemarks -l static=LLVMBitstreamReader -l static=LLVMAArch64Desc -l static=LLVMAArch64Utils -l static=LLVMAArch64Info -l static=LLVMMC -l static=LLVMDebugInfoCodeView -l static=LLVMBinaryFormat -l static=LLVMSupport -l static=LLVMDemangle -l dylib=psapi -l dylib=shell32 -l dylib=ole32 -l dylib=uuid -l dylib=advapi32 -l dylib=pthread -l dylib=z -l dylib=xml2 -l 'static:-bundle=stdc++' -l 'static:-bundle=ffi' -l 'static:-bundle=pthread'` (exit code: 0x80000003)
  warning: build failed, waiting for other jobs to finish...
  error: build failed
  command did not execute successfully: "\\\\?\\C:\\_\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage0\\bin\\cargo.exe" "build" "--target" "x86_64-pc-windows-gnu" "-Zbinary-dep-depinfo" "-j" "2" "-v" "--release" "--color" "always" "--features" "llvm max_level_info" "--manifest-path" "C:\\_\\mingw-w64-rust\\src\\rustc-1.61.0-src\\compiler/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
  expected success, got: exit code: 101
  Traceback (most recent call last):
    File "C:\_\mingw-w64-rust\src\rustc-1.61.0-src\x.py", line 27, in <module>
      bootstrap.main()
    File "C:/_/mingw-w64-rust/src/rustc-1.61.0-src/src/bootstrap/bootstrap.py", line 1324, in main
      bootstrap(help_triggered)
    File "C:/_/mingw-w64-rust/src/rustc-1.61.0-src/src/bootstrap/bootstrap.py", line 1310, in bootstrap
      run(args, env=env, verbose=build.verbose, is_bootstrap=True)
    File "C:/_/mingw-w64-rust/src/rustc-1.61.0-src/src/bootstrap/bootstrap.py", line 185, in run
      raise RuntimeError(err)
  RuntimeError: failed to run: C:/_/mingw-w64-rust/src/MINGW64/build/bootstrap/debug/bootstrap build --verbose --stage 2
  ==> ERROR: A failure occurred in build().
      Aborting...
  ==> Removing installed dependencies...
  checking dependencies...

@filnet
Copy link
Contributor Author

filnet commented May 22, 2022

I think you will at least need to disable static-libstdcpp to make it build.

Disabling llvm-static-stdcpp was enough for clang.

@filnet
Copy link
Contributor Author

filnet commented May 22, 2022

The mingw build fails when building rustc_llvm when processing the libs passed on the rustc command line.
It fails here : https://github.com/filnet/rust/blob/master/compiler/rustc_metadata/src/native_libs.rs#L422

It chokes on some part of -l dylib=pthread -l 'static:-bundle=pthread'

The test on modifiers was added by rust-lang/rust@1004783

@filnet
Copy link
Contributor Author

filnet commented May 22, 2022

It is the -bundle which ends up setting the bundle to Some(false) in NativeLibKind::Static.
The test that triggers the runtime error is expecting None.

@mati865
Copy link
Collaborator

mati865 commented May 22, 2022

I believe -l dylib=pthread is the problem here and it comes from:

$ llvm-config --link-static --system-libs
-lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lpthread -lz -lxml2

I think disabling this chunk:

                            if lib.has_modifiers() || passed_lib.has_modifiers() {
                                self.tcx.sess.span_err(
                                    self.tcx.def_span(lib.foreign_module.unwrap()),
                                    "overriding linking modifiers from command line is not supported"
                                );
                            }

would work as a very ugly workaround. I'll look for a fix or better workaround sometime this week.

EDIT:
On second thought just disabling manual linking of LLVM dependencies when using llvm-config from the system should be the way to go.

@filnet
Copy link
Contributor Author

filnet commented May 22, 2022

rust-lang/rust#97299

@filnet filnet force-pushed the rust branch 2 times, most recently from 8291788 to afba330 Compare May 23, 2022 23:29
@filnet
Copy link
Contributor Author

filnet commented May 23, 2022

Is it ok that the -lpthread from llvm_config becomes -l dylib=pthread ?
I think it is possible to tell rust to use static link instead of shared link.
See https://github.com/rust-lang/rust/blob/1.61.0/compiler/rustc_llvm/build.rs#L7

And the -l 'static:-bundle=pthread' part comes from https://github.com/rust-lang/rust/blob/1.61.0/compiler/rustc_llvm/build.rs#L369

@filnet
Copy link
Contributor Author

filnet commented May 24, 2022

I pushed a patch that ignores pthread from the output of llvm-config when building compiler/rustc_llvm.
Seems to do the trick.

@mati865
Copy link
Collaborator

mati865 commented May 25, 2022

And the -l 'static:-bundle=pthread' part comes from https://github.com/rust-lang/rust/blob/1.61.0/compiler/rustc_llvm/build.rs#L369

I think we disable this line for Clang subsystems anyway so we could do the same for GCC.

I think it is possible to tell rust to use static link instead of shared link.

For our use case linking shared pthread library would be preferable. It's only for linking Rust and doesn't affect binaries built with Rust.

@filnet
Copy link
Contributor Author

filnet commented May 25, 2022

And the -l 'static:-bundle=pthread' part comes from https://github.com/rust-lang/rust/blob/1.61.0/compiler/rustc_llvm/build.rs#L369

I think we disable this line for Clang subsystems anyway so we could do the same for GCC.

Actually we add ffi for all systems : https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-rust/0001-add-missing-libs.patch

I think it is possible to tell rust to use static link instead of shared link.

For our use case linking shared pthread library would be preferable. It's only for linking Rust and doesn't affect binaries built with Rust.
Ok. That explains. Thanks.

So, do we want to go with the proposed fix ?

@mati865
Copy link
Collaborator

mati865 commented May 25, 2022

Actually we add ffi for all systems : https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-rust/0001-add-missing-libs.patch

I think it shouldn't be necessary since couple Rust releases because now it asks llvm-config for system libs.

So, do we want to go with the proposed fix ?

I don't mind merging what is in this PR either.

@filnet
Copy link
Contributor Author

filnet commented May 26, 2022

Actually we add ffi for all systems : https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-rust/0001-add-missing-libs.patch

I think it shouldn't be necessary since couple Rust releases because now it asks llvm-config for system libs.

I'll take a look at cleaning up this patch.

EDIT : just to confirm, we should continue adding ffi as it is not provided by llvm-config and remove pthread from compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs ?

@filnet filnet changed the title rust: Update to 1.61.0 [WIP] rust: Update to 1.61.0 May 26, 2022
@mati865
Copy link
Collaborator

mati865 commented May 26, 2022

Oof, I thought I was fixed already but apparently not:

$ llvm-config --system-libs --link-static
-lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lpthread -lz -lxml2

So yeah, we have to keep adding -lffi until it gets fixed.

@filnet filnet force-pushed the rust branch 2 times, most recently from bcd5d25 to cbc0e3c Compare May 26, 2022 23:09
Fixes a number of issues in compiler/rustc_llvm regarding lib handling.
This is a moving part in current rust releases...

- Disabled llvm-static-stdcpp
Fixes CLANG64 build error:
    thread 'main' panicked at 'assertion failed: !cxxflags.contains(\"stdlib=libc++\")', compiler\rustc_llvm\build.rs:351:13
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

- Removed `pthread` from forced libs in compiler/rustc_llvm/build.rs
`pthread` is also provided by llvm-config and having both now triggers an error about mixed link modifiers.
See rust-lang/rust#97299

    $ llvm-config --system-libs --link-static
    -lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lpthread -lz -lxml2

Note that `ffi` is still forced by the patch as llvm-config does not provide it.
See 0001-rustc-llvm-fix-libs.patch (replaces 0001-add-missing-libs.patch).

- Rebased 0007-clang-subsystem.patch
@filnet
Copy link
Contributor Author

filnet commented May 27, 2022

Fixes a number of issues in compiler/rustc_llvm regarding lib handling.
This is a moving part in current rust releases...

  • Disabled llvm-static-stdcpp
    Fixes CLANG64 build error:
    thread 'main' panicked at 'assertion failed: !cxxflags.contains(\"stdlib=libc++\")', compiler\rustc_llvm\build.rs:351:13
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    $ llvm-config --system-libs --link-static
    -lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lpthread -lz -lxml2

Note that ffi is still forced by the patch as llvm-config does not provide it.
See 0001-rustc-llvm-fix-libs.patch (replaces 0001-add-missing-libs.patch).

  • Rebased 0007-clang-subsystem.patch

@filnet filnet changed the title [WIP] rust: Update to 1.61.0 rust: Update to 1.61.0 May 27, 2022
@filnet
Copy link
Contributor Author

filnet commented May 27, 2022

Tested the MINGW64 build. Looks good.

@lazka lazka merged commit 344b6ae into msys2:master May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants