From 82fb2768aaec2bc738826ebb36c37ac26f22ef79 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 12 Sep 2017 18:50:33 +0800 Subject: [PATCH] build system: trim crosstool-ng commit ID when checking version 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 --- make/project.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/project.mk b/make/project.mk index a56025660c..b140db7145 100644 --- a/make/project.mk +++ b/make/project.mk @@ -489,11 +489,11 @@ list-components: # 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