Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
avtolstoy committed Oct 22, 2021
1 parent d502861 commit 81d8173
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build/arm-tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ endif
CFLAGS += --specs=nano.specs

# Check if the compiler version is the minimum required
version_to_number=$(shell v=$1; v=($${v//./ }); echo $$((v[0] * 10000 + v[1] * 100 + v[2])))
get_major_version=$(shell v=$1; v=($${v//./ }); echo $${v[0]})
arm_gcc_version_str:=$(shell $(CC) -dumpversion)
arm_gcc_version:=$(call version_to_number,$(arm_gcc_version_str))
include $(COMMON_BUILD)/gcc-version.mk
arm_gcc_version_str:=$(gcc_version_str)
arm_gcc_version:=$(gcc_version)
expected_version_str:=10.2.1
ifeq ($(shell test $(arm_gcc_version) -lt $(call version_to_number,$(expected_version_str)); echo $$?),0)
$(error "ARM gcc version $(expected_version_str) or later required, but found $(arm_gcc_version_str)")
Expand Down
2 changes: 2 additions & 0 deletions build/gcc-tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ ifeq ($(BUILD_STANDALONE_LIB),y)
CFLAGS += -fPIC -fpic -rdynamic -fno-plt
LDFLAGS += -fPIC -fpic -rdynamic -fno-plt
endif

include $(COMMON_BUILD)/gcc-version.mk
4 changes: 4 additions & 0 deletions build/gcc-version.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version_to_number=$(shell v=$1; v=($${v//./ }); echo $$((v[0] * 10000 + v[1] * 100 + v[2])))
get_major_version=$(shell v=$1; v=($${v//./ }); echo $${v[0]})
gcc_version_str:=$(shell $(CC) -dumpfullversion)
gcc_version:=$(call version_to_number,$(arm_gcc_version_str))
4 changes: 4 additions & 0 deletions build/module-defaults.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ START_YMODEM_FLASHER_SERIAL_SPEED=28800

include $(COMMON_BUILD)/version.mk
include $(COMMON_BUILD)/os.mk
include $(COMMON_BUILD)/gcc-version.mk

QUOTE='

Expand Down Expand Up @@ -63,7 +64,10 @@ CFLAGS += -fno-strict-aliasing
CFLAGS += -DSPARK=1 -DPARTICLE=1
CFLAGS += -Werror=return-type
CFLAGS += -Wundef

ifeq ($(shell test $(gcc_version) -lt $(call version_to_number,"11.0.0"); echo $$?),0)
CFLAGS += -Wno-error=cast-function-type
endif

ifdef START_DFU_FLASHER_SERIAL_SPEED
CFLAGS += -DSTART_DFU_FLASHER_SERIAL_SPEED=$(START_DFU_FLASHER_SERIAL_SPEED)
Expand Down

0 comments on commit 81d8173

Please sign in to comment.