Sign in Join
Wiki copytemporary

How to start

How to start

Setting up the development environment

  1. Install the most recent official FPC release for your operating system, get it here
  2. Get the latest FPC source from the repository, read here how to do so.
  3. Test your setup:
    1. Change to the directory fpc
    2. type make all and test see if it works without problems. If you've problems with the build, or for a general background info for the process, be sure to check the buildfaq.
    3. If you wish to do so, you can install the newly generated compiler with make install (This may need sudo).

Now you're ready to modify the compiler.

Directory layout of the compiler

The compiler sources are located in fpc/compiler and its subdirectories.

Building the compiler

To build the compiler only, a make in fpc/compiler is enough. However, if you want to test the generated compiler and you aren't building a cross compiler, better do a make cycle. This tests if the modified compiler can compile itself and the rtl.

Building a cross compiler

See Cross compiling.

Testing changes

When doing changes, it is always good to test these changes, for example by running the testsuite.

Running the testsuite

The readme file in the fpc/tests directory contains more complete test suite instructions.

text
 cd fpc
 make clean all
 cd tests
 make clean all digest

You'll get something like this at the end:

text
 ...
 /FPC/home/fpc/bin/digest output/i386-linux/log
 Total = 2975 (28:2947)
 Total number of compilations = 1692 (12:1680)
 Successfully compiled = 1361
 Successfully failed = 319
 Compilation failures = 12
 Compilation that did not fail while they should = 0
 Total number of runs = 1283 (16:1267)
 Successful runs = 1267
 Failed runs = 16
 ...

The important line is

text
 Total = 2975 (28:2947)

It shows how much tests were run: 2975, how much failed: 28 and now much succeded: 2947. If you want to know what failed, see fpc/tests/output/<target>/longlog and fpc/tests/output/<target>/log.

Recommended readings

Unfortunately, there is no documentation about the internals of the 2.x.x compiler yet. However, there is a documentation of the internals of 1.0.x which should give first clues: http://www.stack.nl/~marcov/comparch.pdf

Further, some information about the 2.x.x will be collected here: FPC internals

See also


From the Free Pascal wiki, page "How to start", as it stood on 2022-09-11 after a change by PierceNg, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.