about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back/rpath
diff options
context:
space:
mode:
authorMads Marquart <mads@marquart.dk>2024-11-13 00:27:14 +0100
committerMads Marquart <mads@marquart.dk>2024-11-24 01:20:29 +0100
commitcb6f8fa422ce14b82b60af79d0f0d0ad80936ecd (patch)
tree001ba94da42e183051521e19dfa66d1de5bc58d9 /compiler/rustc_codegen_ssa/src/back/rpath
parent45791dde8e0d258d794e561b9dff53f1dbb16377 (diff)
downloadrust-cb6f8fa422ce14b82b60af79d0f0d0ad80936ecd.tar.gz
rust-cb6f8fa422ce14b82b60af79d0f0d0ad80936ecd.zip
Support rpath with -Clinker-flavor=ld
Using `cc_args` panics when using `-Clinker-flavor=ld`, because the
arguments are in a form tailored for `-Clinker-flavor=gcc`.

So instead, we use `link_args` and let that wrap the arguments with the
appropriate `-Wl` or `-Xlinker` when needed.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back/rpath')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/rpath/tests.rs23
1 files changed, 1 insertions, 22 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs b/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs
index 39034842d10..f1a30105c59 100644
--- a/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs
+++ b/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs
@@ -1,13 +1,4 @@
-use std::ffi::OsString;
-use std::path::{Path, PathBuf};
-
-use super::{RPathConfig, get_rpath_relative_to_output, minimize_rpaths, rpaths_to_flags};
-
-#[test]
-fn test_rpaths_to_flags() {
-    let flags = rpaths_to_flags(vec!["path1".into(), "path2".into()]);
-    assert_eq!(flags, ["-Wl,-rpath,path1", "-Wl,-rpath,path2"]);
-}
+use super::*;
 
 #[test]
 fn test_minimize1() {
@@ -69,15 +60,3 @@ fn test_rpath_relative_issue_119571() {
     // Should not panic when lib only contains filename.
     let _ = get_rpath_relative_to_output(config, Path::new("libstd.so"));
 }
-
-#[test]
-fn test_xlinker() {
-    let args = rpaths_to_flags(vec!["a/normal/path".into(), "a,comma,path".into()]);
-
-    assert_eq!(args, vec![
-        OsString::from("-Wl,-rpath,a/normal/path"),
-        OsString::from("-Wl,-rpath"),
-        OsString::from("-Xlinker"),
-        OsString::from("a,comma,path")
-    ]);
-}