Skip to content

Commit

Permalink
[AVR] Remove unnecessary arguments passed to the linker for GNU target
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dylanmckay committed Aug 24, 2020
1 parent d785f9b commit 53b940c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/librustc_target/spec/avr_gnu_base.rs
Expand Up @@ -19,13 +19,12 @@ pub fn target(target_cpu: String) -> TargetResult {
cpu: target_cpu.clone(),
exe_suffix: ".elf".to_string(),
linker: Some("avr-gcc".to_owned()),
pre_link_args: vec![(
LinkerFlavor::Gcc,
vec!["-Os".to_owned(), format!("-mmcu={}", target_cpu)],
pre_link_args: vec![(LinkerFlavor::Gcc,
vec![format!("-mmcu={}", target_cpu)],
)]
.into_iter()
.collect(),
late_link_args: vec![(LinkerFlavor::Gcc, vec!["-lc".to_owned(), "-lgcc".to_owned()])]
late_link_args: vec![(LinkerFlavor::Gcc, vec!["-lgcc".to_owned()])]
.into_iter()
.collect(),
..super::freestanding_base::opts()
Expand Down

0 comments on commit 53b940c

Please sign in to comment.