rust-lang / rust-lang/rustc_codegen_gcc

Binary size when compiling with rustc_codegen_gcc

Open
#52 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
1.2k
Forks
105
Avg merge
8h 20m
Merged PRs (30d)
14

Description

I tried compiling the default "Hello, world!" program with rustc_codegen_gcc, and noticed the resulting binary has a size of ~20MB, opposed to the default rustc ~3MB binary. I don't know if it has something to do with optimization, or static libraries.

I also tried building the binary with --release, and got an ICE due to LTO not being implemented. Are these two things related?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the default and --release "Hello, world!" builds with rustc_codegen_gcc and compare their binary sizes with default rustc. Start by investigating optimization, static libraries, and the reported LTO ICE; done means determining whether the size difference and missing LTO are related and documenting or fixing the cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.