-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rust-1.8.0-x86_64-pc-windows-gnu can't cross-compiling for windows 32bit #33535
Comments
Thanks for the report! Unfortunately for the MinGW compilers you can't use them to cross compile, so if you want to cross from 32 to 64 you have to do so in a 64 environment. Could you explain in detail though the steps needed to reproduce this? It's somewhat unclear to me how you got the directory structure so far. |
The weird part in my opinion is that it is calling I'd test this but I can't get rustup.rs to install additional targets. |
@alexcrichton |
Ah yes in that case this is intended behavior. The compiler only assumes that it can run executables for its own platform, which in this case is You'll probably want to uncheck the "install native gcc component" during the installer and then you can cross compile by ensuring that the right gcc is in your PATH whenever you cross compile. I'd also recommend using MSVC as the cross compilation story is better there as we can find the cross-compiler for you most of the time. |
Splits the GitHub Actions configs into `linux`, `windows`, and `cross` jobs, each configured to test certain targets. Tests Windows in the 64-bit environment only, as it seems it's not possible to test MINGW32 builds on 64-bit Windows: rust-lang/rust#33535 (comment) > The compiler only assumes that it can run executables for its own > platform, which in this case is x86_64-pc-windows-gnu. That means that > the compiler is running a 64-bit mingw gcc trying to generate a 32-bit > executable. The mingw gcc builds, however, do not support this.
Splits the GitHub Actions configs into `linux`, `windows`, and `cross` jobs, each configured to test certain targets. Tests Windows in the 64-bit environment only, as it seems it's not possible to test MINGW32 builds on 64-bit Windows: rust-lang/rust#33535 (comment) > The compiler only assumes that it can run executables for its own > platform, which in this case is x86_64-pc-windows-gnu. That means that > the compiler is running a 64-bit mingw gcc trying to generate a 32-bit > executable. The mingw gcc builds, however, do not support this.
I have both 32bit gcc.exe and 64bit gcc.exe in the dir where "rust-1.8.0-x86_64-pc-windows-gnu" installed.The directory structre is showed below.
I can use the 32bit gcc.exe compile for both 32bit and 64bit .exe file.
But the 64b bit gcc.exe can only build for 64bit .exe file.
When I use 64b bit gcc.exe compile for 32bit .exe file I get this error:
The text was updated successfully, but these errors were encountered: