Subject: toolchain/19997: build.sh fails on a Linux host (sunlabel compile fails)
To: None <gnats-bugs@gnats.netbsd.org>
From: Richard Earnshaw <rearnsha@cambridge.arm.com>
List: netbsd-bugs
Date: 01/22/2003 15:44:41
>Number:         19997
>Category:       toolchain
>Synopsis:       build.sh fails on a Linux host (sunlabel compile fails)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 22 07:45:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Richard Earnshaw
>Release:        NetBSD-current
>Organization:
ARM
-- 
>Environment:
	
	
System: Redhat 7.2 x86
Target: NetBSD shark1.cambridge.arm.com 1.6K NetBSD 1.6K (GENERIC) #0: Sun Dec 1 17:52:23 GMT 2002 rearnsha@pc960.cambridge.arm.com:/work/rearnsha/netbsd/build/src/shark/sys/arch/shark/compile/GENERIC shark
Target-Architecture: arm
Target-Machine: shark
>Description:
	The file BUILDING says that build.sh should build the system on any
	host that has a POSIX compatible /bin/sh.  However, building the
	cross-tool version of sunlabel fails because it includes a 
	NetBSD-specific header file.

	Also, having failed to build sunlabel, the script fails to terminate,
	so the error remains undetected until much later in the build process.

	The precise error is:

	
  dependall ===> sunlabel
  --- .depend ---
  /work/rearnsha/netbsd/build/tools/shark/bin/nbhost-mkdep -a -DDISTRIB -I/work/rearnsha/netbsd/build/src/shark/tools/compat -I/work/rearnsha/netbsd/build/src/shark/tools/compat/include  -I/work/rearnsha/netbsd/src/tools/sunlabel/../compat -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  /work/rearnsha/netbsd/src/tools/sunlabel/../../usr.sbin/sunlabel/sunlabel.c
  /work/rearnsha/netbsd/src/tools/sunlabel/../../usr.sbin/sunlabel/sunlabel.c:54:27: sys/disklabel.h: No such file or directory
  --- afterdepend ---
  --- dependall ---
  --- sunlabel.lo ---
  cc -O -DDISTRIB -I/work/rearnsha/netbsd/build/src/shark/tools/compat -I/work/rearnsha/netbsd/build/src/shark/tools/compat/include  -I/work/rearnsha/netbsd/src/tools/sunlabel/../compat -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -c -o sunlabel.lo.o /work/rearnsha/netbsd/src/tools/sunlabel/../../usr.sbin/sunlabel/sunlabel.c
  /work/rearnsha/netbsd/src/tools/sunlabel/../../usr.sbin/sunlabel/sunlabel.c:54:27: sys/disklabel.h: No such file or directory
  *** [sunlabel.lo] Error code 1
  1 error

  nbmake: stopped in /work/rearnsha/netbsd/src/tools/sunlabel
  *** [dependall] Error code 2
	
>How-To-Repeat:
	Run build.sh on a linux machine to build (the following script may
	help)

#! /bin/sh

if [ $# != 1 ] ; then
        echo "usage $0 <evbarm|shark>"
        exit 1
fi

target=$1
build=`date +%Y%m%d`
cd /work/rearnsha/netbsd

echo "Deleting old build"
rm -rf build/{dist,install,src,tools}/${target}/*

echo "Saving old log"
mv -f build/log/${target}.log build/log/${target}.log.old

cd src

echo "Starting build"
time nice -5 ./build.sh -a arm -B rearnsha-${build} -j 2 -m $target -D /work/rearnsha/netbsd/build/install/$target -O /work/rearnsha/netbsd/build/src/$target -R /work/rearnsha/netbsd/build/dist/$target -T /work/rearnsha/netbsd/build/tools/$target -U > /work/rearnsha/netbsd/build/log/${target}.log 2>&1
x=$?
if [ $x = 0 ]; then
  echo "Build complete"
else
  echo "Build failed"
fi
exit $x

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