Skip to content

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

@cuviper

Description

@cuviper
Member

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).

Activity

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
C-bugCategory: This is a bug.
O-windows-gnuToolchain: GNU, Operating system: Windows
on Dec 18, 2019
mati865

mati865 commented on Dec 18, 2019

@mati865
Member
mati865

mati865 commented on Dec 18, 2019

@mati865
Member

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

tan-wei

tan-wei commented on Dec 19, 2019

@tan-wei

@mati865 Thanks! It works.

pnkfelix

pnkfelix commented on Dec 19, 2019

@pnkfelix
Member

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

binarycrusader

binarycrusader commented on Dec 19, 2019

@binarycrusader
Contributor

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.

added 3 commits that reference this issue on Dec 20, 2019
8f5e3d7
a698791
35ff2f1
mati865

mati865 commented on Dec 27, 2019

@mati865
Member

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

John-Nagle

John-Nagle commented on Mar 13, 2022

@John-Nagle

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

mati865 commented on Mar 13, 2022

@mati865
Member

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

mati865 commented on Mar 13, 2022

@mati865
Member

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

John-Nagle commented on Mar 14, 2022

@John-Nagle

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

hydra

hydra commented on Mar 28, 2022

@hydra

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

John-Nagle commented on Mar 28, 2022

@John-Nagle

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

hydra

hydra commented on Mar 28, 2022

@hydra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-windows-gnuToolchain: GNU, Operating system: WindowsP-highHigh priorityT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @cuviper@hydra@pnkfelix@binarycrusader@John-Nagle

      Issue actions

        missing libstdc++-6.dll in beta-x86_64-pc-windows-gnu (1.41.0-beta.1) · Issue #67408 · rust-lang/rust