From 50f72653dbf6949d8d2b9fe74facd077de9dfd9e Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Fri, 19 Sep 2025 12:45:32 +0800 Subject: [PATCH] Fix the bug that cannot be compiled on the MSYS2 platform. --- firmware/bootloader/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firmware/bootloader/Makefile b/firmware/bootloader/Makefile index 52c0096..afca5ce 100644 --- a/firmware/bootloader/Makefile +++ b/firmware/bootloader/Makefile @@ -259,7 +259,8 @@ include $(TEMPLATE_PATH)/Makefile.common # tolerate warnings in newer gcc versions # need to be called after $(TEMPLATE_PATH)/Makefile.common -CC_VERSION = $(shell $(CC) -dumpversion 2>/dev/null|sed 's/\..*//') +# The return value of the Windows+msys2 build platform has carriage returns and line breaks, which need to be removed. +CC_VERSION = $(shell $(CC) -dumpversion 2>/dev/null | tr -d '\r' | cut -d. -f1) CC_VERSION := $(or $(strip $(CC_VERSION)),0) ifeq ($(shell expr $(CC_VERSION) \>= 12), 1) # avoid a couple of false warnings in nRF SDK