Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1470024

Browse files
committed
Store libgccjit.so in a lib directory in the GCC CI tarball
1 parent 5fec5e6 commit 1470024

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,7 @@ impl Step for Gcc {
24732473
fn run(self, builder: &Builder<'_>) -> Self::Output {
24742474
let tarball = Tarball::new(builder, "gcc", &self.target.triple);
24752475
let output = builder.ensure(super::gcc::Gcc { target: self.target });
2476-
tarball.add_file(output.libgccjit, ".", 0o644);
2476+
tarball.add_file(output.libgccjit, "lib", 0o644);
24772477
tarball.generate()
24782478
}
24792479
}

src/bootstrap/src/core/build_steps/gcc.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,23 @@ impl Step for Gcc {
6363
}
6464

6565
build_gcc(&metadata, builder, target);
66-
67-
let lib_alias = metadata.install_dir.join("lib/libgccjit.so.0");
68-
if !lib_alias.exists() {
69-
t!(builder.symlink_file(&libgccjit_path, lib_alias));
70-
}
66+
create_lib_alias(builder, &libgccjit_path);
7167

7268
t!(metadata.stamp.write());
7369

7470
GccOutput { libgccjit: libgccjit_path }
7571
}
7672
}
7773

74+
/// Creates a libgccjit.so.0 alias next to libgccjit.so if it does not
75+
/// already exist
76+
fn create_lib_alias(builder: &Builder<'_>, libgccjit: &PathBuf) {
77+
let lib_alias = libgccjit.parent().unwrap().join("libgccjit.so.0");
78+
if !lib_alias.exists() {
79+
t!(builder.symlink_file(libgccjit, lib_alias));
80+
}
81+
}
82+
7883
pub struct Meta {
7984
stamp: BuildStamp,
8085
out_dir: PathBuf,
@@ -109,8 +114,10 @@ fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option<Pa
109114
builder.config.download_ci_gcc(&sha, &root);
110115
t!(gcc_stamp.write());
111116
}
112-
// FIXME: put libgccjit.so into a lib directory in dist::Gcc
113-
Some(root.join("libgccjit.so"))
117+
118+
let libgccjit = root.join("lib").join("libgccjit.so");
119+
create_lib_alias(builder, &libgccjit);
120+
Some(libgccjit)
114121
}
115122

116123
#[cfg(test)]

0 commit comments

Comments
 (0)