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

missing libstdc++-6.dll in beta-x86_64-pc-windows-gnu (1.41.0-beta.1) #67408

Closed
cuviper opened this issue Dec 18, 2019 · 13 comments · Fixed by #67410
Closed

missing libstdc++-6.dll in beta-x86_64-pc-windows-gnu (1.41.0-beta.1) #67408

cuviper opened this issue Dec 18, 2019 · 13 comments · Fixed by #67410
Labels
C-bug Category: This is a bug. O-windows-gnu Toolchain: GNU, Operating system: Windows P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@cuviper
Copy link
Member

cuviper commented Dec 18, 2019

I saw this failure in rayon CI: https://ci.appveyor.com/project/cuviper/rayon/builds/29634901/job/y7h1kc7w9wsusl8r

info: syncing channel updates for 'beta-x86_64-pc-windows-gnu'
info: latest update on 2019-12-18, rust version 1.41.0-beta.1 (eb3f7c2d3 2019-12-17)
[...]
  beta installed - (error reading rustc version)


Rust is installed now. Great!

To get started you need Cargo's bin directory (%USERPROFILE%.cargo\bin) in your
PATH
environment variable. Future applications will automatically have the
correct environment, but you may need to restart your current shell.
set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
rustc -Vv
Command exited with code -1073741515

I'm on Linux, but I tried this build under Wine:

005b:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\jistone\\.rustup\\toolchains\\beta-x86_64-pc-windows-gnu\\bin\\rustc_driver-2602f879d4c5def3.dll") not found
005b:err:module:import_dll Library rustc_driver-2602f879d4c5def3.dll (which is needed by L"Z:\\home\\jistone\\.rustup\\toolchains\\beta-x86_64-pc-windows-gnu\\bin\\rustc.exe") not found
005b:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\jistone\\.rustup\\toolchains\\beta-x86_64-pc-windows-gnu\\bin\\rustc.exe" failed, status c0000135

It seems @mati865's intention in #65911 was that this should be statically linked, but that was clobbered by #67077 in src/bootstrap/compile.rs at least.

The same error occurs on 1.41.0-nightly (3ed3b8bb7 2019-12-17) (via Wine again for me).

@cuviper cuviper added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. O-windows-gnu Toolchain: GNU, Operating system: Windows labels Dec 18, 2019
@mati865
Copy link
Contributor

mati865 commented Dec 18, 2019

Probably the culprit is here: https://github.com/rust-lang/rust/pull/67077/files#r359557571

@jonas-schievink jonas-schievink added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Dec 18, 2019
@mati865
Copy link
Contributor

mati865 commented Dec 18, 2019

As immediate workaround I suggest adding libstdc++-6.dll to the PATH, it should be installed on most of the Windows CI.

@tan-wei
Copy link

tan-wei commented Dec 19, 2019

@mati865 Thanks! It works.

@pnkfelix
Copy link
Member

triage: P-high, has PR, removing nomination.

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels Dec 19, 2019
@binarycrusader
Copy link
Contributor

binarycrusader commented Dec 19, 2019

As immediate workaround I suggest adding libstdc++-6.dll to the PATH, it should be installed on most of the Windows CI.

Sadly, that didn't work for me:

"The procedure entry point _ZNSt13__future_base12_Result_baseC2Ev could not be located in the dynamic link library C:\Users\xxx\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\bin\rustc_driver-3aaebb9b017b7498.dll."

Just posting as an FYI, not expecting a solution.

Centril added a commit to Centril/rust that referenced this issue Dec 20, 2019
…lacrum

Reenable static linking of libstdc++ on windows-gnu

Fixes rust-lang#67408

Verified locally that `rustc_driver` is now statically linked to libstdc++.
Centril added a commit to Centril/rust that referenced this issue Dec 22, 2019
…lacrum

Reenable static linking of libstdc++ on windows-gnu

Fixes rust-lang#67408

Verified locally that `rustc_driver` is now statically linked to libstdc++.
@bors bors closed this as completed in 35ff2f1 Dec 22, 2019
@mati865
Copy link
Contributor

mati865 commented Dec 27, 2019

FWIW it was fixed in nightly but not yet in beta.

@John-Nagle
Copy link

John-Nagle commented Mar 13, 2022

Did this fix make it into stable? I'm getting that error in rustc 1.59.0 (9d1b210 2022-02-23).

Cross-compiling from Linux: cargo build --target x86_64-pc-windows-gnu --examples

Trying to run under Wine 7.0.

Wine error messages:

0124:err:module:import_dll Library libgcc_s_seh-1.dll (which is needed by L"Z:\\home\\john\\projects\\sl\\SL-test-viewer\\target\\x86_64-pc-windows-gnu\\debug\\examples\\libstdc++-6.dll") not found
0124:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\john\\projects\\sl\\SL-test-viewer\\target\\x86_64-pc-windows-gnu\\debug\\examples\\scenetest.exe") not found
0124:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\john\\projects\\sl\\SL-test-viewer\\target\\x86_64-pc-windows-gnu\\debug\\examples\\scenetest.exe" failed, status c0000135

Please, statically link this stuff.

(Trying to find the correct version of libstdc++-6.dll. MinGW has four different versions. Correct versions seem to be the ones in 9.3.win32)

@mati865
Copy link
Contributor

mati865 commented Mar 13, 2022

Please, statically link this stuff.

It was linked statically in the past, must be regression.
Does it work on other versions for you?

(Trying to find the correct version of libstdc++-6.dll. MinGW has four different versions. Correct versions seem to be the ones in 9.3.win32)

There are 2 versions shipped in Ubuntu: posix and win32. Posix is the correct one.
BTW those libraries come from GCC, not MinGW.

@mati865
Copy link
Contributor

mati865 commented Mar 13, 2022

Upon closer inspection you are not having problem running rustc but with artifacts built with rustc.
In this case this entirely different issue and you need to find which crate in your dependency tree has linked dynamic libstdc++.

@John-Nagle
Copy link

Yes. I was using a deprecated package that pulled in some DLLs. Once I got rid of that package, the problem disappeared.

@hydra
Copy link

hydra commented Mar 28, 2022

Yes. I was using a deprecated package that pulled in some DLLs. Once I got rid of that package, the problem disappeared.

@John-Nagle two questions: 1) how did you find the offending package, 2) which one was it? I'm getting the same thing on rustc 1.61.0-nightly (6a7055661 2022-02-27)

@John-Nagle
Copy link

Looked through the build logs with "grep" for the package name.

@hydra
Copy link

hydra commented Mar 28, 2022

I couldn't find a specific dependency that caused the issue, but upgrading rust from rustc 1.61.0-nightly (6a7055661 2022-02-27) to rustc 1.61.0-nightly (1d9c262ee 2022-03-26) fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-windows-gnu Toolchain: GNU, Operating system: Windows P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants