Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Aug 1995 22:14:53 GMT
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        current@freebsd.org
Subject:   "ld: /usr/lib/crt0.o: Undefined error: 0" problem solved
Message-ID:  <199508072214.WAA05145@silvia.HIP.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help
The solution was NOT TO CLOSE STDIN when you run make world, as hard
as it is to believe.

I decided to try a make world on a 2.0.5R system (constructed on my
second disk from the CDROM) with a -stable /usr/src.  When I got the
same error as -current, which doesn't share a bit of / or /usr with
the -stable tree, I knew it was something incredibly outrageous.

So I remembered that I started using the "<&-" trick last week, and
changed the command line from

(date; make world; date) > /usr/obj/make.00 2>&1 <&- &

to 

(date; make world; date) > /usr/obj/make.00 2>&1 </dev/null &

and presto!  The make world got past rtld! :)

Can someone else reproduce this?  If so, I'll file a PR.

Satoshi

P.S. A simpler example:

=======
>> cc -o hexrand hexrand.c

>> cc -o hexrand hexrand.c <&-
ld: /usr/lib/crt0.o: Undefined error: 0
=======

P.P.S. Relevant part from the make log:

--------------------------------------------------------------
 Rebuilding tools needed to build the libraries
--------------------------------------------------------------

cd /y/b/src/gnu/usr.bin/ld &&  make depend all install cleandir obj
 :
===> rtld
rm -f .depend
files="/y/b/src/gnu/usr.bin/ld/rtld/../i386/mdprologue.S";  if [ "$files" != "" ]; then  mkdep -a  -I/y/b/src/gnu/usr.bin/ld/rtld/.. -I/y/b/src/gnu/usr.bin/ld/rtld -I/y/b/src/gnu/usr.bin/ld/rtld/../i386 -DRTLD  $files;  fi
files="/y/b/src/gnu/usr.bin/ld/rtld/rtld.c /y/b/src/gnu/usr.bin/ld/rtld/malloc.c /y/b/src/gnu/usr.bin/ld/rtld/../shlib.c /y/b/src/gnu/usr.bin/ld/rtld/../etc.c /y/b/src/gnu/usr.bin/ld/rtld/../i386/md.c";  if [ "$files" != "" ]; then  mkdep -a  -I/y/b/src/gnu/usr.bin/ld/rtld/.. -I/y/b/src/gnu/usr.bin/ld/rtld -I/y/b/src/gnu/usr.bin/ld/rtld/../i386 -DRTLD $files;  fi
files="  ";  if [ "$files" != "  " ]; then  mkdep -a   -I/y/b/src/gnu/usr.bin/ld/rtld/.. -I/y/b/src/gnu/usr.bin/ld/rtld -I/y/b/src/gnu/usr.bin/ld/rtld/../i386 -DRTLD $files;  fi
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/ld.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/symbol.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/lib.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/shlib.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/warnings.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/etc.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/rrs.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/xbits.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386   -c /y/b/src/gnu/usr.bin/ld/i386/md.c
cc -O2 -m486 -pipe -I/y/b/src/gnu/usr.bin/ld -I/y/b/src/gnu/usr.bin/ld/i386    -Xlinker -Bstatic -o ld ld.o symbol.o lib.o shlib.o warnings.o etc.o rrs.o xbits.o 
md.o  -lgnumalloc
ld: /usr/lib/crt0.o: Undefined error: 0
*** Error code 1

Stop.
*** Error code 1

Stop.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508072214.WAA05145>