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
@Mark-Simulacrum
Copy link
Member

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

Can you confirm this is real preview? Historically I'm not sure we've had any components we actually managed to make installable only with -preview (by accident).

@bors try=dist-x86_64-linux

(Is that the right way to get a full dist build? If so I can kick a dev-static run off with the artifacts once it completes).

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 16, 2026

Unknown command "try". Run @bors help to see available commands.

@Kobzol
Copy link
Member Author

Kobzol commented Jan 16, 2026

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 16, 2026
Add GCC and the GCC codegen backend to build-manifest and rustup


try-job: dist-x86_64-linux
@Kobzol
Copy link
Member Author

Kobzol commented Jan 16, 2026

Huh, indeed if I do rustup +nightly component add rustc-codegen-gcc, without the -preview suffix, it also works. But the same is indeed true for existing components, like rustc-codegen-cranelift[-preview].

I guess it's because rustup allows both the original name and the renamed name to be installed?

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 16, 2026

☀️ Try build successful (CI)
Build commit: 83ba973 (83ba97395259d495deac3953da60349ecb08f09a, parent: bcf787a7805d6f26586409eb0ed7e4a739c7d687)

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