mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[build] LTO flag can be set by user, else it is opposite of DEBUG flag
If no LTO, at least prune symbols.
This commit is contained in:
committed by
EmilieNumworks
parent
5cd0f8796a
commit
fb2bde7938
@@ -5,18 +5,25 @@ GDB = arm-none-eabi-gdb
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
SIZE = arm-none-eabi-size
|
||||
|
||||
LTO=1
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
# Always generate debug information
|
||||
SFLAGS += -ggdb3
|
||||
|
||||
|
||||
# LTO ?= NOT(DEBUG)
|
||||
ifeq ($(DEBUG),1)
|
||||
LTO ?= 0
|
||||
else
|
||||
LTO ?= 1
|
||||
endif
|
||||
|
||||
ifeq ($(LTO),1)
|
||||
# Use link-time optimization if LTO=1
|
||||
SFLAGS += -flto
|
||||
else
|
||||
# Otherwise, just get rid of unused symbols
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user