-
Notifications
You must be signed in to change notification settings - Fork 13.4k
couldn't load codegen backend on windows-gnu #61561
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
i found that, unlike stage0, in stage1 not copy following 3 files: libgcc_s_seh-1.dll C:>dumpbin /dependents C:\msys64\work\rust\build\x86_64-pc-windows-gnu\st Dump of file C:\msys64\work\rust\build\x86_64-pc-windows-gnu\stage1\lib\ File Type: DLL Image has the following dependencies:
Summary
|
replace llvm with old / latest version in my private repo (which works fine 2019-5-18 in another computer), result same error. |
found the reason, latest mingw gcc 9.1.0 cause some missing dll problem. (although, compile rust source was fine). if you have old version msys2, this will works for you: pacman -R mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake ./x.py install |
This issue is not fixed and shouldn't have been closed. |
@mati865 Technically correct, but rust is compiled fine with gcc 8.3 version. |
Ntldd output:
Missing libraries can be found inside Nightly doesn't depend on
|
I had the same issue... and the mingw gcc version is 9.2.0 |
you can install gcc 8.x from here. |
triage: P-high, due to blockage of #63959, until someone can convince me otherwise. |
triage: assigning to self for initial investigation. |
with latest rust and gcc (from ubuntu 19.10), this bug looks like solved. $ ./rustc -vV $ gcc -v $ uname -a |
@sailfish009 it has never affected targets other than windows-gnu. |
One downside of downgrading to gcc 8.3 and cmake 3.14 and building rust source is that I got errors messages similar to: gcc internal compiler error and cmake missing dll, both of which are resolved in the newer versions. There are workarounds and backports of the fixes, but it would be a lot easier to be able to just use the latest version of gcc. |
visiting for triage. Being honest (with myself and you): I just can't allocate time/resources to this bug. (It does not help that Windows is not a primary nor secondary dev platform for me.) Unassigning self and will post request for windows-dev to take this on |
OK, so after a bit of debugging, here's what going on:
|
As a workaround, you can copy the newer MinGW dlls from |
…lexcrichton Statically link libstdc++ on windows-gnu Fixes rust-lang#61561 by not shipping `libstdc++-6.dll` which can conflict with the GCC.
…lexcrichton Statically link libstdc++ on windows-gnu Fixes rust-lang#61561 by not shipping `libstdc++-6.dll` which can conflict with the GCC.
win7_64 msys64
$ ./x.py install
Updating only changed submodules
Submodules updated in 1.12 seconds
Finished dev [unoptimized] target(s) in 1.98s
Building stage0 std artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
Finished release [optimized] target(s) in 1.75s
Copying stage0 std from stage0 (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu / x86_64-pc-windows-gnu)
Building stage0 test artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
Finished release [optimized] target(s) in 0.63s
Copying stage0 test from stage0 (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu / x86_64-pc-windows-gnu)
Building stage0 compiler artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
Finished release [optimized] target(s) in 2.89s
Copying stage0 rustc from stage0 (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu / x86_64-pc-windows-gnu)
Building stage0 codegen artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu, llvm)
warning: In file included from ../rustllvm/rustllvm.h:5,
warning: from ../rustllvm/PassWrapper.cpp:6:
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h: In instantiation of 'llvm::ArrayRef::ArrayRef(const std::initializer_list<_Tp>&) [with T = long long unsigned int]':
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/IR/DIBuilder.h:645:74: required from here
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:102:37: warning: initializing 'llvm::ArrayRef::Data' from 'std::initializer_list::begin' does not extend the lifetime of the underlying array [-Winit-list-lifetime]
warning: 102 | : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),
warning: In file included from ../rustllvm/rustllvm.h:5,
warning: from ../rustllvm/RustWrapper.cpp:1:
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h: In instantiation of 'llvm::ArrayRef::ArrayRef(const std::initializer_list<_Tp>&) [with T = long long unsigned int]':
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/IR/DIBuilder.h:645:74: required from here
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:102:37: warning: initializing 'llvm::ArrayRef::Data' from 'std::initializer_list::begin' does not extend the lifetime of the underlying array [-Winit-list-lifetime]
warning: 102 | : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),
warning: In file included from ../rustllvm/rustllvm.h:5,
warning: from ../rustllvm/ArchiveWrapper.cpp:1:
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h: In instantiation of 'llvm::ArrayRef::ArrayRef(const std::initializer_list<_Tp>&) [with T = long long unsigned int]':
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/IR/DIBuilder.h:645:74: required from here
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:102:37: warning: initializing 'llvm::ArrayRef::Data' from 'std::initializer_list::begin' does not extend the lifetime of the underlying array [-Winit-list-lifetime]
warning: 102 | : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),
warning: In file included from C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/Linker/IRMover.h:13,
warning: from C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/Linker/Linker.h:14,
warning: from ../rustllvm/Linker.cpp:1:
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h: In instantiation of 'llvm::ArrayRef::ArrayRef(const std::initializer_list<_Tp>&) [with T = long long unsigned int]':
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/IR/DIBuilder.h:645:74: required from here
warning: C:/msys64/work/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:102:37: warning: initializing 'llvm::ArrayRef::Data' from 'std::initializer_list::begin' does not extend the lifetime of the underlying array [-Winit-list-lifetime]
warning: 102 | : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),
Finished release [optimized] target(s) in 0.48s
Assembling stage1 compiler (x86_64-pc-windows-gnu)
Building stage1 std artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
Compiling core v0.0.0 (C:\msys64\work\rust\src\libcore)
Compiling compiler_builtins v0.1.15
error: couldn't load codegen backend "C:\msys64\work\rust\build\x86_64-pc-windows-gnu\stage1\lib\rustlib\x86_64-pc-windows-gnu\codegen-backends\rustc_codegen_llvm-llvm.dll": "The specified procedure could not be found. (os error 127)"
error: Could not compile
core
.warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "C:\msys64\work\rust\build\x86_64-pc-windows-gnu\stage0\bin\cargo.exe" "build" "--target" "x86_64-pc-windows-gnu" "-j" "4" "--release" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "C:\msys64\work\rust\src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
failed to run: C:/msys64/work/rust/build/bootstrap/debug/bootstrap install
Build completed unsuccessfully in 0:00:33
The text was updated successfully, but these errors were encountered: