Differences between revisions 1 and 2
Revision 1 as of 2006-07-13 00:16:33
Size: 3121
Editor: server1
Comment:
Revision 2 as of 2007-01-16 12:51:32
Size: 2602
Editor: PaoloBonzini
Comment: rewrite to cheatsheet
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Contributors: Toplevel bootstrap is able to bootstrap a compiler with separate reconfigurations and rebuilds of libiberty/libcpp/gcc in all the three stages. It is actually possible to bootstrap a whole toolchain, so that the final executable is built entirely with the assembler, binutils and linker that are in a combined tree.
Line 3: Line 3:
 * Paolo Bonzini When configuring in a native environment, {{{make}}} does more or less what {{{make bubblestrap}}} used to do: start from stage1, rebuild everything that had to be rebuilt, configure stage2 if it has not been configured yet, build stage2, and the same for stage3. "Rebuilding" is not limited to GCC: libiberty, libcpp, and other dependencies of GCC are all configured and compiled three times. It is the same as rebuilding a whole tree from scratch three times, each time using the previous build as the result.
Line 5: Line 5:
 * Nathanael Nerode It supports all the bells and whistles. {{{make profiledbootstrap}}} works; it will build profile-optimized assemblers, binutils and linkers when run in a combined tree.
Line 7: Line 7:
 * Daniel Jacobowitz == Toplevel-bootstrap cheatsheet ==
Line 9: Line 9:
Delivery date: The following gives a cheatsheet of common operation modes.
Line 11: Line 11:
 * 2005-12-14 Q1) How to bootstrap the compiler, including all libraries?
Line 13: Line 13:
Benefits: A1) '''make''' from the top directory
----
Q2) How to bootstrap the compiler, but not build any time consuming libraries (libjava, libstdc++)?
Line 15: Line 17:
 * Maintainability A2) '''make stage{2,3,feedback}-bubble'''
Line 17: Line 19:
 * Better testing of the compiler ''a note: this is the equivalent to the old'' cd gcc && make {bootstrap2,bootstrap,profiledbootstrap} ''respectively.''
