Subject: NetBSD egcs on arm32: status report
To: None <port-arm32@NetBSD.ORG>
From: Chris G. Demetriou <cgd@pa.dec.com>
List: port-arm32
Date: 04/19/1998 22:48:46
So, as promised a few days ago, here's a status report on the use of
EGCS (the one in the NetBSD source tree, which is 1.0.2, with a few
local hacks) on the arm32.


*** I don't really recommend that users try this at this point,
*** because if something goes wrong and you're not Very careful,
*** you'll end up with a nonfunctional system.


Anyway, the current code works (i.e. the system has rebuilt a couple
of times now), with a few adjustments to the rest of the system.

(1) some bits that used to fail to compile with optimization now work
(dhcp/server).

(2) some bits that used to work now fail to compile with optimization
(xntpd).

(3) PIC + -O doesn't seem to compile correct code, or at least, fails
miserably on some files.  (generates code, doesn't abort, but the code
doesn't work right.)


working around (2) was easy enough; just kill optimization in xntpd's
Makefile in my own source tree, in the same way that's done for
e.g. 'sa' right now.

working around (3) was a bit more nasty: I ended up changing CPICFLAGS
in bsd.lkb.mk to be:

CPICFLAGS?= -fpic -DPIC -O0


Other than that, what I did was something like:

put the following bits into /etc/mk.conf:

# permanent (until it is the default)
USE_EGCS=

.if !defined(SUPPORT_DYNAMIC_LINKING)
# temporary until EGCS PIC is known to work
LDSTATIC=       -static
NOPIC=
.endif

# temporary (while doing lots of builds)
NOMAN=
NOPROFILE=
NOLINT=

then:

(with SUPPORT_DYNAMIC_LINKING unset)
make sure that src/share/mk/bsd.lib.mk has the -O0 hack in it, and
    install the mk files
build egcs, install egcs, clean egcs
build egcs, install egcs
build the libraries, install the libraries.
build the system binaries, install the system binaries.  (Note that
    that means building and installing the assembler, statically linked.
    It's not currently a part of the NetBSD source tree.)

At that point, everything on my system was statically linked.

Then I tarred up my whole system, for later recovery.  (I love
diskless systems... 8-)

Then I setenv'd SUPPORT_DYNAMIC_LINKING, built the libraries,
installed them, built the rest of the system, etc.

Note that you still need the same old hacks to ld/ld.so and the csu
code, if you want to build working versions of those bits.


FWIW, I also tried dropping the EGCS 980411(?) snapshot's
gcc/config/arm into the tree (and tweaking it so that it'd compile),
but the compiler worked less well then.

Hopefully soon i'll get a chance to try the _complete_ latest EGCS
snapshot.



later,

chris