Creating a (cross-)compiler

From Freepascal Amiga wiki
Revision as of 20:13, 25 July 2014 by Molly (talk | contribs) (corrected typo)
Jump to navigation Jump to search

This page is about creating a Free Pascal compiler that is able to cross-compile pascal source-code into an AROS compatible executable.

When first entering the realm of compiling the compiler and producing (cross-)compilers, things seems to get complicated pretty fast. One of the reasons for that is the fact that the Free Pascal compiler itself supports many targets (both platform and processor) on and for which you could (cross-)compile your pascal sources. Nowadays even Windows is not targeted to solely run on i386-processors alone anymore (just like AROS/Linux), which makes the whole process of building and setting up a (cross-)compiler a pretty intimidating process (even when that process is semi-automated using makefiles).

This wiki tries to guide you to the process of creating and setting up the Free Pascal compiler for your favorite platform and that is capable of producing AROS compatible executable files.

In order to be able to do so, this wiki describes the use of ALB's branch of the Free Pascal compiler, because without it Free Pascal would have no knowledge at all about AROS being a (valid) target. Eventually the aim is to get the AROS branch integrated into the main stream trunk of Free Pascal, but at the moment this is a long-term goal.

During tests and experiments performed to be able to write this wiki, some experience was obtained and most of that acquired knowledge is written down in this wiki. As such, this wiki does not claim to be an expert guide nor does it implies that everything you read in this wiki is correct. Please feel free to offer or make corrections and/or otherwise make suggestions concerning this wiki.

Preface

The Free Pascal build-system

The Binutils (and cross-compilation)

The AROS Binutils

The AROS Binutils and AROS

The AROS Binutils and Linux

The AROS Binutils and Windows

The SDK factor

Creating the compiler

Fixing things first

Fix 1: aros-collect

Fix 2: fpcmake

Fix 3: fcl-web

Fix 4: removing existing fpmake

Creating the compiler - for AROS (on AROS)

Creating the compiler - for Linux (on AROS)

Creating the compiler - for Windows (on AROS)

Creating the compiler - for AROS (on Linux)

Creating the compiler - for Linux (on Linux)

Creating the compiler - for Windows (on Linux)

Creating the compiler - for AROS (on Windows)

Creating the compiler - for Linux (on Windows)

Creating the compiler - for Windows (on Windows)

Requirements

Step 1: Extracting the sources from the archive

Step 2: Fixing things

Step 3: A new fpcmake

Step 4: recreating the makefiles

Step 5: making the compiler

Step 6: making the AROS parts

Step 7: Putting it all together

Notes for the Windows platform

Putting things together