fix make build due to clang changes

This commit is contained in:
hathach 2024-04-24 22:41:22 +07:00
parent eab42d90d4
commit 19f1080e38
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52
10 changed files with 28 additions and 12 deletions

View File

@ -20,8 +20,6 @@ ifndef TOOLCHAIN
TOOLCHAIN = gcc TOOLCHAIN = gcc
endif endif
$(info TOOLCHAIN: $(TOOLCHAIN))
#-------------- TOP and CURRENT_PATH ------------ #-------------- TOP and CURRENT_PATH ------------
# Set TOP to be the path to get from the current directory (where make was invoked) to the top of the tree. # Set TOP to be the path to get from the current directory (where make was invoked) to the top of the tree.

View File

@ -11,6 +11,7 @@ MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
CFLAGS += \ CFLAGS += \
-D__ARMVFP__=0 \ -D__ARMVFP__=0 \
-D__ARMFPV5__=0 \ -D__ARMFPV5__=0 \
-D__STARTUP_CLEAR_BSS \
-DXIP_EXTERNAL_FLASH=1 \ -DXIP_EXTERNAL_FLASH=1 \
-DXIP_BOOT_HEADER_ENABLE=1 \ -DXIP_BOOT_HEADER_ENABLE=1 \
-DCFG_TUSB_MCU=OPT_MCU_MIMXRT1XXX -DCFG_TUSB_MCU=OPT_MCU_MIMXRT1XXX
@ -26,7 +27,9 @@ endif
# mcu driver cause following warnings # mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=implicit-fallthrough -Wno-error=redundant-decls CFLAGS += -Wno-error=unused-parameter -Wno-error=implicit-fallthrough -Wno-error=redundant-decls
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs LDFLAGS_GCC += \
-nostartfiles \
--specs=nosys.specs --specs=nano.specs
# All source paths should be relative to the top level. # All source paths should be relative to the top level.
LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_VARIANT)xxxxx${MCU_CORE}_flexspi_nor.ld LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_VARIANT)xxxxx${MCU_CORE}_flexspi_nor.ld

View File

@ -6,9 +6,12 @@ include $(TOP)/$(BOARD_PATH)/board.mk
CPU_CORE ?= cortex-m4 CPU_CORE ?= cortex-m4
CFLAGS += \ CFLAGS += \
-D__STARTUP_CLEAR_BSS \
-DCFG_TUSB_MCU=OPT_MCU_KINETIS_K \ -DCFG_TUSB_MCU=OPT_MCU_KINETIS_K \
LDFLAGS += \ LDFLAGS += \
-nostartfiles \
--specs=nosys.specs --specs=nano.specs \
-Wl,--defsym,__stack_size__=0x400 \ -Wl,--defsym,__stack_size__=0x400 \
-Wl,--defsym,__heap_size__=0 -Wl,--defsym,__heap_size__=0

View File

@ -6,9 +6,11 @@ include $(TOP)/$(BOARD_PATH)/board.mk
CPU_CORE ?= cortex-m0plus CPU_CORE ?= cortex-m0plus
CFLAGS += \ CFLAGS += \
-D__STARTUP_CLEAR_BSS \
-DCFG_TUSB_MCU=OPT_MCU_KINETIS_KL \ -DCFG_TUSB_MCU=OPT_MCU_KINETIS_KL \
LDFLAGS += \ LDFLAGS += \
-nostartfiles \
-specs=nosys.specs -specs=nano.specs \ -specs=nosys.specs -specs=nano.specs \
-Wl,--defsym,__stack_size__=0x400 \ -Wl,--defsym,__stack_size__=0x400 \
-Wl,--defsym,__heap_size__=0 -Wl,--defsym,__heap_size__=0

View File

@ -18,7 +18,7 @@ CFLAGS += -Wno-error=strict-prototypes -Wno-error=cast-qual
# caused by freeRTOS port !! # caused by freeRTOS port !!
CFLAGS += -Wno-error=maybe-uninitialized CFLAGS += -Wno-error=maybe-uninitialized
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
SRC_C += \ SRC_C += \
src/portable/nxp/lpc17_40/dcd_lpc17_40.c \ src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
@ -36,3 +36,4 @@ SRC_C += \
INC += \ INC += \
$(TOP)/$(BOARD_PATH) \ $(TOP)/$(BOARD_PATH) \
$(TOP)/$(MCU_DIR)/inc \ $(TOP)/$(MCU_DIR)/inc \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \

