move -flto to board.mk

current board that doesn work with flto is spresense and mimxrt10xx (due
to xip image_vector_table is optimized out).
This commit is contained in:
hathach 2019-11-20 16:06:40 +07:00
parent 1aa3f085cb
commit f638594536
42 changed files with 238 additions and 205 deletions

View File

@ -85,12 +85,7 @@ CFLAGS += \
ifeq ($(DEBUG), 1)
CFLAGS += -Og -ggdb
else
ifneq ($(BOARD),spresense)
#CFLAGS += -flto -Os
CFLAGS += -Os
else
CFLAGS += -Os
endif
endif
# TUSB Logging option

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,10 +1,11 @@
CFLAGS += \
-DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
-D__SAMD21G18A__ \
-flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m0plus \
-nostdlib -nostartfiles \
-D__SAMD21G18A__ \
-DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
# All source paths should be relative to the top level.

View File

@ -1,11 +1,12 @@
CFLAGS += \
-D__SAMD51J19A__ \
-flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-D__SAMD51J19A__ \
-DCFG_TUSB_MCU=OPT_MCU_SAMD51
CFLAGS += -Wno-error=undef

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=12000000 \
-DSTM32F405xx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-DSTM32F405xx \
-DHSE_VALUE=12000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-march=rv32i \
-mabi=ilp32 \
-nostdlib \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m0 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m0plus \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m0plus \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m33 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \

View File

@ -1,10 +1,11 @@
CFLAGS += \
-DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
-D__SAMD21G18A__ \
-flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m0plus \
-nostdlib -nostartfiles \
-D__SAMD21G18A__ \
-DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
# All source paths should be relative to the top level.

View File

@ -1,11 +1,12 @@
CFLAGS += \
-D__SAMD51J19A__ \
-flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-D__SAMD51J19A__ \
-DCFG_TUSB_MCU=OPT_MCU_SAMD51
CFLAGS += -Wno-error=undef

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,4 +1,5 @@
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=12000000 \
-DSTM32F405xx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-DSTM32F405xx \
-DHSE_VALUE=12000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver

View File

@ -1,12 +1,3 @@
SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk
INC += \
$(SPRESENSE_SDK)/nuttx/include \
$(SPRESENSE_SDK)/nuttx/arch \
$(SPRESENSE_SDK)/nuttx/arch/chip \
$(SPRESENSE_SDK)/sdk/bsp/include \
$(SPRESENSE_SDK)/sdk/bsp/include/sdk \
CFLAGS += \
-DCONFIG_WCHAR_BUILTIN \
-DCONFIG_HAVE_DOUBLE \
@ -23,6 +14,15 @@ CFLAGS += \
-fomit-frame-pointer \
-DCFG_TUSB_MCU=OPT_MCU_CXD56 \
SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk
INC += \
$(SPRESENSE_SDK)/nuttx/include \
$(SPRESENSE_SDK)/nuttx/arch \
$(SPRESENSE_SDK)/nuttx/arch/chip \
$(SPRESENSE_SDK)/sdk/bsp/include \
$(SPRESENSE_SDK)/sdk/bsp/include/sdk \
LIBS += \
$(SPRESENSE_SDK)/sdk/libs/libapps.a \
$(SPRESENSE_SDK)/sdk/libs/libsdk.a \

View File

@ -1,11 +1,12 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F070xB \
-flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m0 \
-mfloat-abi=soft \
-nostdlib -nostartfiles \
-DHSE_VALUE=8000000 \
-DSTM32F070xB \
-DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_STM32F0

View File

@ -1,11 +1,12 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F072xB \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m0 \
-mfloat-abi=soft \
-nostdlib -nostartfiles \
-DSTM32F072xB \
-DHSE_VALUE=8000000 \
-DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_STM32F0

View File

@ -1,11 +1,12 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F103xB \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \
-mfloat-abi=soft \
-nostdlib -nostartfiles \
-DSTM32F103xB \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F1
# mcu driver cause following warnings

View File

@ -1,11 +1,12 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F207xx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \
-mfloat-abi=soft \
-nostdlib -nostartfiles \
-DSTM32F207xx \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F2
# mcu driver cause following warnings

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F303xC \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-DSTM32F303xC \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F3
# mcu driver cause following warnings

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F407xx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-DSTM32F407xx \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F411xE \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-DSTM32F411xE \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F412Zx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-DSTM32F412Zx \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
# mcu driver cause following warnings

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32F767xx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m7 \
-mfloat-abi=hard \
-mfpu=fpv5-d16 \
-nostdlib -nostartfiles \
-DSTM32F767xx \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F7
# mcu driver cause following warnings

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32H743xx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m7 \
-mfloat-abi=hard \
-mfpu=fpv5-d16 \
-nostdlib -nostartfiles \
-DSTM32H743xx \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32H7
# mcu driver cause following warnings

View File

@ -1,11 +1,12 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32L053xx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m0plus \
-mfloat-abi=soft \
-nostdlib -nostartfiles \
-DSTM32L053xx \
-DHSE_VALUE=8000000 \
-DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_STM32L0

View File

@ -1,12 +1,13 @@
CFLAGS += \
-DHSE_VALUE=8000000 \
-DSTM32L476xx \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-DSTM32L476xx \
-DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32L4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32L4xx_HAL_Driver