From e5207b247d4d87f68a91ae3e03d600d2a6265177 Mon Sep 17 00:00:00 2001 From: Francesco Lattanzio Date: Sun, 12 Mar 2017 22:57:27 +0100 Subject: [PATCH] Use C locale when invoking awk If LANG is set to some locale that defines the decimal dot to be something other than a dot (e.g., a comma), then awk will fail to parse GCC and ld's version numbers. --- build-rr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-rr.sh b/build-rr.sh index 2bb318b77..e361c327d 100755 --- a/build-rr.sh +++ b/build-rr.sh @@ -309,7 +309,7 @@ checktools () delay=5 # check that gcc is modern enough - vers=$(${CC:-cc} -E -dM - < /dev/null | awk ' + vers=$(${CC:-cc} -E -dM - < /dev/null | LANG=C awk ' /__GNUC__/ {version += 100*$3} /__GNUC_MINOR__/ {version += $3} END { print version; if (version) exit 0; exit 1; }') \ @@ -326,7 +326,7 @@ checktools () fi # check that ld is modern enough - vers=$(${CC:-cc} -Wl,--version 2>&1 | awk ' + vers=$(${CC:-cc} -Wl,--version 2>&1 | LANG=C awk ' /GNU ld/{version += 100*$NF} END { print version; if (version) exit 0; exit 1; }') \ || die unable to probe ld version