Difference between revisions of "Bootstrapping"
(Added bootstrap description) |
|||
Line 8: | Line 8: | ||
==When not bootstrapping== | ==When not bootstrapping== | ||
Although you can always do a bootstrap, there are cases when it is actually not required. For example when: | Although you can always do a bootstrap, there are cases when it is actually not required. For example when: | ||
− | * Changing an header file which will impact the C generated code in a non- | + | * Changing an header file which will impact the C generated code in a non-intrusive way, but still requires a new runtime. In that case, no bootstrap is necessary, it suffices to copy the new header and runtime to the current delivery. |
* Changing a kernel library class which does not involve a special compiler knowledge (e.g. fixing a routine of STRING). | * Changing a kernel library class which does not involve a special compiler knowledge (e.g. fixing a routine of STRING). | ||
Line 14: | Line 14: | ||
==Bootstrapping the compiler== | ==Bootstrapping the compiler== | ||
===Initial compiler=== | ===Initial compiler=== | ||
− | To start the | + | To start the bootstrap process you have to start from a working compiler, this is usually one of the released version. Let's call this compiler ''original ec'' and its delivery ''original_delivery''. |
===First step=== | ===First step=== | ||
− | Using | + | Using ''original ec'' and the configuration file finalize a new ec, this version is called ''ec_level1''. This version is compiled with the header files and run-time of the ''original delivery''. |
+ | |||
+ | ===Second step=== | ||
+ | Compile a new run-time and copy the headers to a new delivery ''level1 delivery'', as well as the new ''ec_level1'' executable. Now repeat the first step, you now get a version called ''ec_level2''. This version is obviously compiled with the header files and run-time of the ''level11 delivery''. | ||
+ | |||
+ | ===Final step=== | ||
+ | Using the same ''level1 delivery'', but this time using the ''ec_level2'' executable, repeat the first step, you now get a version called ''ec_level3''. This version is also called the bootstrapped version. | ||
+ | |||
+ | |||
+ | ===How do we find if it really worked?=== | ||
+ | If everything went well, the generated code for ''ec_level2'' and ''ec_level3'' should be identical. If this is not the case, then something is not right in the new code generation or in the run-time/header files, and the bootstrap process needs to be restarted from the ''original ec'' and the ''orginal delivery''. | ||
+ | |||
+ | Of course you restart the bootstrap process after find the cause of the error and fixing it. |
Revision as of 04:52, 10 April 2006
Contents
Definition
Check out the definition from wikipedia http://en.wikipedia.org/wiki/Bootstrapping to know more about bootstrapping.
Why bootstrapping?
The general idea is that when you do a change in the code generation (often for improving the speed) you want to get a compiler that has been compiled with the new code generation to benefit from the changes.
When not bootstrapping
Although you can always do a bootstrap, there are cases when it is actually not required. For example when:
- Changing an header file which will impact the C generated code in a non-intrusive way, but still requires a new runtime. In that case, no bootstrap is necessary, it suffices to copy the new header and runtime to the current delivery.
- Changing a kernel library class which does not involve a special compiler knowledge (e.g. fixing a routine of STRING).
Bootstrapping the compiler
Initial compiler
To start the bootstrap process you have to start from a working compiler, this is usually one of the released version. Let's call this compiler original ec and its delivery original_delivery.
First step
Using original ec and the configuration file finalize a new ec, this version is called ec_level1. This version is compiled with the header files and run-time of the original delivery.
Second step
Compile a new run-time and copy the headers to a new delivery level1 delivery, as well as the new ec_level1 executable. Now repeat the first step, you now get a version called ec_level2. This version is obviously compiled with the header files and run-time of the level11 delivery.
Final step
Using the same level1 delivery, but this time using the ec_level2 executable, repeat the first step, you now get a version called ec_level3. This version is also called the bootstrapped version.
How do we find if it really worked?
If everything went well, the generated code for ec_level2 and ec_level3 should be identical. If this is not the case, then something is not right in the new code generation or in the run-time/header files, and the bootstrap process needs to be restarted from the original ec and the orginal delivery.
Of course you restart the bootstrap process after find the cause of the error and fixing it.