Skip to content

rustup's libgcc_s_dw2-1.dll breaks gcc under i686-pc-windows-gnu #3045

Closed
@tspiteri

Description

@tspiteri

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

  1. Install stable-i686-pc-windows-gnu toolchain in rustup.

  2. 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
      
  3. 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 for User.

  4. Create the file a.c containing one single line

     int main () { return 0; }
    
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions