about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-03-06 16:23:50 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-03-06 16:24:02 +0100
commit4bcaa4fe39f310c6ab774eebafd6ebbb6e6bd545 (patch)
tree8a7b580bafb7472b74fddf3a9d69891c053e6dba
parent42569283a221ac73a9355e2aef68159450448ece (diff)
downloadrust-4bcaa4fe39f310c6ab774eebafd6ebbb6e6bd545.tar.gz
rust-4bcaa4fe39f310c6ab774eebafd6ebbb6e6bd545.zip
Correctly handle `cargo_target_dir`
-rw-r--r--compiler/rustc_codegen_gcc/build_system/src/config.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_gcc/build_system/src/config.rs b/compiler/rustc_codegen_gcc/build_system/src/config.rs
index 46621ef3b21..34c92a3485e 100644
--- a/compiler/rustc_codegen_gcc/build_system/src/config.rs
+++ b/compiler/rustc_codegen_gcc/build_system/src/config.rs
@@ -446,9 +446,7 @@ impl ConfigInfo {
         ));
         let ld_library_path = format!(
             "{target}:{sysroot}:{gcc_path}",
-            // FIXME: It's possible to pick another out directory. Would be nice to have a command
-            // line option to change it.
-            target = current_dir.join("target/out").display(),
+            target = self.cargo_target_dir,
             sysroot = sysroot.display(),
             gcc_path = self.gcc_path,
         );
@@ -473,7 +471,7 @@ impl ConfigInfo {
         self.rustc_command.extend_from_slice(&rustflags);
         self.rustc_command.extend_from_slice(&[
             "-L".to_string(),
-            "crate=target/out".to_string(),
+            format!("crate={}", self.cargo_target_dir),
             "--out-dir".to_string(),
             self.cargo_target_dir.clone(),
         ]);