toolchain: adjust version check to allow for single numbers
PATCH 1/1 toolchain: adjust version check to allow for single numbers
A gcc compiler, which was configured with --with-gcc-major-version-only, will only return a single number. (debian does this for example).
A simple modification allows the check to work with both single numbers (eg. '9') and full versions (eg. '9.2.1').
--- toolchain/helpers.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
toolchain/helpers.mk +1 -1
@@ -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 ; \
Signature · 1 line
2.26.2
PATCH 1/1 toolchain: adjust version check to allow for single numbers
Hi,
Le 11/06/2020 ? 01:53, Norbert Lange a ?crit?:
Quoted 3 lines
A gcc compiler, which was configured with --with-gcc-major-version-only, will only return a single number. (debian does this for example).
This option is available since gcc 8:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3c36aa6ba2be894d4092a6ce8129d39ef846c964
So older toolchain always provide a full version.
Best regards,
Romain
Quoted 23 lines
A simple modification allows the check to work with both single numbers (eg. '9') and full versions (eg. '9.2.1').
Signed-off-by Norbert Lange <[email protected]>--- toolchain/helpers.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)toolchain/helpers.mk +1
-1@@ -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 ; \
Yann E. MORIN
AppliedPATCH 1/1 toolchain: adjust version check to allow for single numbers
In reply to Norbert LangeNorbert, All,
On 2020-06-11 01:53 +0200, Norbert Lange spake thusly:
Quoted 8 lines
A gcc compiler, which was configured with --with-gcc-major-version-only, will only return a single number. (debian does this for example).
A simple modification allows the check to work with both single numbers (eg. '9') and full versions (eg. '9.2.1').
Signed-off-by Norbert Lange <[email protected]>
Applied to master, thanks.
Regards,
Yann E. MORIN.
Quoted 24 lines
--- toolchain/helpers.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)toolchain/helpers.mk +1
-1@@ -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 ; \Signature · 6 lines
2.26.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 toolchain: adjust version check to allow for single numbers
In reply to Norbert LangeQuoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Norbert" == Norbert Lange <[email protected]> writes:
A gcc compiler, which was configured with --with-gcc-major-version-only, will only return a single number. (debian does this for example).
A simple modification allows the check to work with both single numbers (eg. '9') and full versions (eg. '9.2.1').
Signed-off-by Norbert Lange <[email protected]>
Committed to 2020.02.x and 2020.05.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard