-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
I-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.O-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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 being i686-w64-mingw32-g++ on linux, for windows, I get an exe, which is 3052 kB, and when i do the same with target i686-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.
Metadata
Metadata
Assignees
Labels
I-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.O-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.