Subject: build looping recursively
To: None <tech-toolchain@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-toolchain
Date: 07/17/2002 16:07:26
I did a cvs update to 'current' this morning, built a kernel,
rebooted and tried to build userspace....

The build would have UPDATE set and needed to build the 1.6D tools.
Now instead of failing because 'groff' didn't exist it go as far as
saying:

Making all in doc
Making all in po
/bin/sh ./libtool --mode=link cc -W -Wall -O  -o as-new  ...
cc -W -Wall -O -o as-new ...
.../nbmake -f /src/tools/toolchain/../Makefile.gnuwrap  all-recursive
Making all in po
/bin/sh ./libtool --mode=link cc -W -Wall -O  -o ld-new  ...
cc -W -Wall -O -o ld-new ldgram.o ...
running /bin/sh /src/tools/toolchain/../../gnu/dist/toolchain/gcc/configure ...
loading cache ../config.cache
checking LIBRARY_PATH variable... ok  
checking GCC_EXEC_PREFIX variable... ok
checking host system type... i386-unknown-netbsdelf1.6B
checking target system type... i386--netbsdelf
checking build system type... i386-unknown-netbsdelf1.6B
checking for gcc... (cached) cc 
checking whether the C compiler (cc -O ) works... yes
checking whether the C compiler (cc -O ) is a cross-compiler... no 
checking whether we are using GNU C... (cached) yes
checking whether cc accepts -g... (cached) yes
checking whether /obj/tools/tools.NetBSD-1.6D-i386/bin/nbmake -f /src/tools/toolchain/../Makefile.gnuwrap sets ${MAKE}...

investigation showed that the system was busy and generating more and
more processes.  The process loop seems to be:

/bin/sh -ec if [ ! -f config.status ] ; then  echo You must configure gcc.
	Look at the INSTALL file for details.;  false;  else
	LANGUAGES="c++ f77 objc" /bin/sh config.status --recheck;  fi
/bin/sh /src/tools/toolchain/../../gnu/dist/toolchain/gcc/configure
	--host=i386-unknown-netbsdelf1.6B --target=i386--netbsdelf
	--prefix=/obj/tools/tools.NetBSD-1.6B-i386
	--srcdir=/src/tools/toolchain/../../gnu/dist/toolchain/gcc
	--program-transform-name=s,^,i386--netbsdelf-,
	--with-gcc-version-trigger=//src/gnu/dist/toolchain/gcc/version.c
	--with-gnu-as --with-gnu-ld --disable-nls --disable-shared
	--cache-file=../config.cache --no-create --no-recursion
/bin/sh /src/tools/toolchain/../../gnu/dist/toolchain/gcc/configure ...
grep temp=
/obj/tools/tools.NetBSD-1.6D-i386/bin/nbmake
	-f /src/tools/toolchain/../Makefile.gnuwrap -f conftestmake

I tracked down part of the loop to the gcc configure script:
    gnu/dist/toolchain/gcc/configure
where it does (circa line 1270):
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:1263: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; the
n
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftestmake <<\EOF
all:
        @echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`

Although I couldn't find out exactly what the make in the last line
was trying to do that caused the recursion.

An immediate rerun of build.sh failed saying that gcc must be configured.
A build after deleting all of obj/tools seems to be working.

I've still got the output log (stdout+stderr) from the first build.

	David

-- 
David Laight: david@l8s.co.uk