@@ -18,6 +18,9 @@ CONFIGURATION_MAKEFILE = 1
18
18
MAKEFLAGS += -r
19
19
MAKEFLAGS += -R
20
20
21
+ # Enforce a minimum complier version
22
+ MINIMUM_GCC_MAJOR := 13
23
+
21
24
# Toolchain programs.
22
25
AR := -ar
23
26
AS := -as
@@ -260,6 +263,12 @@ ifneq ($(findstring rv32i,$(TOCK_ARCH_FAMILIES)),)
260
263
CC_rv32_version_major := $(shell echo $(CC_rv32_version ) | cut -f1 -d.)
261
264
endif
262
265
266
+ # Validate the the toolchain is new enough
267
+ ifneq (1,$(shell [ $(CC_rv32_version_major ) -ge $(MINIMUM_GCC_MAJOR ) ] && echo "1") )
268
+ $(info $(TOOLCHAIN_rv32 )$(CC_rv32 ) -dumpfullversion : $(CC_rv32_version ) )
269
+ $(error Your compiler is too old. Need gcc version >= $(MINIMUM_GCC_MAJOR))
270
+ endif
271
+
263
272
# Match compiler version to support libtock-newlib versions.
264
273
ifeq ($(CC_rv32_version_major ) ,10)
265
274
NEWLIB_VERSION_rv32 := 4.2.0.20211231
@@ -406,6 +415,12 @@ ifneq ($(findstring cortex-m,$(TOCK_ARCH_FAMILIES)),)
406
415
CC_cortex-m_version_major := $(shell echo $(CC_cortex-m_version ) | cut -f1 -d.)
407
416
endif
408
417
418
+ # Validate the the toolchain is new enough
419
+ ifneq (1,$(shell [ $(CC_cortex-m_version_major ) -ge $(MINIMUM_GCC_MAJOR ) ] && echo "1") )
420
+ $(info $(TOOLCHAIN_cortex-m )$(CC_cortex-m ) -dumpfullversion : $(CC_cortex-m_version ) )
421
+ $(error Your compiler is too old. Need gcc version >= $(MINIMUM_GCC_MAJOR))
422
+ endif
423
+
409
424
# Match compiler version to support libtock-newlib versions.
410
425
ifeq ($(CC_cortex-m_version_major ) ,10)
411
426
NEWLIB_VERSION_cortex-m := 4.2.0.20211231
0 commit comments