This is the mail archive of the
mailing list for the GCC project.
Re: [PING]^N Fix ppc64 bootstrap with a -m32 host compiler
> It sounds to me like during stage 2 of a bootstrap, we should be
> using host libiberty rather than build libiberty. There's already
> one of those, I think. Or I may be off by one stage.
If we're bootstrapping, then "by definition" the host and build
compiler are somewhat compatible, because we can run programs built by
the build compiler, and we can run programs built by the host
compiler. But that doesn't mean they're the same.
During any stage N, the *build* tools (like genmodes) are built with
the build compiler, and need to be linked with the build libiberty.
However, the "build" compiler may be the host compiler from stage N-1.
Still, if that's what's building the build tools, that's what should
be buildling the stage N build libiberty.
Consider this nonsensical situation: we have a machine that can run
both mips and ppc binaries. The build compiler is always mips-gcc,
but we want to bootstrap ppc-gcc. During stage 5, we would be using
mips-gcc to build genmodes and thus we'd need a mips libiberty, but
stage 4's gcc is ppc-gcc and thus the host compiler is ppc-gcc.
Now, that's not what we usually want. We usually want stage N-1 to be
the "build" compiler for stage N, but we don't do that by switching to
the host libiberty, we do that by building a new build libiberty. It
happens to be built with the same compiler, but the system is
consistent and simpler. For example, it avoids the build-vs-host
check in the Makefile, which would fail if stage N had different
command line flags than stage N-1.
Consider, for example, a theoretical bootstrap where each stage had
successively higher optimization levels.
So my concern here is, if we went through all this effort to do a
toplevel bootstrap, why isn't build-libiberty being bootstrapped along
with everything else? Why didn't it "just happen" to be built with
the same compiler as is building gen* ? To me, having to link with a
non-build libiberty indicates that something else went wrong with the