[PATCH] Fix unified tree breakage
Paolo Bonzini
bonzini@gnu.org
Thu Oct 6 15:42:00 GMT 2005
Alexandre Oliva wrote:
> On Oct 5, 2005, Paolo Bonzini <paolo.bonzini@lu.unisi.ch> wrote:
>
>
>>In 4.2, we'll have *toplevel* bootstrap enabled by default. This is
>>what you saw indicated as "@if gcc-bootstrap", and it means that the
>>toplevel orchestrates a 3-stage build of libiberty, binutils, and
>>everything else up to gcc. In this case it will just work because
>>stage1 will use the system assembler/linker, and stage2/3 will use the
>>previous stage of the in-tree assembler/linker:
>
>
> This is not good. It means the libgcc build uses one pair of
> assembler/linker different from the one that gets installed. Each
> stage must use its own assembler/linker to build the GCC libraries.
It does, I'm sorry. It's quite complicated and sometimes I get it wrong
myself. :-(
The stage2 and stage3 binaries should be identical (and even the stage1
and stage2 binaries should behave the same). Thus, using the previous
stage of the in-tree assembler/linker could even be correct, but it is
not what it is done.
> I think this has to be done for all stages, and every stage must use
> its own assembler/linker pair to build any target libraries (libgcc
> included), otherwise the point of bootstrapping is sort of missed.
For toplevel bootstrap, it will be.
When I said that for 4.2 I want to remove this junk, it is because I
would like to add a script that automatically picks the correct tool.
For example,
run-tool --build='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' \
--build='$$r/$(BUILD_SUBDIR)/byacc/byacc' \
'$(CONFIGURED_YACC)
finds an in-tree bison or byacc, falling back to $(CONFIGURED_YACC). Or,
run-tool --target='$$r/$(HOST_SUBDIR)/gas/as-new' \
--target='$$r/$(HOST_SUBDIR)/gcc/as' \
--host='$(AS)' \
'$(CONFIGURED_AS_FOR_TARGET)'"
finds an in-tree target assembler, falling back to the system host
assembler in a native configuration (target = host) or then to the
$(CONFIGURED_AS_FOR_TARGET). The first parameter specifies the desired
triplet for the tool, so --host is only considered if the host and
target triplets are identical.
This allows all the backticked `if ... ; then echo ; else echo; fi`
expressions in Makefile.tpl to go away.
Paolo
More information about the Newlib
mailing list