Skip to content

Commit f7f5210

Browse files
committed
Add dist:Gcc build step
To distribute the prebuilt libgccjit.so from CI.
1 parent 69cea2d commit f7f5210

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,3 +2450,30 @@ impl Step for ReproducibleArtifacts {
24502450
if added_anything { Some(tarball.generate()) } else { None }
24512451
}
24522452
}
2453+
2454+
/// Tarball containing a prebuilt version of the libgccjit library,
2455+
/// needed as a dependency for the GCC codegen backend (similarly to the LLVM
2456+
/// backend needing a prebuilt libLLVM).
2457+
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
2458+
pub struct Gcc {
2459+
pub target: TargetSelection,
2460+
}
2461+
2462+
impl Step for Gcc {
2463+
type Output = GeneratedTarball;
2464+
2465+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
2466+
run.alias("gcc")
2467+
}
2468+
2469+
fn make_run(run: RunConfig<'_>) {
2470+
run.builder.ensure(Gcc { target: run.target });
2471+
}
2472+
2473+
fn run(self, builder: &Builder<'_>) -> Self::Output {
2474+
let tarball = Tarball::new(builder, "gcc", &self.target.triple);
2475+
let output = builder.ensure(super::gcc::Gcc { target: self.target });
2476+
tarball.add_file(output.libgccjit, ".", 0o644);
2477+
tarball.generate()
2478+
}
2479+
}

src/bootstrap/src/core/builder/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ impl<'a> Builder<'a> {
10661066
dist::PlainSourceTarball,
10671067
dist::BuildManifest,
10681068
dist::ReproducibleArtifacts,
1069+
dist::Gcc
10691070
),
10701071
Kind::Install => describe!(
10711072
install::Docs,

src/tools/opt-dist/src/main.rs

Lines changed: 1 addition & 0 deletions
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)