From ec45734f6bdfcc6a6841b54fe023b2c8f969b30a Mon Sep 17 00:00:00 2001 From: finga Date: Wed, 7 Jun 2023 20:53:33 +0200 Subject: [PATCH] build: Refactor build flags Remove `-as-needed` linker flag. Fix formatting and add `-Os`, `-mrelax` and `flto`. --- firmware/rust/avr-specs/avr-atmega328p.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/firmware/rust/avr-specs/avr-atmega328p.json b/firmware/rust/avr-specs/avr-atmega328p.json index e236b08..20752d1 100644 --- a/firmware/rust/avr-specs/avr-atmega328p.json +++ b/firmware/rust/avr-specs/avr-atmega328p.json @@ -8,7 +8,7 @@ "executables": true, "late-link-args": { "gcc": [ - "-lgcc" + "-lgcc" ] }, "linker": "avr-gcc", @@ -18,8 +18,10 @@ "no-default-libraries": false, "pre-link-args": { "gcc": [ - "-mmcu=atmega328p", - "-Wl,--as-needed" + "-mmcu=atmega328p", + "-Os", + "-mrelax", + "-flto" ] }, "target-c-int-width": "16",