Skip to content

Commit 86ef07b

Browse files
committed
Load the correct libgccjit.so in rustc_codegen_gcc
1 parent 3fc1053 commit 86ef07b

File tree

1 file changed

+9
-3
lines changed
  • compiler/rustc_codegen_gcc/src

1 file changed

+9
-3
lines changed

compiler/rustc_codegen_gcc/src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ use rustc_middle::ty::TyCtxt;
9898
use rustc_middle::util::Providers;
9999
use rustc_session::Session;
100100
use rustc_session::config::{OptLevel, OutputFilenames};
101-
use rustc_session::filesearch::make_target_lib_path;
102101
use rustc_span::Symbol;
103102
use rustc_target::spec::{Arch, RelocModel};
104103
use tempfile::TempDir;
@@ -207,8 +206,15 @@ impl CodegenBackend for GccCodegenBackend {
207206
}
208207

209208
fn init(&self, sess: &Session) {
210-
fn file_path(path: &Path, sess: &Session) -> PathBuf {
211-
make_target_lib_path(path, &sess.target.llvm_target).join("libgccjit.so")
209+
fn file_path(sysroot_path: &Path, sess: &Session) -> PathBuf {
210+
let rustlib_path =
211+
rustc_target::relative_target_rustlib_path(sysroot_path, &sess.host.llvm_target);
212+
sysroot_path
213+
.join(rustlib_path)
214+
.join("codegen-backends")
215+
.join("lib")
216+
.join(sess.target.llvm_target.as_ref())
217+
.join("libgccjit.so")
212218
}
213219

214220
// We use all_paths() instead of only path() in case the path specified by --sysroot is

0 commit comments

Comments
 (0)