Since 2.11.0, git does not default to 7 characters for short commit IDs,
instead automatically estimating the number of characters based on
repository size [1]. If the toolchain was compiled on a computer with
new version of git installed, commit ID will contain 8 characters, and
the check for the toolchain version will fail. As a workaround, trim the
commit ID to 7 characters when checking the version.
[1] https://github.com/git/git/commit/
e6c587c733b4634030b353f4024794b08bc86892
# the part after the brackets is extracted into TOOLCHAIN_GCC_VER.
ifdef CONFIG_TOOLPREFIX
ifndef MAKE_RESTARTS
-TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(([^)]*).*|\1|gp')
+TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|.*crosstool-ng-([0-9]+).([0-9]+).([0-9]+)-([0-9]+)-g([0-9a-f]{7}).*|\1.\2.\3-\4-g\5|gp')
TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(.*\)\ (.*)|\1|gp')
# Officially supported version(s)
-SUPPORTED_TOOLCHAIN_COMMIT_DESC := crosstool-NG crosstool-ng-1.22.0-70-gfa0bad1b
+SUPPORTED_TOOLCHAIN_COMMIT_DESC := 1.22.0-70-gfa0bad1
SUPPORTED_TOOLCHAIN_GCC_VERSIONS := 5.2.0
ifdef TOOLCHAIN_COMMIT_DESC