Subject: Re: NOTICE: i386 port switched to ELF binary format
To: Frank van der Linden <frank@wins.uva.nl>
From: Matt Ragan <mragan@dev.tivoli.com>
List: port-i386
Date: 07/05/1999 18:14:10
Frank van der Linden wrote:

> On Mon, Jul 05, 1999 at 09:55:40PM +0900, Takahiro Kambe wrote:
> > > be aware that ELF is now the default binary format, so you'll have
> > > to deal with this after you next updated your sources and want to
> > > recompile your system.
> > Is there any way to use AOUT format?
>
> If you want to keep on using the a.out format, you can do this by
> reverting the change to /usr/src/share/mk/bsd.own.mk. Look for the
> part where OBJECT_FMT is set, and change it back for the i386 case.
> >
> > How do I upgrade by compiling sources, without getting snapshot?
>
> That's not straightforward. Be prepared to get yourself out of trouble
> in strange ways if it fails. Basically you have to:
>
>         0) have today's sources
>         1) create /emul/aout as described before (i.e. copy all
>            shared libs to /emul/aout/usr/lib)
>         2) boot a kernel with COMPAT_AOUT (as well as EXEC_ELF32, of course)
>         3) setenv DESTDIR /..
>         4) setenv OBJECT_FMT ELF
>         5) cd /usr/src ; make includes
>         6) cd /usr/src/share/mk ; make install
>         4) for each directory in
>            /usr/src/gnu/usr.bin/{binutils,gas.new,ld.new,egcs} do:
>            cd <directory>
>            make
>            (link will fail because OBJECT_FMT is set to elf)

You also need to do a:

setenv BOOTSTRAP_ELF

at this point, or gas will not build correctly, since it will try to link
obj-aout.o rather than obj-elf.o.  Setting BOOTSTRAP_ELF will force it to DTRT.

>
>            setenv OBJECT_FMT a.out
>            make
>            setenv OBJECT_FMT ELF
>         5) make install in each of those directories
>            (you now have a toolchain of a.out binaries that will generate
>             ELF binaries)
>         6) cd /usr/src/lib/csu ; make && make install
>         7) you can now try a "make build" in /usr/src
>
> I _think_ that is what I did, but I can't guarantee anything. If you
> want to it this way, good luck, but if you end up having to repair
> the system by booting single-user or from floppy, don't blame me ;-)
>
> - Frank

--
Matt Ragan                                EMEA IT/Network Support
Tivoli Systems (UK) Ltd.                      +44 (0) 1753 780070
Sefton Park    Bells Hill    Stoke Poges    Bucks   SL2 4HD    UK