Skip to content

Commit 76bc558

Browse files
committed
Make sure that we won't accidentally ship libgccjit.so in the dist component
1 parent 6e5a6e0 commit 76bc558

File tree

1 file changed

+13
-1
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,19 @@ impl Step for Rustc {
478478
if libdir_relative.to_str() != Some("bin") {
479479
let libdir = builder.rustc_libdir(compiler);
480480
for entry in builder.read_dir(&libdir) {
481-
if is_dylib(&entry.path()) {
481+
// A safeguard that we will not ship libgccjit.so from the libdir, in case the
482+
// GCC codegen backend is enabled by default.
483+
// Long-term we should probably split the config options for:
484+
// - Include cg_gcc in the rustc sysroot by default
485+
// - Run dist of a specific codegen backend in `x dist` by default
486+
if is_dylib(&entry.path())
487+
&& !entry
488+
.path()
489+
.file_name()
490+
.and_then(|n| n.to_str())
491+
.map(|n| n.contains("libgccjit"))
492+
.unwrap_or(false)
493+
{
482494
// Don't use custom libdir here because ^lib/ will be resolved again
483495
// with installer
484496
builder.install(&entry.path(), &image.join("lib"), FileType::NativeLibrary);

0 commit comments

Comments
 (0)