Subject: Re: NOTICE: i386 port switched to ELF binary format
To: None <paul@whooppee.com>
From: Rafal Boni <rafal@mediaone.net>
List: current-users
Date: 07/06/1999 12:26:28
In message <Pine.NEB.4.10.9907051646110.6612-100000@pc1.whooppee.com>, 
Paul wrote:

-> So now, the instruction sequence seems to be:
-> 
-> 0)  Get the -current sources
-> 
-> 1)  Copy all the shared objects from /usr/lib to /emul/aout/usr/lib
-> 
-> 2)  Boot from a kernel with EXEC_ELF, EXEC_AOUT, and COMPAT_AOUT all
->     defined
-> 
-> 3)  setenv DESTDIR /../.
->     setenv OBJECT_FMT ELF
-> 
-> 4)  cd /usr/src; make includes
-> 
-> 5)  cd /usr/src/share/mk; make install
-> 
-> 6)  setenv BOOTSTRAP_ELF 1
-> 
-> 7)  cd /usr/src/gnu/usr.bin
->     for i in binutils.* gas.new ld.new egcs/*; do

Should be 'binutils/*' instead of 'binutils.*'

-> 	(cd $i; make cleandir; make depend; make; \
-> 	 setenv OBJECT_FMT a.out; make; setenv OBJECT_FMT ELF)
->     done
->     #	(expect the link in the first make to fail)
-> 
-> 8)  for i in binutils gas.new ld.new egcs; do
->     (cd $i, make install)
-> 
-> 9)  cd /usr/src/libexec/ld.elf_so; 			<======new
->     make cleandir; make depend; make; make install	<======new

I had to build libc_pic.a before I could do this, so add:

8.5) cd /usr/src/lib/libc
     make cleandir; make depend; make (don't make install yet)

-> 10) cd /usr/src/lib/csu
->     make cleandir; make depend; make; make install
-> 
-> 11) cd /usr/src
->     make build

It took me a few 'make build's before I got things working.  I found that
re-installing the ELF tools in /usr/src/bin, /usr/src/sbin and various
toolchain-related utilities (make, mkdep, egcs, ld, gas, ...) helped
a great deal.  (Of course to do this, you need to have built at least
the libs and installed them).

BTW, thanks to all for the instructions.  I ended up going the source 
upgrade route after (accidentally) installing new /usr/share/mk files
and finding that I could no longer build due to ELF being the default.
I guess I could have forced OBJECT_FMT=a.out in /etc/mk.conf, but was
not aware of that at the time.  After rebuilding gcc but forgetting gas,
I decided I'd better just rebuild the world (with the help of a source
tree and sane a.out environment on my other machine), before I lose my
mind 8-)

--rafal

----
Rafal Boni                                                  rafal@mediaone.net