[git commit] gcc-version.sh: fix for "invalid number" message during Android NDK builds

Denys Vlasenko vda.linux at googlemail.com
Thu Apr 22 07:21:39 UTC 2021


commit: https://git.busybox.net/busybox/commit/?id=6c6470b3847d12b2d7504fa37fbf871c46792d77
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

A CR in the gcc output would cause the following to show throughout build:

: invalid numberbox-1.32.1/scripts/gcc-version.sh: line 12: printf: 9

Signed-off-by: Chris Renshaw <osm0sis at outlook.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 scripts/gcc-version.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh
index 9376ed4fb..0eb27c7a6 100755
--- a/scripts/gcc-version.sh
+++ b/scripts/gcc-version.sh
@@ -7,6 +7,6 @@
 #
 
 compiler="$*"
-
-MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | grep . | tail -n 1)
+# tr -d '\r': fix up msdos-style line endings (Cygwin et al)
+MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tr -d '\r' | tail -n 1)
 printf '%02d%02d\n' $MAJ_MIN


More information about the busybox-cvs mailing list