Skip to content

Commit 4682040

Browse files
committed
minor
1 parent 621b162 commit 4682040

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

build/arm-tools.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ endif
6868
CFLAGS += --specs=nano.specs
6969

7070
# Check if the compiler version is the minimum required
71-
version_to_number=$(shell v=$1; v=($${v//./ }); echo $$((v[0] * 10000 + v[1] * 100 + v[2])))
72-
get_major_version=$(shell v=$1; v=($${v//./ }); echo $${v[0]})
73-
arm_gcc_version_str:=$(shell $(CC) -dumpversion)
74-
arm_gcc_version:=$(call version_to_number,$(arm_gcc_version_str))
71+
include $(COMMON_BUILD)/gcc-version.mk
72+
arm_gcc_version_str:=$(gcc_version_str)
73+
arm_gcc_version:=$(gcc_version)
7574
expected_version_str:=10.2.1
7675
ifeq ($(shell test $(arm_gcc_version) -lt $(call version_to_number,$(expected_version_str)); echo $$?),0)
7776
$(error "ARM gcc version $(expected_version_str) or later required, but found $(arm_gcc_version_str)")

build/gcc-tools.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ ifeq ($(BUILD_STANDALONE_LIB),y)
3535
CFLAGS += -fPIC -fpic -rdynamic -fno-plt
3636
LDFLAGS += -fPIC -fpic -rdynamic -fno-plt
3737
endif
38+
39+
include $(COMMON_BUILD)/gcc-version.mk

build/gcc-version.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version_to_number=$(shell v=$1; v=($${v//./ }); echo $$((v[0] * 10000 + v[1] * 100 + v[2])))
2+
get_major_version=$(shell v=$1; v=($${v//./ }); echo $${v[0]})
3+
gcc_version_str:=$(shell $(CC) -dumpfullversion)
4+
gcc_version:=$(call version_to_number,$(arm_gcc_version_str))

build/module-defaults.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ START_YMODEM_FLASHER_SERIAL_SPEED=28800
55

66
include $(COMMON_BUILD)/version.mk
77
include $(COMMON_BUILD)/os.mk
8+
include $(COMMON_BUILD)/gcc-version.mk
89

910
QUOTE='
1011

@@ -63,7 +64,10 @@ CFLAGS += -fno-strict-aliasing
6364
CFLAGS += -DSPARK=1 -DPARTICLE=1
6465
CFLAGS += -Werror=return-type
6566
CFLAGS += -Wundef
67+
68+
ifeq ($(shell test $(gcc_version) -lt $(call version_to_number,"11.0.0"); echo $$?),0)
6669
CFLAGS += -Wno-error=cast-function-type
70+
endif
6771

6872
ifdef START_DFU_FLASHER_SERIAL_SPEED
6973
CFLAGS += -DSTART_DFU_FLASHER_SERIAL_SPEED=$(START_DFU_FLASHER_SERIAL_SPEED)

0 commit comments

Comments
 (0)