View File

@ -14,7 +14,7 @@ CFLAGS += \
# mcu driver cause following warnings # mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes -Wno-error=cast-qual CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes -Wno-error=cast-qual
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
SRC_C += \ SRC_C += \
src/portable/chipidea/ci_hs/dcd_ci_hs.c \ src/portable/chipidea/ci_hs/dcd_ci_hs.c \
@ -30,4 +30,5 @@ SRC_C += \
INC += \ INC += \
$(TOP)/$(BOARD_PATH) \ $(TOP)/$(BOARD_PATH) \
$(TOP)/$(MCU_DIR)/inc \ $(TOP)/$(MCU_DIR)/inc \
$(TOP)/$(MCU_DIR)/inc/config_18xx $(TOP)/$(MCU_DIR)/inc/config_18xx \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \

View File

@ -15,7 +15,7 @@ CFLAGS += \
# mcu driver cause following warnings # mcu driver cause following warnings
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=cast-qual CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=cast-qual
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
# All source paths should be relative to the top level. # All source paths should be relative to the top level.
SRC_C += \ SRC_C += \
@ -32,4 +32,5 @@ SRC_C += \
INC += \ INC += \
$(TOP)/$(MCU_DIR)/inc \ $(TOP)/$(MCU_DIR)/inc \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
$(TOP)/$(BOARD_PATH) $(TOP)/$(BOARD_PATH)

View File

@ -18,7 +18,7 @@ CFLAGS += \
-Wno-error=cast-qual \ -Wno-error=cast-qual \
-Wno-error=incompatible-pointer-types \ -Wno-error=incompatible-pointer-types \
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
SRC_C += \ SRC_C += \
src/portable/chipidea/ci_hs/dcd_ci_hs.c \ src/portable/chipidea/ci_hs/dcd_ci_hs.c \
@ -36,4 +36,5 @@ SRC_C += \
INC += \ INC += \
$(TOP)/$(BOARD_PATH) \ $(TOP)/$(BOARD_PATH) \
${TOP}/${SDK_DIR}/inc \ ${TOP}/${SDK_DIR}/inc \
${TOP}/${SDK_DIR}/inc/config_43xx ${TOP}/${SDK_DIR}/inc/config_43xx \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \

View File

@ -7,6 +7,7 @@ MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
CFLAGS += \ CFLAGS += \
-flto \ -flto \
-D__STARTUP_CLEAR_BSS \
-DCFG_TUSB_MCU=OPT_MCU_LPC54XXX \ -DCFG_TUSB_MCU=OPT_MCU_LPC54XXX \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \ -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \
@ -23,7 +24,9 @@ endif
# mcu driver cause following warnings # mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter CFLAGS += -Wno-error=unused-parameter
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs LDFLAGS_GCC += \
-nostartfiles \
--specs=nosys.specs --specs=nano.specs
SRC_C += \ SRC_C += \
src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \ src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \

View File

@ -11,9 +11,10 @@ PORT ?= 1
CFLAGS += \ CFLAGS += \
-flto \ -flto \
-D__STARTUP_CLEAR_BSS \
-DCFG_TUSB_MCU=OPT_MCU_LPC55XX \ -DCFG_TUSB_MCU=OPT_MCU_LPC55XX \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \ -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \
-DBOARD_TUD_RHPORT=$(PORT) -DBOARD_TUD_RHPORT=$(PORT) \
ifeq ($(PORT), 1) ifeq ($(PORT), 1)
$(info "PORT1 High Speed") $(info "PORT1 High Speed")
@ -28,7 +29,9 @@ endif
# mcu driver cause following warnings # mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=float-equal CFLAGS += -Wno-error=unused-parameter -Wno-error=float-equal
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs LDFLAGS_GCC += \
-nostartfiles \
--specs=nosys.specs --specs=nano.specs \
# All source paths should be relative to the top level. # All source paths should be relative to the top level.
LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_CORE)_flash.ld LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_CORE)_flash.ld