Skip to content

Commit b987b70

Browse files
committed
Fix libgccjit symlink when we build GCC locally
1 parent 5e33838 commit b987b70

File tree

1 file changed

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

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ impl GccOutput {
3939
let mut target_filename = self.libgccjit.file_name().unwrap().to_str().unwrap().to_string();
4040
target_filename.push_str(".0");
4141

42+
// If we build libgccjit ourselves, then `self.libgccjit` can actually be a symlink.
43+
// In that case, we have to resolve it first, otherwise we'd create a symlink to a symlink,
44+
// which wouldn't work.
45+
let actual_libgccjit_path = t!(self.libgccjit.canonicalize());
46+
4247
let dst = directory.join(target_filename);
43-
builder.copy_link(&self.libgccjit, &dst, FileType::NativeLibrary);
48+
builder.copy_link(&actual_libgccjit_path, &dst, FileType::NativeLibrary);
4449
}
4550
}
4651

0 commit comments

Comments
 (0)