Skip to content

Commit

Permalink
Use C locale when invoking awk
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fltt authored and anttikantee committed Mar 16, 2017
1 parent bbfbaf4 commit e5207b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build-rr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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; }') \
Expand All @@ -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
Expand Down

0 comments on commit e5207b2

Please sign in to comment.