toolchain/external: ensure gcc version is known
PATCH 1/1 toolchain/external: ensure gcc version is known
Currently, when a preconfigured prebuilt toolchain forgets to specify its gcc version, the error message is a bit misleading, like:
Incorrect selection of gcc version: expected .x, got 4.9.2
Add a an explicit check for the gcc version being set, that reports a better error message.
---
Note: we do not need the same check for kernel headers, because for those, we really ensure a version is set, namely 2.6.x, whereas we do not set a default 'REALLY_OLD' gcc version (and we can't really do so).
--- toolchain/helpers.mk | 4 ++++ 1 file changed, 4 insertions(+)
toolchain/helpers.mk +4 -0
@@ -193,6 +193,10 @@ check_kernel_headers_version = \ # check_gcc_version = \ expected_version="$(strip $2)" ; \ + if [ -z "$${expected_version}" ]; then \ + printf "Internal error, gcc version unknown (no GCC_AT_LEAST_X_Y selected)\n"; \ + exit 1 ; \ + fi; \ real_version=`$(1) --version | sed -r -e '1!d; s/^[^)]+\) ([^[:space:]]+).*/\1/;'` ; \ if [[ ! "$${real_version}" =~ ^$${expected_version}\. ]] ; then \ printf "Incorrect selection of gcc version: expected %s.x, got %s\n" \
Signature · 1 line
1.9.1
Thomas Petazzoni
AppliedPATCH 1/1 toolchain/external: ensure gcc version is known
Dear Yann E. MORIN,
Quoted 11 lines · Yann E. MORIN
Currently, when a preconfigured prebuilt toolchain forgets to specify its gcc version, the error message is a bit misleading, like:
Incorrect selection of gcc version: expected .x, got 4.9.2
Add a an explicit check for the gcc version being set, that reports a better error message.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Thomas Petazzoni <[email protected]>
Quoted 7 lines
---
Note: we do not need the same check for kernel headers, because for those, we really ensure a version is set, namely 2.6.x, whereas we do not set a default 'REALLY_OLD' gcc version (and we can't really do so).--- toolchain/helpers.mk | 4 ++++ 1 file changed, 4 insertions(+)
Applied, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com