Closed
Description
Currently mingw stage0 package does not contain mingw runtime libraries: libgcc_s_dw2-1.dll, libstdc++-6.dll, libpthread-2.dll.
However, mingw sometimes upgrades dll and the installer installs latest one as default. This makes a lot of problems and confusions.
- "Missing libgcc_s_dw2-1.dll" is frequently reported: rustc vs rustc.exe in PATH (Windows/MinGW) #3319, missing libgcc_s_dw2-1.dll message after install in win7 (rust-4) #3655, Windows installer - libgcc_s_dw2-1.dll missing #7089, Missing libgcc_s_dw2-1.dll message after install in Win7 #9218 and more.
- libpthread-2.dll is renamed to pthreadGC2.dll. User have to install old package or copy dll. See rustc can't find libpthread-2.dll, mingw ships with pthreadGC2.dll #8786
- If libstdc++-6.dll is incompatible (i.e. too new), rustc segfaults with no clue. See stage0 segfaults on Win7 64bit #5220 and its the first comment.
A portable Version of Rust Compiler for Windows #3459 suggests portable version of installer, but it cannot be done in near future since we rely ong++
linker.
Instead, we can bundle dlls with stage0 archive then we only depend on external g++ executable, not any runtime libraries.
This may also help upgrading mingw (#8598): currently, if you want to build rust with recent mingw or mingw-w64 (#8996), you have to copy old dlls at <builddir>/<triple>/stage0/bin/
. It is really inconvenient.