Bug 13011 - Incorrect selection of gcc version
Summary: Incorrect selection of gcc version
Status: RESOLVED WORKSFORME
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 blocker
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-17 22:05 UTC by Vernon Yang
Modified: 2020-06-18 07:23 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vernon Yang 2020-06-17 22:05:07 UTC
Hi:

I use buildroot External toolchain
$ make menuconfig
Toolchain  --->
    External toolchain gcc version (9.x)  ---> 

gcc is ubuntu20.04 by `sudo apt install gcc` install, it's version is 9.3.0, so gcc -dumpversion is 9

but toolchain/helpers.mk check_gcc_version function to display error
I fixed this bug, as follows:

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 44d0c83d1e..7c7819f9a6 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -184,7 +184,7 @@ check_gcc_version = \
                exit 0 ; \
        fi; \
        real_version=`$(1) -dumpversion` ; \
-       if [[ ! "$${real_version}" =~ ^$${expected_version}\. ]] ; then \
+       if [[ ! "$${real_version}" =~ ^$${expected_version} ]] ; then \
                printf "Incorrect selection of gcc version: expected %s.x, got %s\n" \
                        "$${expected_version}" "$${real_version}" ; \
                exit 1 ; \
Comment 1 Thomas Petazzoni 2020-06-18 07:23:51 UTC
Thanks for the report! This is already fixed in master in commit https://git.buildroot.org/buildroot/commit/toolchain?id=5303e72a80e44c265473706a2d4f3acb5010814f