----
Q3) How to compile just the stage1 compiler + the basic runtime (libgcc, libmudflap, libgomp)?
Line 19: Line 23:
Risks: A3) '''make stage1-bubble all-target-libmudflap all-target-libgomp'''
Line 21: Line 25:
 * Build failures (but the old system will still be available in 4.1) ''a note: i'm thinking of three-staging also libmudflap and libgomp; in this case the above will simplify to '''make stage1-bubble'''''
----
Q4) How to compile all the libraries (libjava, ...) using the stage1 compiler?
Line 23: Line 29:
 * Longer bootstrap times A4) Configure with '''--enable-stage1-languages=all''' and then use '''make stage1-bubble all-target'''
Line 25: Line 31:
Description: ''a note: i'm thinking of enabling this flag by default in non-release branches. for sure it is most useful for GCC developers to always configure their trees with this flag.''
----
Q5) How to clean up everything (including the stage1 compiler, but excluding makefiles, so that I can build everything from scratch, but configure does not have to be run)?
Line 27: Line 35:
  The project aims at enabling bootstrapping of tools like the
  assembler and linker, and of host libraries such as libiberty or
  libcpp.
A5) '''make clean''' (or make cleanstrap to also start a bootstrap)
----
Q6) How to clean up everything except for the stage1 compiler?
Line 31: Line 39:
  This would resolve a number of binary compatibility issues, and
  remove some hairy parts of the GCC Makefile. Of course
  compilation times will increase, because more code is compiled
  three times, and more code is run unoptimized while building
  stage2.

Current Status:

  Committed 2005-12-14.

  Toplevel bootstrap is able to bootstrap a compiler with separate reconfigurations and rebuilds of libiberty/libcpp/gcc in all the three stages. It is actually possible to bootstrap a whole toolchain, so that the final executable is built entirely with the assembler, binutils and linker that are in a combined tree.

  When configuring in a native environment, {{{make}}} will do more or less what {{{make bubblestrap}}} used to do: start from stage1, rebuild everything that had to be rebuilt, configure stage2 if it has not been configured yet, build stage2, and the same for stage3. "Rebuilding" is not limited to GCC: libiberty, libcpp, and other dependencies of GCC are all configured and compiled three times. It is the same as rebuilding a whole tree from scratch three times, each time using the previous build as the result.

  It supports all the bells and whistles like bubblestraps and restageN, which help during development. {{{make restrap}}} (taking a non-bootstrap build and using it as stage1) is not supported. {{{make restageN}}} is called {{{make all-stageN}}} and there is also {{{make all-stageN-gcc}}} to rebuild gcc only. There is no equivalent to {{{quickstrap}}} even though it can be added if there's deman.

 ''Lean''bootstraps are also supported, but they are enabled with {{{--enable-bootstrap=lean}}} rather than with special targets.

  {{{make profiledbootstrap}}} works; it will build profile-optimized assemblers, binutils and linkers when run in a combined tree.

  For a while, old-style bootstrap will still be available with {{{./configure --disable-bootstrap; make bootstrap}}} (non intuitive maybe, but in the long term, it would only be one more historic wart if the flag was called {{{--{enable,disable}-toplevel-bootstrap}}} .

Pending problems and patches:

  [http://gcc.gnu.org/ml/gcc/2005-12/msg00414.html libcpp being rebuilt at install time], patch at http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01602.html

  [http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01599.html Patch to provide a configure option to support an undocumented use case], to be looked at

  [http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01684.html make bootstrap-lean][[BR]]
  [http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01600.html symlinks cause problems on OpenBSD (reported by Mark Kettenis)]
A6) '''make distclean-stage2 clean-target''' or '''make restrap''' (which will also start a bootstrap)

Toplevel bootstrap is able to bootstrap a compiler with separate reconfigurations and rebuilds of libiberty/libcpp/gcc in all the three stages. It is actually possible to bootstrap a whole toolchain, so that the final executable is built entirely with the assembler, binutils and linker that are in a combined tree.

When configuring in a native environment, make does more or less what make bubblestrap used to do: start from stage1, rebuild everything that had to be rebuilt, configure stage2 if it has not been configured yet, build stage2, and the same for stage3. "Rebuilding" is not limited to GCC: libiberty, libcpp, and other dependencies of GCC are all configured and compiled three times. It is the same as rebuilding a whole tree from scratch three times, each time using the previous build as the result.

It supports all the bells and whistles. make profiledbootstrap works; it will build profile-optimized assemblers, binutils and linkers when run in a combined tree.

Toplevel-bootstrap cheatsheet

The following gives a cheatsheet of common operation modes.

Q1) How to bootstrap the compiler, including all libraries?

A1) make from the top directory


Q2) How to bootstrap the compiler, but not build any time consuming libraries (libjava, libstdc++)?

A2) make stage{2,3,feedback}-bubble

a note: this is the equivalent to the old cd gcc && make {bootstrap2,bootstrap,profiledbootstrap} respectively.


Q3) How to compile just the stage1 compiler + the basic runtime (libgcc, libmudflap, libgomp)?

A3) make stage1-bubble all-target-libmudflap all-target-libgomp

a note: i'm thinking of three-staging also libmudflap and libgomp; in this case the above will simplify to make stage1-bubble


Q4) How to compile all the libraries (libjava, ...) using the stage1 compiler?

A4) Configure with --enable-stage1-languages=all and then use make stage1-bubble all-target

a note: i'm thinking of enabling this flag by default in non-release branches. for sure it is most useful for GCC developers to always configure their trees with this flag.


Q5) How to clean up everything (including the stage1 compiler, but excluding makefiles, so that I can build everything from scratch, but configure does not have to be run)?

A5) make clean (or make cleanstrap to also start a bootstrap)


Q6) How to clean up everything except for the stage1 compiler?

A6) make distclean-stage2 clean-target or make restrap (which will also start a bootstrap)

None: Top-Level_Bootstrap (last edited 2008-01-10 19:38:37 by localhost)