Differences between revisions 3 and 4
Revision 3 as of 2017-05-28 17:58:19
Size: 1871
Editor: ?AdrianGlaubitz
Comment: Add section about CROSSOPT
Revision 4 as of 2017-05-29 00:05:54
Size: 1926
Editor: PaulWise
Comment: correct namespace
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from DebianPorts/BootstrappingFPC

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/*

Note: The options for CROSSOPT can be obtained by running "ppcross$CPU" after the initial build without parameters:

   ~/trunk# ./compiler/ppcross68k -ic
   68000
   68020
   68040
   68060
   ISAA
   ISAA+
   ISAB
   ISAC
   CFV4E
   ~/trunk# ./compiler/ppcross68k -if 
   SOFT
   LIBGCC
   68881
   COLDFIRE
   ~/trunk# ./compiler/ppcross68k -ia
   DEFAULT
   ~/trunk#

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