Skip to content

Commit e5207b2

Browse files
flttanttikantee
authored andcommitted
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.
1 parent bbfbaf4 commit e5207b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

build-rr.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ checktools ()
309309
delay=5
310310

311311
# check that gcc is modern enough
312-
vers=$(${CC:-cc} -E -dM - < /dev/null | awk '
312+
vers=$(${CC:-cc} -E -dM - < /dev/null | LANG=C awk '
313313
/__GNUC__/ {version += 100*$3}
314314
/__GNUC_MINOR__/ {version += $3}
315315
END { print version; if (version) exit 0; exit 1; }') \
@@ -326,7 +326,7 @@ checktools ()
326326
fi
327327

328328
# check that ld is modern enough
329-
vers=$(${CC:-cc} -Wl,--version 2>&1 | awk '
329+
vers=$(${CC:-cc} -Wl,--version 2>&1 | LANG=C awk '
330330
/GNU ld/{version += 100*$NF}
331331
END { print version; if (version) exit 0; exit 1; }') \
332332
|| die unable to probe ld version

0 commit comments

Comments
 (0)