core: Build option for LTO(Link Time Optimization)
This makes firmware size small but need to be tested more. https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options https://github.com/arduino/Arduino/issues/660 https://github.com/arduino/ArduinoCore-avr/blob/master/platform.txt * No `-fno-fat-lto-objects` is needed, it is the default. https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-ffat-lto-objects * No `-fuse-linker-plugin` is needed, it is the default. https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fuse-linker-plugin
This commit is contained in:
parent
0e1aeaa2cb
commit
360872d269
1 changed files with 4 additions and 0 deletions
|
|
@ -139,6 +139,7 @@ CFLAGS += -Wstrict-prototypes
|
||||||
CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
|
CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
|
||||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||||
CFLAGS += $(CSTANDARD)
|
CFLAGS += $(CSTANDARD)
|
||||||
|
CFLAGS += -flto
|
||||||
ifdef CONFIG_H
|
ifdef CONFIG_H
|
||||||
CFLAGS += -include $(CONFIG_H)
|
CFLAGS += -include $(CONFIG_H)
|
||||||
endif
|
endif
|
||||||
|
|
@ -173,6 +174,7 @@ CPPFLAGS += -Wundef
|
||||||
CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
|
CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
|
||||||
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||||
#CPPFLAGS += $(CSTANDARD)
|
#CPPFLAGS += $(CSTANDARD)
|
||||||
|
CPPFLAGS += -flto
|
||||||
ifdef CONFIG_H
|
ifdef CONFIG_H
|
||||||
CPPFLAGS += -include $(CONFIG_H)
|
CPPFLAGS += -include $(CONFIG_H)
|
||||||
endif
|
endif
|
||||||
|
|
@ -189,6 +191,7 @@ endif
|
||||||
# dump that will be displayed for a given single line of source input.
|
# dump that will be displayed for a given single line of source input.
|
||||||
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
|
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
|
||||||
ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||||
|
ASFLAGS += -flto
|
||||||
ifdef CONFIG_H
|
ifdef CONFIG_H
|
||||||
ASFLAGS += -include $(CONFIG_H)
|
ASFLAGS += -include $(CONFIG_H)
|
||||||
endif
|
endif
|
||||||
|
|
@ -261,6 +264,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||||
#LDFLAGS += -T linker_script.x
|
#LDFLAGS += -T linker_script.x
|
||||||
# You can give EXTRALDFLAGS at 'make' command line.
|
# You can give EXTRALDFLAGS at 'make' command line.
|
||||||
LDFLAGS += $(EXTRALDFLAGS)
|
LDFLAGS += $(EXTRALDFLAGS)
|
||||||
|
LDFLAGS += -flto
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue