about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan McKay <me@dylanmckay.io>2020-07-31 03:57:20 +1200
committerDylan McKay <me@dylanmckay.io>2020-08-24 18:43:31 +1200
commit53b940c74c4f56ef075ee3c71f3cb157aaff65af (patch)
treed36be4101facced5fe4a552e397804faca74c0af /src
parentd785f9ba76be199a47652f5841260a42390f611b (diff)
downloadrust-53b940c74c4f56ef075ee3c71f3cb157aaff65af.tar.gz
rust-53b940c74c4f56ef075ee3c71f3cb157aaff65af.zip
[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.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_target/spec/avr_gnu_base.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustc_target/spec/avr_gnu_base.rs b/src/librustc_target/spec/avr_gnu_base.rs
index 5fcaaaacbee..878f0e9dcba 100644
--- a/src/librustc_target/spec/avr_gnu_base.rs
+++ b/src/librustc_target/spec/avr_gnu_base.rs
@@ -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()