Skip to content

Commit 250bff1

Browse files
committed
Revert "musl: link crt{begin,end}.o from the system compiler"
This reverts commit 6d9154a.
1 parent 14507f5 commit 250bff1

File tree

3 files changed

+2
-25
lines changed

3 files changed

+2
-25
lines changed

src/librustc_codegen_llvm/back/link.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -648,12 +648,6 @@ fn link_natively(sess: &Session,
648648
for obj in &sess.target.target.options.pre_link_objects_exe_crt {
649649
cmd.arg(root.join(obj));
650650
}
651-
652-
for obj in &sess.target.target.options.pre_link_objects_exe_crt_sys {
653-
if flavor == LinkerFlavor::Gcc {
654-
cmd.arg(format!("-l:{}", obj));
655-
}
656-
}
657651
}
658652

659653
if sess.target.target.options.is_like_emscripten {
@@ -678,11 +672,6 @@ fn link_natively(sess: &Session,
678672
cmd.arg(root.join(obj));
679673
}
680674
if sess.crt_static() {
681-
for obj in &sess.target.target.options.post_link_objects_crt_sys {
682-
if flavor == LinkerFlavor::Gcc {
683-
cmd.arg(format!("-l:{}", obj));
684-
}
685-
}
686675
for obj in &sess.target.target.options.post_link_objects_crt {
687676
cmd.arg(root.join(obj));
688677
}

src/librustc_target/spec/linux_musl_base.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ pub fn opts() -> TargetOptions {
5858
// they'll be included from there.
5959
base.pre_link_objects_exe_crt.push("crt1.o".to_string());
6060
base.pre_link_objects_exe_crt.push("crti.o".to_string());
61-
base.pre_link_objects_exe_crt_sys.push("crtbegin.o".to_string());
62-
base.post_link_objects_crt_sys.push("crtend.o".to_string());
6361
base.post_link_objects_crt.push("crtn.o".to_string());
6462

6563
// These targets statically link libc by default

src/librustc_target/spec/mod.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -425,23 +425,19 @@ pub struct TargetOptions {
425425
/// Linker arguments that are passed *before* any user-defined libraries.
426426
pub pre_link_args: LinkArgs, // ... unconditionally
427427
pub pre_link_args_crt: LinkArgs, // ... when linking with a bundled crt
428-
/// Objects to link before all others, all except *_sys found within the
428+
/// Objects to link before all others, always found within the
429429
/// sysroot folder.
430430
pub pre_link_objects_exe: Vec<String>, // ... when linking an executable, unconditionally
431431
pub pre_link_objects_exe_crt: Vec<String>, // ... when linking an executable with a bundled crt
432-
pub pre_link_objects_exe_crt_sys: Vec<String>, // ... when linking an executable with a bundled
433-
// crt, from the system library search path
434432
pub pre_link_objects_dll: Vec<String>, // ... when linking a dylib
435433
/// Linker arguments that are unconditionally passed after any
436434
/// user-defined but before post_link_objects. Standard platform
437435
/// libraries that should be always be linked to, usually go here.
438436
pub late_link_args: LinkArgs,
439-
/// Objects to link after all others, all except *_sys found within the
437+
/// Objects to link after all others, always found within the
440438
/// sysroot folder.
441439
pub post_link_objects: Vec<String>, // ... unconditionally
442440
pub post_link_objects_crt: Vec<String>, // ... when linking with a bundled crt
443-
pub post_link_objects_crt_sys: Vec<String>, // ... when linking with a bundled crt, from the
444-
// system library search path
445441
/// Linker arguments that are unconditionally passed *after* any
446442
/// user-defined libraries.
447443
pub post_link_args: LinkArgs,
@@ -676,11 +672,9 @@ impl Default for TargetOptions {
676672
relro_level: RelroLevel::None,
677673
pre_link_objects_exe: Vec::new(),
678674
pre_link_objects_exe_crt: Vec::new(),
679-
pre_link_objects_exe_crt_sys: Vec::new(),
680675
pre_link_objects_dll: Vec::new(),
681676
post_link_objects: Vec::new(),
682677
post_link_objects_crt: Vec::new(),
683-
post_link_objects_crt_sys: Vec::new(),
684678
late_link_args: LinkArgs::new(),
685679
link_env: Vec::new(),
686680
archive_format: "gnu".to_string(),
@@ -902,12 +896,10 @@ impl Target {
902896
key!(pre_link_args_crt, link_args);
903897
key!(pre_link_objects_exe, list);
904898
key!(pre_link_objects_exe_crt, list);
905-
key!(pre_link_objects_exe_crt_sys, list);
906899
key!(pre_link_objects_dll, list);
907900
key!(late_link_args, link_args);
908901
key!(post_link_objects, list);
909902
key!(post_link_objects_crt, list);
910-
key!(post_link_objects_crt_sys, list);
911903
key!(post_link_args, link_args);
912904
key!(link_env, env);
913905
key!(asm_args, list);
@@ -1112,12 +1104,10 @@ impl ToJson for Target {
11121104
target_option_val!(link_args - pre_link_args_crt);
11131105
target_option_val!(pre_link_objects_exe);
11141106
target_option_val!(pre_link_objects_exe_crt);
1115-
target_option_val!(pre_link_objects_exe_crt_sys);
11161107
target_option_val!(pre_link_objects_dll);
11171108
target_option_val!(link_args - late_link_args);
11181109
target_option_val!(post_link_objects);
11191110
target_option_val!(post_link_objects_crt);
1120-
target_option_val!(post_link_objects_crt_sys);
11211111
target_option_val!(link_args - post_link_args);
11221112
target_option_val!(env - link_env);
11231113
target_option_val!(asm_args);

0 commit comments

Comments
 (0)