]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_target/spec/mod.rs
Renamed lld_link_script to link_script and support all GNU-like linkers
[rust.git] / src / librustc_target / spec / mod.rs
index 91dfa1550f6265b061848e570acf551beead5d77..00088a0d0404ac6bb78861a14055a08ce614a40b 100644 (file)
@@ -668,9 +668,10 @@ pub struct TargetOptions {
     /// Linker arguments that are unconditionally passed *after* any
     /// user-defined libraries.
     pub post_link_args: LinkArgs,
-    /// Optional LLD link script applied to `dylib` and `executable` crate
-    /// types. This is a string containing the script, not a path.
-    pub lld_link_script: Option<String>,
+    /// Optional link script applied to `dylib` and `executable` crate types.
+    /// This is a string containing the script, not a path. Can only be applied
+    /// to linkers where `linker_is_gnu` is true.
+    pub link_script: Option<String>,
 
     /// Environment variables to be set for the linker invocation.
     pub link_env: Vec<(String, String)>,
@@ -900,7 +901,7 @@ fn default() -> TargetOptions {
             pre_link_args: LinkArgs::new(),
             pre_link_args_crt: LinkArgs::new(),
             post_link_args: LinkArgs::new(),
-            lld_link_script: None,
+            link_script: None,
             asm_args: Vec::new(),
             cpu: "generic".to_string(),
             features: String::new(),
@@ -1250,7 +1251,7 @@ macro_rules! key {
         key!(post_link_objects, list);
         key!(post_link_objects_crt, list);
         key!(post_link_args, link_args);
-        key!(lld_link_script, optional);
+        key!(link_script, optional);
         key!(link_env, env);
         key!(link_env_remove, list);
         key!(asm_args, list);
@@ -1480,7 +1481,7 @@ macro_rules! target_option_val {
         target_option_val!(post_link_objects);
         target_option_val!(post_link_objects_crt);
         target_option_val!(link_args - post_link_args);
-        target_option_val!(lld_link_script);
+        target_option_val!(link_script);
         target_option_val!(env - link_env);
         target_option_val!(link_env_remove);
         target_option_val!(asm_args);