Subject: more build funzies
To: None <port-sparc64@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc64
Date: 07/23/2002 15:16:24
I poked at things a bit more, got nondeterministic results with the U1
(run a build, get one error, run the same build, get a different error;
I even, when building something non-NetBSD, got three different results
on three successive attempts to build the same stuff: error 1, error 2,
and success) and therefore switched to a U2, figuring that the U1 had
flaky hardware of some sort.

On the U2, I have other troubles, and they appear repeatable.

With a fresh source tree, I get

includes ===> gnu/lib/libstdc++/include
/usr/obj/tools/tools.NetBSD-1.6D-sparc64/bin/sparc64--netbsd-c++ -O -ffixed-g4  -mcmodel=medlow  -Werror -nostdinc++ -isystem /usr/include/g++  -nostdinc -isystem /usr/include   -o /usr/src/gnu/lib/libstdc++/include/../../../dist/toolchain/libstdc++/valarray /usr/src/gnu/lib/libstdc++/include/../../../dist/toolchain/libstdc++/valarray.cc 
In file included from /usr/include/g++/numeric:31,
                 from /usr/include/g++/std/std_valarray.h:39,
                 from /usr/src/gnu/lib/libstdc++/include/../../../dist/toolchain/libstdc++/valarray.cc:1:
/usr/include/g++/stl_relops.h: In function `bool operator !=(const _Tp &, const _Tp &)':
/usr/include/g++/stl_relops.h:37: template with C linkage
/usr/include/g++/stl_relops.h: In function `bool operator >(const _Tp &, const _Tp &)':
/usr/include/g++/stl_relops.h:42: template with C linkage
/usr/include/g++/stl_relops.h: In function `bool operator <=(const _Tp &, const _Tp &)':
/usr/include/g++/stl_relops.h:47: template with C linkage
/usr/include/g++/stl_relops.h: In function `bool operator >=(const _Tp &, const _Tp &)':
/usr/include/g++/stl_relops.h:52: template with C linkage
In file included from /usr/include/g++/numeric:34,
                 from /usr/include/g++/std/std_valarray.h:39,
                 from /usr/src/gnu/lib/libstdc++/include/../../../dist/toolchain/libstdc++/valarray.cc:1:
/usr/include/g++/stl_iterator.h: At top level:
/usr/include/g++/stl_iterator.h:47: template with C linkage
/usr/include/g++/stl_iterator.h:63: template with C linkage

There follow 395 more lines of similar errors, from stl_iterator.h,
stl_function.h, stl_numeric.h, stl_pair.h, type_traits.h,
stl_algobase.h, stl_construct.h, stl_uninitialized.h, and
stl_tempbuf.h; finally, there follows

/usr/include/g++/stl_tempbuf.h: In function `void return_temporary_buffer(_Tp *)':
/usr/include/g++/stl_tempbuf.h:74: template with C linkage
/usr/include/g++/stl_tempbuf.h: At top level:
/usr/include/g++/stl_tempbuf.h:79: template with C linkage
/usr/include/g++/stl_tempbuf.h:131: parse error before `&'
/usr/include/g++/stl_tempbuf.h:132: parse error before `&'
/usr/include/g++/stl_tempbuf.h:132: `_Temporary_buffer<_ForwardIterator,_Tp>::operator =(...)' must take exactly one argument
/usr/include/g++/stl_tempbuf.h:132: `_Temporary_buffer<_ForwardIterator,_Tp>::operator =(...)' must take exactly one argument
/usr/include/g++/stl_tempbuf.h:133: confused by earlier errors, bailing out
*** Error code 1

Stop.
nbmake: stopped in /usr/src/gnu/lib/libstdc++/include

and the usual cascade of make messages walking back up the recursion
tree.

However, in the process, it has overwritten /usr/include with
incompatible include files, and a second attempt to run build.sh
produces

dependall ===> toolchain
...
cc -c -DCROSS_COMPILE -DIN_GCC -DHAIFA   -O   -DHAVE_CONFIG_H    -I. -I/usr/src/tools/toolchain/../../gnu/dist/toolchain/gcc -I/usr/src/tools/toolchain/../../gnu/dist/toolchain/gcc/config -I/usr/src/tools/toolchain/../../gnu/dist/toolchain/gcc/../include /usr/src/tools/toolchain/../../gnu/dist/toolchain/gcc/c-iterate.c
cc -DCROSS_COMPILE -DIN_GCC -DHAIFA   -O   -DHAVE_CONFIG_H  -o cc1 toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o  function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o  intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o real.o  dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o  integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o varray.o  regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o  insn-peep.o reorg.o haifa-sched.o final.o recog.o reg-stack.o  insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o  profile.o insn-attrtab.o sparc.o getpwd.o  convert.o  mbchar.o dyn-string.o splay-tree.o graph.o sbitmap.o resource.o hash.o c-parse.o c-lang.o c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o  c-aux-info.o c-common.o c-iterate.o obstack.o        ../libiberty/libiberty.a
toplev.o: In function `get_run_time':
toplev.o(.text+0xe8): undefined reference to `__times13'
*** Error code 1

Replacing /usr/include with the stuff from the snapshot restores the
first (mis)behaviour, for one run.

I'm going to be playing with it some more, trying to see if I can do an
UNPRIVED build (which _can't_ overwrite /usr/include) into another
directory; ISTM that the first error above could be caused by a
partially-changed /usr/include - indeed, the command that errors out is
an attempt to compile something, but is run as part of a "make
includes" and hence presumably before the full include tree has been
built.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B