]> git.lizzy.rs Git - rust.git/commitdiff
Revert "musl: link crt{begin,end}.o from the system compiler"
authorAlex Crichton <alex@alexcrichton.com>
Sun, 13 May 2018 14:44:46 +0000 (07:44 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 17 May 2018 17:37:22 +0000 (10:37 -0700)
This reverts commit 6d9154a830dd9773fe8a4e34e1fc3dfb1ca6f935.

src/librustc_codegen_llvm/back/link.rs
src/librustc_target/spec/linux_musl_base.rs
src/librustc_target/spec/mod.rs

index dbfd430a3e2e7815efdc48c9bb1675ac9ce2b34c..4e9910e58f391dcb79aca2626d2b1c57100cc53a 100644 (file)
@@ -648,12 +648,6 @@ fn link_natively(sess: &Session,
         for obj in &sess.target.target.options.pre_link_objects_exe_crt {
             cmd.arg(root.join(obj));
         }
-
-        for obj in &sess.target.target.options.pre_link_objects_exe_crt_sys {
-            if flavor == LinkerFlavor::Gcc {
-                cmd.arg(format!("-l:{}", obj));
-            }
-        }
     }
 
     if sess.target.target.options.is_like_emscripten {
@@ -678,11 +672,6 @@ fn link_natively(sess: &Session,
         cmd.arg(root.join(obj));
     }
     if sess.crt_static() {
-        for obj in &sess.target.target.options.post_link_objects_crt_sys {
-            if flavor == LinkerFlavor::Gcc {
-                cmd.arg(format!("-l:{}", obj));
-            }
-        }
         for obj in &sess.target.target.options.post_link_objects_crt {
             cmd.arg(root.join(obj));
         }
index 4594d450c1507f7a05dbd9078d0f3c9d90dab2c4..7a3f3c2a518bc7d065602ce42d30d3f9abc1ad1e 100644 (file)
@@ -58,8 +58,6 @@ pub fn opts() -> TargetOptions {
     // they'll be included from there.
     base.pre_link_objects_exe_crt.push("crt1.o".to_string());
     base.pre_link_objects_exe_crt.push("crti.o".to_string());
-    base.pre_link_objects_exe_crt_sys.push("crtbegin.o".to_string());
-    base.post_link_objects_crt_sys.push("crtend.o".to_string());
     base.post_link_objects_crt.push("crtn.o".to_string());
 
     // These targets statically link libc by default
index fb20fe9c8918f060aef00931ea6a14dfd07080fb..bc1ccb4185752cbad78e3b05355823340708fd66 100644 (file)
@@ -425,23 +425,19 @@ pub struct TargetOptions {
     /// Linker arguments that are passed *before* any user-defined libraries.
     pub pre_link_args: LinkArgs, // ... unconditionally
     pub pre_link_args_crt: LinkArgs, // ... when linking with a bundled crt
-    /// Objects to link before all others, all except *_sys found within the
+    /// Objects to link before all others, always found within the
     /// sysroot folder.
     pub pre_link_objects_exe: Vec<String>, // ... when linking an executable, unconditionally
     pub pre_link_objects_exe_crt: Vec<String>, // ... when linking an executable with a bundled crt
-    pub pre_link_objects_exe_crt_sys: Vec<String>, // ... when linking an executable with a bundled
-                                                   //  crt, from the system library search path
     pub pre_link_objects_dll: Vec<String>, // ... when linking a dylib
     /// Linker arguments that are unconditionally passed after any
     /// user-defined but before post_link_objects.  Standard platform
     /// libraries that should be always be linked to, usually go here.
     pub late_link_args: LinkArgs,
-    /// Objects to link after all others, all except *_sys found within the
+    /// Objects to link after all others, always found within the
     /// sysroot folder.
     pub post_link_objects: Vec<String>, // ... unconditionally
     pub post_link_objects_crt: Vec<String>, // ... when linking with a bundled crt
-    pub post_link_objects_crt_sys: Vec<String>, // ... when linking with a bundled crt, from the
-                                                //  system library search path
     /// Linker arguments that are unconditionally passed *after* any
     /// user-defined libraries.
     pub post_link_args: LinkArgs,
@@ -676,11 +672,9 @@ fn default() -> TargetOptions {
             relro_level: RelroLevel::None,
             pre_link_objects_exe: Vec::new(),
             pre_link_objects_exe_crt: Vec::new(),
-            pre_link_objects_exe_crt_sys: Vec::new(),
             pre_link_objects_dll: Vec::new(),
             post_link_objects: Vec::new(),
             post_link_objects_crt: Vec::new(),
-            post_link_objects_crt_sys: Vec::new(),
             late_link_args: LinkArgs::new(),
             link_env: Vec::new(),
             archive_format: "gnu".to_string(),
@@ -902,12 +896,10 @@ macro_rules! key {
         key!(pre_link_args_crt, link_args);
         key!(pre_link_objects_exe, list);
         key!(pre_link_objects_exe_crt, list);
-        key!(pre_link_objects_exe_crt_sys, list);
         key!(pre_link_objects_dll, list);
         key!(late_link_args, link_args);
         key!(post_link_objects, list);
         key!(post_link_objects_crt, list);
-        key!(post_link_objects_crt_sys, list);
         key!(post_link_args, link_args);
         key!(link_env, env);
         key!(asm_args, list);
@@ -1112,12 +1104,10 @@ macro_rules! target_option_val {
         target_option_val!(link_args - pre_link_args_crt);
         target_option_val!(pre_link_objects_exe);
         target_option_val!(pre_link_objects_exe_crt);
-        target_option_val!(pre_link_objects_exe_crt_sys);
         target_option_val!(pre_link_objects_dll);
         target_option_val!(link_args - late_link_args);
         target_option_val!(post_link_objects);
         target_option_val!(post_link_objects_crt);
-        target_option_val!(post_link_objects_crt_sys);
         target_option_val!(link_args - post_link_args);
         target_option_val!(env - link_env);
         target_option_val!(asm_args);