Description
Problem
When I install the stable-i686-pc-windows-gnu toolchain and try to build a crate which calls gcc in its build.rs, the build breaks. For example when trying to build the gmp-mpfr-sys crate under Msys2 32-bit, the build breaks saying that gcc doesn't work.
I managed to reduce the failure to just calling gcc with .rustup/toolchains/stable-i686-pc-windows-gnu/bin in the PATH.
Steps
-
Install stable-i686-pc-windows-gnu toolchain in rustup.
-
Install MSYS2 32-bit gcc. This can be done using:
-
Install MSYS2 using the installer at https://www.msys2.org/
-
Launch the MSYS2 MinGW x86 application which is the 32-bit terminal
-
Install gcc
pacman -S pacman-mirrors pacman -S mingw-w64-x86_64-gcc
-
-
Launch the MSYS2 MinGW x86 application and prepend the rustup toolchain directory to the PATH, something like
PATH="/c/Users/User/.rustup/toolchains/stable-i686-pc-windows-gnu/bin:$PATH"
with the correct drive for
c
and username forUser
. -
Create the file a.c containing one single line
int main () { return 0; }
-
Try to compile the file using
gcc a.c
.
Possible Solution(s)
When I rename the file libgcc_s_dw2-1.dll inside .rustup/toolchains/stable-i686-pc-windows-gnu, gcc a.c
succeeds.
Notes
No response
Rustup version
rustup 1.25.1 (bb60b1e89 2022-07-12)
Installed toolchains
stable-i686-pc-windows-gnu