This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bootstrap w/o compiler chestnut.
- From: Hugh Sasse Staff Elec Eng <hgs at dmu dot ac dot uk>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 26 Mar 2003 18:19:06 +0000 (GMT)
- Subject: bootstrap w/o compiler chestnut.
I know this is an old chestnut, done to death pretty well, but I
need to ask this after a frustrating week of not making progress.
If you have a machine with no compiler on it, to bootstrap GCC you
need a compiler. I've no problem with that, and there are good
reasons for it. There are supposed to be binaries available for
many platforms, and there are many available. My problem has been
that these have dependencies: I have recently tried to build GCC on
a sparc-sun-solaris2.5.1 machine with no compiler, and the GCC
binary available from sunfreeware depends on having the sun workshop
compiler's include files available. Of course, I don't have a
licence for that machine.
So I tried to work around this: I built a compiler, apparently
successfully on another sparc-sun-solaris-2.5.1 machine, and then
with the build directory NFS-mounted, did a make install on the
machine with no compiler. The installed compiler still complained
about missing .h files (math.h, to be precise). I tried as many
different ways of building gcc as I could to overcome this, but they
all depended on existing include files. This shows the decision of
the sunfreeware people to base theirs on Sun's compiler is perfectly
reasonable.
I then tried to break the dependency more dramatically by building
lcc for the remote system, but lcc suffers the same problem, it uses
.h files from the compiler you built it with. So I can't use that to
build gcc.
So, my questions are these:
Is there a way to get the fixincludes part of the build proces to
behave as if ALL the includes need fixing, so that a full set is
created for the "destination" compiler? (I think this would have
the advantage that the Free compiler could be built with a non-free
compiler, and the result would be distributable. [This may be a
spurious point, I find these issues tend to be more subtle than I
expect!])
Another way to get the compiler built correctly for the 'far'
machine might be to start on machine A, build a cross compiler on A
to produce code for machine B, say gccA->B, then somehow build
gccB->B with this cross-compiler. There is documentation on how to
build a cross compiler, but not on how to create a new native
compiler with this cross-compiler, at least that I can find with the
usual searching techniques. Is this process described anywhere,
please?
I am not trying to build for a system that is so alien that the
document describing how to *port* gcc is applicable. I therefore
suspect that I may have missed something obvious. I'd be grateful
for any pointers. Hopefully, the cause of my embarassment will help
someone else later....
Thank you,
Hugh