]> granicus.if.org Git - esp-idf/commitdiff
build system: trim crosstool-ng commit ID when checking version
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 12 Sep 2017 10:50:33 +0000 (18:50 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Wed, 13 Sep 2017 09:27:47 +0000 (17:27 +0800)
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

index a56025660cbeb981efe0c741465a6863fc25b0a5..b140db7145b3e4616d8ab81d7a179bba3b368b32 100644 (file)
@@ -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