Large executable while compiling for windows from Linux systems #60504
Labels
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
O-windows-gnu
Toolchain: GNU, Operating system: Windows
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I have a simple Hello World program, which only has a single line in the main function of main.rs, which is
println!(Hello World);
Adding to the default package that is done by cargo init, the cargo.toml file has
[profile.dev]
panic="abort"
When I compile the code with target
i686-pc-windows-gnu
, with the linker beingi686-w64-mingw32-g++
on linux, for windows, I get an exe, which is 3052 kB, and when i do the same with targeti686-pc-windows-msvc
, for windows on windows, I get an exe, which is 112 kB. Could someone suggest as to how I can reduce the size while I cross compile my code for windows from Linux? This is a concern as the difference in size is almost 30 times.The text was updated successfully, but these errors were encountered: