Subject: Re: build.sh -t fails in groff (still)
To: Luke Mewburn <lukem@netbsd.org>
From: Paul Mather <paul@gromit.dlib.vt.edu>
List: port-alpha
Date: 12/02/2002 09:33:12
On Mon, Dec 02, 2002 at 09:04:22AM +1100, Luke Mewburn wrote:
=> I saw a similar problem, which I tracked down to installing new
=> versions of /usr/lib/*crt*.o without having a new compiler, in
=> /usr/bin, and the resultant code didn't run.
=> 
=> In my case, because I was using UPDATE=1, configure did not run again,
=> but the generated tooldir groff ($TOOLDIR/bin/nbgroff) would fail with
=> an error about "not finding the ascii device" (or something like
=> that).  In both cases, the problems are related.
=> 
=> I solved this with something along the lines of:
=> 	cd /usr/src/lib
=> 	make clean
=> 	cd /usr/src/lib/csu
=> 	make MKMAN=no dependall install
=> 	cd /usr/src/lib
=> 	make MKMAN=no dependall install
=> 	cd /usr/src/gnu/lib
=> 	make MKMAN=no clean dependall install
=> 	cd /usr/src/gnu/usr.bin/gcc
=> 	make MKMAN=no clean dependall install

I had to add TOOLCHAIN_MISSING=yes to all the above, because I don't
have a working toolchain directory (see original problem:).  I also
had to add MKGCC=yes to the final make command, otherwise it turned
out to be something of a noop.

=> Now that /usr/bin/g++ and /usr/lib/*crt*.o are back in sync, the c++
=> programs generated by the host (/usr/bin) compiler such as
=> $TOOLDIR/bin/nbgroff should work.

Alas, my /usr/bin/g++ and /usr/lib/*crt*.o are not back in sync.  In
fact, now gcc is hosed, and I can't compile *anything* now without
getting something like the following:

/usr/lib/crt0.o: In function `__start':
/usr/lib/crt0.o(.text+0xcc): undefined reference to `_fini'
/usr/lib/crt0.o(.text+0xe0): undefined reference to `_init'
/usr/lib/crt0.o(.text+0xe4): undefined reference to `_init'
collect2: ld returned 1 exit status

(I'm guessing the installation of the new libs in the above sequence
knackered the existing gcc.)  Anyway, here's how the build of gcc
ended:

clean ===> unprotoize
rm -f unprotoize.o  unprotoize.ln
rm -f a.out [Ee]rrs mklog core *.core .gdbinit unprotoize
dependall ===> backend
cc -O -I. -I/usr/src/gnu/usr.bin/gcc/backend/../arch/alpha -DIN_GCC -DHAIFA -DHAVE_CONFIG_H -I/usr/src/gnu/dist/toolchain/gcc -I/usr/src/gnu/dist/toolchain/gcc/config -I/usr/src/gnu/dist/toolchain/gcc/../include -I/usr/src/gnu/usr.bin/gcc/backend/..  -o gengenrtl /usr/src/gnu/dist/toolchain/gcc/gengenrtl.c
/usr/lib/crt0.o: In function `__start':
/usr/lib/crt0.o(.text+0xcc): undefined reference to `_fini'
/usr/lib/crt0.o(.text+0xe0): undefined reference to `_init'
/usr/lib/crt0.o(.text+0xe4): undefined reference to `_init'
collect2: ld returned 1 exit status
*** Error code 1

Stop.
make: stopped in /usr/src/gnu/usr.bin/gcc/backend
*** Error code 1

Stop.
make: stopped in /usr/src/gnu/usr.bin/gcc


=> I suspect this caused a problem for people using build.sh if you
=> build to DESTDIR=/ and restarted the build after a do-lib-csu was
=> run but before the "make install" for the new compiler occurred...
=> "ouch".

I'm feeling the ouch right now. :-)  I guess I'll have to install a new
comp.tgz from the 20021121-1.6_STABLE snapshot on ftp.netbsd.org to
get a working compiler again.  (Do I also have to install base.tgz---I
forget which has the libs in it.)

Cheers,

Paul.

e-mail: paul@gromit.dlib.vt.edu

"Without music to decorate it, time is just a bunch of boring production
 deadlines or dates by which bills must be paid."
        --- Frank Vincent Zappa