Subject: toolchain/25586: crossbuilding fails on Linux because of spaces in uname output
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <rumi@rtfm.hu>
List: netbsd-bugs
Date: 05/15/2004 22:32:36
>Number:         25586
>Category:       toolchain
>Synopsis:       crossbuilding fails on Linux because of spaces in uname output
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 15 22:33:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Rumi Szabolcs
>Release:        -current
>Organization:
>Environment:
Linux scrapyard 2.4.22-bk48-la1-xfs #1 SMP Mon Nov 10 09:19:28 CET 2003 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz GenuineIntel GNU/Linux
>Description:
I was trying to start a crossbuild of the latest -current of
netbsd/alpha on a Linux/i386 machine. I detected that build.sh
fails because some script breaks probably due to the Linux
'uname -p' output having spaces in it.

>How-To-Repeat:
Try this on a Linux box that has an 'uname -p' output of this sort:
Intel(R) Pentium(R) 4 CPU 2.60GHz

./build.sh -U -D /home/rumi/src/netbsd/build -R /home/rumi/src/netbsd/release -m alpha tools

And this is where it ended up:

*** Failed target:  obj
*** Failed command: cd /export/home/rumi/src/netbsd/src/tools; here=`/bin/pwd`/; subdir=${here#/usr/src/}; if [ "$here" != "$subdir" ]; then if [ ! -d /usr/obj ]; then echo "BSDOBJDIR /usr/obj does not exist, bailing..."; exit 1; fi; subdir=${subdir%/}; dest=/usr/obj/$subdir; if [ -x /export/home/rumi/src/netbsd/src/tooldir.Linux-2.4.22-bk48-la1-xfs-Intel(R) Pentium(R) 4 CPU 2.60GHz/bin/nbstat ] && ttarg=`/export/home/rumi/src/netbsd/src/tooldir.Linux-2.4.22-bk48-la1-xfs-Intel(R) Pentium(R) 4 CPU 2.60GHz/bin/nbstat -qf '%Y' ${here}obj` && [ "$dest" = "$ttarg" ]; then : ; else echo '# ' " objdir $dest"; rm -rf obj; ln -s $dest obj; fi; if [ ! -d $dest ]; then mkdir -p $dest; else true; fi; else true ; dest=${here}obj ; if [ ! -d obj ] || [ -h obj ]; then echo '# ' " objdir $dest"; rm -f obj; mkdir $dest; fi ; fi;
*** Error code 2

Stop.
nbmake: stopped in /export/home/rumi/src/netbsd/src/tools

And no, this is not a bash incompatibility issue :-)

>Fix:
using 'uname -m' instead of 'uname -p' on Linux would probably be
a better approach than using braces or escaping the spaces in
the 'uname -p' output (which would be advisable otherwise).

>Release-Note:
>Audit-Trail:
>Unformatted: