[Bug 13701] Long-standing build output gcc-version spam on Cygwin host

bugzilla at busybox.net bugzilla at busybox.net
Sun Apr 18 14:26:51 UTC 2021


https://bugs.busybox.net/show_bug.cgi?id=13701

--- Comment #9 from Chris Renshaw <osm0sis at outlook.com> ---
I added this to gcc_version.sh to tease out the issue more, and turns out it's
the NDK gcc which is being weird:

echo "$compiler:$MAJ_MIN:" >> ~/compiler.log

And from compiler.log, it is indeed a newline causing the issue:

/home/Chris/x-tools/i686-linux-android-r15c-api21-unified/bin/i686-linux-android-gcc:4
9
:

Running it directly:

$ scripts/gcc-version.sh
/home/Chris/x-tools/i686-linux-android-r15c-api21-unified/bin/i686-linux-android-gcc
: invalid numberion.sh: line 12: printf: 9
0409

It doesn't look broken compared to any of the output we've looked at, but
somehow the MAJ_MIN= captures a newline:

Chris at Homebase ~/busybox-1.32.1
$ echo $compiler
/home/Chris/x-tools/i686-linux-android-r15c-api21-unified/bin/i686-linux-android-gcc

Chris at Homebase ~/busybox-1.32.1
$ echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1
4 9

Even just trying to echo $MAJ_MIN on the command line gives some weird
results... the trailing : should display somewhere, but doesn't:

Chris at Homebase ~/busybox-1.32.1
$ MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)

Chris at Homebase ~/busybox-1.32.1
$ echo ":${MAJ_MIN}:"
:4 9

And it gets weirder:

Chris at Homebase ~/busybox-1.32.1
$ echo ":$MAJ_MIN"
:4 9

Chris at Homebase ~/busybox-1.32.1
$ echo ":$MAJ_MIN:"
:4 9

Chris at Homebase ~/busybox-1.32.1
$ echo ":$MAJ_MIN::"
:: 9

Chris at Homebase ~/busybox-1.32.1
$ echo ":$MAJ_MIN:::"
:::9

Chris at Homebase ~/busybox-1.32.1
$ echo ":$MAJ_MIN::::"
::::

I guess gcc_version.sh still having the correct output is why I landed on
2>/dev/null as the fix back when I made the submitted patch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list