Skip to content

Commit 53b940c

Browse files
committedAug 24, 2020
[AVR] Remove unnecessary arguments passed to the linker for GNU target
In general, linking with libc is not required, only libgcc is needed. As suggested in the code review, a better option for libc support is by building it into rust-lang/libc directly. This also removes the '-Os' argument to the linker, which is a NOP.
1 parent d785f9b commit 53b940c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎src/librustc_target/spec/avr_gnu_base.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ pub fn target(target_cpu: String) -> TargetResult {
1919
cpu: target_cpu.clone(),
2020
exe_suffix: ".elf".to_string(),
2121
linker: Some("avr-gcc".to_owned()),
22-
pre_link_args: vec![(
23-
LinkerFlavor::Gcc,
24-
vec!["-Os".to_owned(), format!("-mmcu={}", target_cpu)],
22+
pre_link_args: vec![(LinkerFlavor::Gcc,
23+
vec![format!("-mmcu={}", target_cpu)],
2524
)]
2625
.into_iter()
2726
.collect(),
28-
late_link_args: vec![(LinkerFlavor::Gcc, vec!["-lc".to_owned(), "-lgcc".to_owned()])]
27+
late_link_args: vec![(LinkerFlavor::Gcc, vec!["-lgcc".to_owned()])]
2928
.into_iter()
3029
.collect(),
3130
..super::freestanding_base::opts()

0 commit comments

Comments
 (0)