Skip to content

Commit 4c45285

Browse files
committed
Add dist:Gcc build step
To distribute the prebuilt libgccjit.so from CI.
1 parent 2b3cef8 commit 4c45285

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Diff for: src/bootstrap/src/core/build_steps/dist.rs

+27
Original file line numberDiff line numberDiff line change
@@ -2464,3 +2464,30 @@ impl Step for ReproducibleArtifacts {
24642464
if added_anything { Some(tarball.generate()) } else { None }
24652465
}
24662466
}
2467+
2468+
/// Tarball containing a prebuilt version of the libgccjit library,
2469+
/// needed as a dependency for the GCC codegen backend (similarly to the LLVM
2470+
/// backend needing a prebuilt libLLVM).
2471+
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
2472+
pub struct Gcc {
2473+
pub target: TargetSelection,
2474+
}
2475+
2476+
impl Step for Gcc {
2477+
type Output = GeneratedTarball;
2478+
2479+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
2480+
run.alias("gcc")
2481+
}
2482+
2483+
fn make_run(run: RunConfig<'_>) {
2484+
run.builder.ensure(Gcc { target: run.target });
2485+
}
2486+
2487+
fn run(self, builder: &Builder<'_>) -> Self::Output {
2488+
let tarball = Tarball::new(builder, "gcc", &self.target.triple);
2489+
let output = builder.ensure(super::gcc::Gcc { target: self.target });
2490+
tarball.add_file(output.libgccjit, ".", 0o644);
2491+
tarball.generate()
2492+
}
2493+
}

Diff for: src/bootstrap/src/core/builder/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ impl<'a> Builder<'a> {
10721072
dist::PlainSourceTarball,
10731073
dist::BuildManifest,
10741074
dist::ReproducibleArtifacts,
1075+
dist::Gcc
10751076
),
10761077
Kind::Install => describe!(
10771078
install::Docs,

Diff for: src/tools/opt-dist/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ fn main() -> anyhow::Result<()> {
389389
"clippy",
390390
"miri",
391391
"rustfmt",
392+
"gcc",
392393
] {
393394
build_args.extend(["--skip".to_string(), target.to_string()]);
394395
}

0 commit comments

Comments
 (0)