Difference between revisions of "Bootstrapping"

(Use mv instead of cp.)
(Refer to Building a delivery page.)
Line 36: Line 36:
  
 
==Building a delivery==
 
==Building a delivery==
The above steps talk about building deliveries. Below are the instructions on how to build a minimal delivery in a directory called EiffelXX. The following commands will only work if executed under bash.
+
The above steps talk about building deliveries. Follow [[Building_a_delivery|the instructions on how to build a minimal delivery]] in a directory called EiffelXX.
 
+
<pre>
+
export SVNURL=https://eiffelsoftware.origo.ethz.ch/svn/es/trunk
+
mkdir EiffelXX
+
export $NEW_ISE_EIFFEL=`pwd`/EiffelXX
+
cd EiffelXX
+
svn co $SVNURL/Delivery/studio
+
svn co $SVNURL/Delivery/eifinit
+
 
+
cd studio/config
+
mv unix $ISE_PLATFORM
+
cd ..
+
 
+
cd studio/spec
+
mkdir $ISE_PLATFORM
+
mkdir $ISE_PLATFORM/bin
+
mkdir $ISE_PLATFORM/include
+
mkdir $ISE_PLATFORM/lib
+
 
+
cp unix/* $ISE_PLATFORM/bin
+
rm -rf unix
+
 
+
cd $EIFFEL_SRC/C/run-time
+
cp *.h $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include
+
cp ../config.sh $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include
+
cp lib* $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib
+
cp x2c $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+
cd ..
+
cp ipc/daemon/estudio $NEW_ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+
</pre>
+

Revision as of 16:26, 1 November 2006

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.

Information.png Note: By generated code we meant the C code because although the binaries should be exactly identical in size, they usually are not identical because most binary formats store a date in the binary and since they have not been compiled at the exact same time we cannot compare them.

If they are not identical, 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.

Building a delivery

The above steps talk about building deliveries. Follow the instructions on how to build a minimal delivery in a directory called EiffelXX.