[build] Enable LTO for the device

This commit is contained in:
Romain Goyet
2018-10-10 17:31:17 +02:00
committed by LeaNumworks
parent 23b60ec345
commit 8264e3f1f8

View File

@@ -5,11 +5,18 @@ GDB = arm-none-eabi-gdb
OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size
LTO=1
ifeq ($(DEBUG),1)
SFLAGS += -ggdb3
else
ifeq ($(LTO),1)
SFLAGS += -flto
else
SFLAGS += -fdata-sections -ffunction-sections
LDFLAGS += -Wl,--gc-sections
endif
endif
SFLAGS += -mthumb -march=armv7e-m -mfloat-abi=hard -mcpu=cortex-m4 -mfpu=fpv4-sp-d16
LDFLAGS += $(SFLAGS) -lgcc -Wl,-T,$(LDSCRIPT)