Skip to content

Commit 4f6594e

Browse files
committed
Enable LTO
1 parent 24badb0 commit 4f6594e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: hardware/arduino/avr/platform.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ compiler.warning_flags.all=-Wall -Wextra
2020
# Default "compiler.path" is correct, change only if you want to override the initial value
2121
compiler.path={runtime.tools.avr-gcc.path}/bin/
2222
compiler.c.cmd=avr-gcc
23-
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD
24-
compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections
23+
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
24+
compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections -flto -fuse-linker-plugin
2525
compiler.c.elf.cmd=avr-gcc
26-
compiler.S.flags=-c -g -x assembler-with-cpp
26+
compiler.S.flags=-c -g -x assembler-with-cpp -flto
2727
compiler.cpp.cmd=avr-g++
28-
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD
29-
compiler.ar.cmd=avr-ar
28+
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto
29+
compiler.ar.cmd=avr-gcc-ar
3030
compiler.ar.flags=rcs
3131
compiler.objcopy.cmd=avr-objcopy
3232
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0

0 commit comments

Comments
 (0)