Add GCC and the GCC codegen backend to build-manifest and rustup #151156
+65
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-T2andgcc-T3), and make both of them available on T1 and T2 hosts.I tried to reuse the existing structure of
PkgTypeinbuild-manifest, but added a target field to theGccpackage variant. This required some macro hackery, but at least it doesn't require making larger changes tobuild-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 buildNote that it will work currently only on
x86_64-unknown-linux-gnu, and only if not cross-compiling.r? @Mark-Simulacrum