summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-04-24 22:41:22 +0700
committerhathach <[email protected]>2024-04-24 22:41:22 +0700
commit19f1080e381a81d5c56a0494b20c5c06475ffe42 (patch)
tree401be1107063a40910273710bf876732088defb8
parenteab42d90d42234997ea55c01b1a510c9bb6434aa (diff)
fix make build due to clang changes
-rw-r--r--examples/build_system/make/make.mk2
-rw-r--r--hw/bsp/imxrt/family.mk5
-rw-r--r--hw/bsp/kinetis_k/family.mk3
-rw-r--r--hw/bsp/kinetis_kl/family.mk2
-rw-r--r--hw/bsp/lpc17/family.mk3
-rw-r--r--hw/bsp/lpc18/family.mk5
-rw-r--r--hw/bsp/lpc40/family.mk3
-rw-r--r--hw/bsp/lpc43/family.mk5
-rw-r--r--hw/bsp/lpc54/family.mk5
-rw-r--r--hw/bsp/lpc55/family.mk7
10 files changed, 28 insertions, 12 deletions
diff --git a/examples/build_system/make/make.mk b/examples/build_system/make/make.mk
index 1ec42cb50..a78f4130d 100644
--- a/examples/build_system/make/make.mk
+++ b/examples/build_system/make/make.mk
@@ -20,8 +20,6 @@ ifndef TOOLCHAIN
TOOLCHAIN = gcc
endif
-$(info TOOLCHAIN: $(TOOLCHAIN))
-
#-------------- 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.
diff --git a/hw/bsp/imxrt/family.mk b/hw/bsp/imxrt/family.mk
index c6adcba5a..bde4c4ba6 100644
--- a/hw/bsp/imxrt/family.mk
+++ b/hw/bsp/imxrt/family.mk
@@ -11,6 +11,7 @@ MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
CFLAGS += \
-D__ARMVFP__=0 \
-D__ARMFPV5__=0 \
+ -D__STARTUP_CLEAR_BSS \
-DXIP_EXTERNAL_FLASH=1 \
-DXIP_BOOT_HEADER_ENABLE=1 \
-DCFG_TUSB_MCU=OPT_MCU_MIMXRT1XXX
@@ -26,7 +27,9 @@ endif
# mcu driver cause following warnings
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.
LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_VARIANT)xxxxx${MCU_CORE}_flexspi_nor.ld
diff --git a/hw/bsp/kinetis_k/family.mk b/hw/bsp/kinetis_k/family.mk
index 995873eec..844ce332e 100644
--- a/hw/bsp/kinetis_k/family.mk
+++ b/hw/bsp/kinetis_k/family.mk
@@ -6,9 +6,12 @@ include $(TOP)/$(BOARD_PATH)/board.mk
CPU_CORE ?= cortex-m4
CFLAGS += \
+ -D__STARTUP_CLEAR_BSS \
-DCFG_TUSB_MCU=OPT_MCU_KINETIS_K \
LDFLAGS += \
+ -nostartfiles \
+ --specs=nosys.specs --specs=nano.specs \
-Wl,--defsym,__stack_size__=0x400 \
-Wl,--defsym,__heap_size__=0
diff --git a/hw/bsp/kinetis_kl/family.mk b/hw/bsp/kinetis_kl/family.mk
index e331d82b7..1fdce981a 100644
--- a/hw/bsp/kinetis_kl/family.mk
+++ b/hw/bsp/kinetis_kl/family.mk
@@ -6,9 +6,11 @@ include $(TOP)/$(BOARD_PATH)/board.mk
CPU_CORE ?= cortex-m0plus
CFLAGS += \
+ -D__STARTUP_CLEAR_BSS \
-DCFG_TUSB_MCU=OPT_MCU_KINETIS_KL \
LDFLAGS += \
+ -nostartfiles \
-specs=nosys.specs -specs=nano.specs \
-Wl,--defsym,__stack_size__=0x400 \
-Wl,--defsym,__heap_size__=0
diff --git a/hw/bsp/lpc17/family.mk b/hw/bsp/lpc17/family.mk
index 694b6cccf..84ed95648 100644
--- a/hw/bsp/lpc17/family.mk
+++ b/hw/bsp/lpc17/family.mk
@@ -18,7 +18,7 @@ CFLAGS += -Wno-error=strict-prototypes -Wno-error=cast-qual
# caused by freeRTOS port !!
CFLAGS += -Wno-error=maybe-uninitialized
-LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
+LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
SRC_C += \
src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
@@ -36,3 +36,4 @@ SRC_C += \
INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/$(MCU_DIR)/inc \
+ $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
diff --git a/hw/bsp/lpc18/family.mk b/hw/bsp/lpc18/family.mk
index c36c903ae..f625e926a 100644
--- a/hw/bsp/lpc18/family.mk
+++ b/hw/bsp/lpc18/family.mk
@@ -14,7 +14,7 @@ CFLAGS += \
# mcu driver cause following warnings
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/portable/chipidea/ci_hs/dcd_ci_hs.c \
@@ -30,4 +30,5 @@ SRC_C += \
INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/$(MCU_DIR)/inc \
- $(TOP)/$(MCU_DIR)/inc/config_18xx
+ $(TOP)/$(MCU_DIR)/inc/config_18xx \
+ $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
diff --git a/hw/bsp/lpc40/family.mk b/hw/bsp/lpc40/family.mk
index fa76789e3..79d868f35 100644
--- a/hw/bsp/lpc40/family.mk
+++ b/hw/bsp/lpc40/family.mk
@@ -15,7 +15,7 @@ CFLAGS += \
# mcu driver cause following warnings
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.
SRC_C += \
@@ -32,4 +32,5 @@ SRC_C += \
INC += \
$(TOP)/$(MCU_DIR)/inc \
+ $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
$(TOP)/$(BOARD_PATH)
diff --git a/hw/bsp/lpc43/family.mk b/hw/bsp/lpc43/family.mk
index f24385139..84e7c30b3 100644
--- a/hw/bsp/lpc43/family.mk
+++ b/hw/bsp/lpc43/family.mk
@@ -18,7 +18,7 @@ CFLAGS += \
-Wno-error=cast-qual \
-Wno-error=incompatible-pointer-types \
-LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
+LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
SRC_C += \
src/portable/chipidea/ci_hs/dcd_ci_hs.c \
@@ -36,4 +36,5 @@ SRC_C += \
INC += \
$(TOP)/$(BOARD_PATH) \
${TOP}/${SDK_DIR}/inc \
- ${TOP}/${SDK_DIR}/inc/config_43xx
+ ${TOP}/${SDK_DIR}/inc/config_43xx \
+ $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
diff --git a/hw/bsp/lpc54/family.mk b/hw/bsp/lpc54/family.mk
index 9b5eac18d..ea4c9c39c 100644
--- a/hw/bsp/lpc54/family.mk
+++ b/hw/bsp/lpc54/family.mk
@@ -7,6 +7,7 @@ MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
CFLAGS += \
-flto \
+ -D__STARTUP_CLEAR_BSS \
-DCFG_TUSB_MCU=OPT_MCU_LPC54XXX \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \
@@ -23,7 +24,9 @@ endif
# mcu driver cause following warnings
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/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
diff --git a/hw/bsp/lpc55/family.mk b/hw/bsp/lpc55/family.mk
index 1b97c43e4..d82e85904 100644
--- a/hw/bsp/lpc55/family.mk
+++ b/hw/bsp/lpc55/family.mk
@@ -11,9 +11,10 @@ PORT ?= 1
CFLAGS += \
-flto \
+ -D__STARTUP_CLEAR_BSS \
-DCFG_TUSB_MCU=OPT_MCU_LPC55XX \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \
- -DBOARD_TUD_RHPORT=$(PORT)
+ -DBOARD_TUD_RHPORT=$(PORT) \
ifeq ($(PORT), 1)
$(info "PORT1 High Speed")
@@ -28,7 +29,9 @@ endif
# mcu driver cause following warnings
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.
LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_CORE)_flash.ld