Skip to content

Conversation

@Kobzol
Copy link
Member

@Kobzol Kobzol commented Jan 15, 2026

This PR adds the GCC codegen backend, and the GCC (libgccjit) component upon which it depends, to build-manifest, and thus also to (nightly) Rustup. I added both components in a single PR, because one can't work/isn't useful without the other.

Both components are marked as nightly-only and as -preview.

As a reminder, the GCC component is special; we need a separate component for every (host, target) compilation pair. This is not something that is really supported by rustup today, so we work around that by creating a separate component/package for each compilation target. So if we want to distribute GCC that can compile from {T1, T2} to {T2, T3}, we will create two separate components (gcc-T2 and gcc-T3), and make both of them available on T1 and T2 hosts.

I tried to reuse the existing structure of PkgType in build-manifest, but added a target field to the Gcc package variant. This required some macro hackery, but at least it doesn't require making larger changes to build-manifest.

After this PR lands, unless I messed something up, starting with the following nightly, the following should work:

rustup +nightly component add rustc-codegen-gcc-preview gcc-x86_64-unknown-linux-gnu-preview
RUSTFLAGS="-Zcodegen-backend=gcc" cargo +nightly build

Note that it will work currently only on x86_64-unknown-linux-gnu, and only if not cross-compiling.

r? @Mark-Simulacrum

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants