Skip to content

Commit

Permalink
fix make build due to clang changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Apr 24, 2024
1 parent eab42d9 commit 19f1080
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 12 deletions.
2 changes: 0 additions & 2 deletions examples/build_system/make/make.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion hw/bsp/imxrt/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions hw/bsp/kinetis_k/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions hw/bsp/kinetis_kl/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion hw/bsp/lpc17/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -36,3 +36,4 @@ SRC_C += \
INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/$(MCU_DIR)/inc \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
5 changes: 3 additions & 2 deletions hw/bsp/lpc18/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
3 changes: 2 additions & 1 deletion hw/bsp/lpc40/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 += \
Expand All @@ -32,4 +32,5 @@ SRC_C += \

INC += \
$(TOP)/$(MCU_DIR)/inc \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
$(TOP)/$(BOARD_PATH)
5 changes: 3 additions & 2 deletions hw/bsp/lpc43/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
5 changes: 4 additions & 1 deletion hw/bsp/lpc54/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)))' \

Expand All @@ -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 \
Expand Down
7 changes: 5 additions & 2 deletions hw/bsp/lpc55/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit 19f1080

Please sign in to comment.