Differences between revisions 1 and 2
Revision 1 as of 2017-05-28 17:13:55
Size: 1463
Editor: ?AdrianGlaubitz
Comment: Initial version
Revision 2 as of 2017-05-28 17:17:26
Size: 1467
Editor: ?AdrianGlaubitz
Comment:
Deletions are marked like this. Additions are marked like this.
Line 59: Line 59:
   $ make FPC=/path/to/ppcbinary OVERRIDEVERSIONCHECK=1    $ make FPC=/path/to/ppcbinary OVERRIDEVERSIONCHECK=1 all

Bootstrapping FPC for a new architecture

On the bootstrapping machine

1. Check out FPC from SVN:

   $ svn co http://svn.freepascal.org/svn/fpc/trunk/

2. Install the gcc cross toolchain for the target architecture:

   $ apt install gcc-m68k-linux-gnu g++-m68k-linux-gnu cpp-m68k-linux-gnu

4. Enter FPC source directory and build a cross-compiler:

   $ BINUTILSPREFIX=m68k-linux-gnu- make crossall crossinstall CPU_TARGET=m68k CROSSOPT="-Cp68020 -Cf68881 -CaDEFAULT" OS_TARGET=linux FPC=/usr/lib/fpc/3.0.0/ppcx64 INSTALL_PREFIX=/home/glaubitz/fpc-m68k/

5. Build the native compiler:

   $ BINUTILSPREFIX=m68k-linux-gnu- make compiler CPU_TARGET=m68k OS_TARGET=linux FPC=/root/fpc-m68k/lib/fpc/3.1.1/ppcross68k CROSSOPT="-Cp68020 -Cf68881 -CaDEFAULT -Fu/root/fpc-m68k/lib/fpc/3.1.1/units/*

6. Copy target compiler into directory of cross-compiler:

   $ cp -av compiler/ppc68k /home/glaubitz/fpc-m68k/lib/fpc/3.1.1/

7. Tar the target compiler up to transport it to the target machine:

   $ tar czf fpc-m68k.tgz /home/glaubitz/fpc-m68k

On the target machine

1. Check out FPC from SVN:

   $ svn co http://svn.freepascal.org/svn/fpc/trunk/

2. Untar cross-compiled target compiler:

   $ tar xf fpc-m68k.tgz

3. Build FPC with the bootstrapped FPC:

   $ make FPC=/path/to/ppcbinary OVERRIDEVERSIONCHECK=1 all