Skip to content

Commit efd7700

Browse files
committed
build: restore check for minimum compiler version and enforce >= 13
1 parent bb69a2f commit efd7700

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

Helpers.mk

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,12 @@ ifdef TOCK_USERLAND_BASE_DIR
4040
endif
4141
endif
4242

43-
# # Validate the the toolchain is new enough (known not to work for gcc <= 5.1)
44-
# CC_VERSION_MAJOR := $(shell $(CC) -dumpversion | cut -d '.' -f1)
45-
# ifeq (1,$(shell expr $(CC_VERSION_MAJOR) \>= 6))
46-
# # Opportunistically turn on gcc 6.0+ warnings since we're already version checking:
47-
# override CPPFLAGS += -Wduplicated-cond # if (p->q != NULL) { ... } else if (p->q != NULL) { ... }
48-
# override CPPFLAGS += -Wnull-dereference # deref of NULL (thought default if -fdelete-null-pointer-checks, in -Os, but no?)
49-
# else
50-
# ifneq (5,$(CC_VERSION_MAJOR))
51-
# $(info CC=$(CC))
52-
# $(info $$(CC) -dumpversion: $(shell $(CC) -dumpversion))
53-
# $(error Your compiler is too old. Need gcc version > 5.1)
54-
# endif
55-
# CC_VERSION_MINOR := $(shell $(CC) -dumpversion | cut -d '.' -f2)
56-
# ifneq (1,$(shell expr $(CC_VERSION_MINOR) \> 1))
57-
# $(info CC=$(CC))
58-
# $(info $$(CC) -dumpversion: $(shell $(CC) -dumpversion))
59-
# $(error Your compiler is too old. Need gcc version > 5.1)
60-
# endif
61-
# endif
43+
# Validate the the toolchain is new enough (known not to work for gcc <= 5.1)
44+
CC_VERSION_MAJOR := $(shell $(CC) -dumpversion | cut -d '.' -f1)
45+
ifneq (1,$(shell expr $(CC_VERSION_MAJOR) \>= 13))
46+
$(info $(CC) -dumpversion: $(shell $(CC) -dumpversion))
47+
$(error Your compiler is too old. Found version $(CC_VERSION_MAJOR). Need gcc version >= 13)
48+
endif
6249

6350

6451
# Format check rule

0 commit comments

Comments
 (0)