Skip to content

Commit 18bf3dc

Browse files
committed
Move libgccjit.so to the new location within the sysroot
1 parent cd8cc6f commit 18bf3dc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

build_system/src/build.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,20 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
111111

112112
// Symlink libgccjit.so to sysroot.
113113
let lib_path = start_dir.join("sysroot").join("lib");
114+
let rustlib_target_path = lib_path
115+
.join("rustlib")
116+
.join(&config.target_triple)
117+
.join("codegen-backends")
118+
.join("lib")
119+
.join(&config.target_triple);
114120
let libgccjit_path =
115121
PathBuf::from(config.gcc_path.as_ref().expect("libgccjit should be set by this point"))
116122
.join("libgccjit.so");
117-
let libgccjit_in_sysroot_path = lib_path.join("libgccjit.so");
123+
let libgccjit_in_sysroot_path = rustlib_target_path.join("libgccjit.so");
118124
// First remove the file to be able to create the symlink even when the file already exists.
119125
let _ = fs::remove_file(&libgccjit_in_sysroot_path);
120-
create_dir(&lib_path)?;
121-
symlink(libgccjit_path, libgccjit_in_sysroot_path)
126+
create_dir(&rustlib_target_path)?;
127+
symlink(libgccjit_path, &libgccjit_in_sysroot_path)
122128
.map_err(|error| format!("Cannot create symlink for libgccjit.so: {}", error))?;
123129

124130
let library_dir = start_dir.join("sysroot_src").join("library");

0 commit comments

Comments
 (0)