From Free Pascal wiki
Revision as of 17:29, 10 March 2004 by Marcov (talk | contribs) (FreeBSD page created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

FREEBSD bleeding edge notes

This page is mainly a scratchpad where I will try to keep FreeBSD specific issues noted. Some of them may apply to NetBSD/OpenBSD too, an also Darwin is sharing a lot of the generic BSD.

FreeBSD is the most mature of the BSD ports, though Darwin is rapidly catching up.

FreeBSD 5.x

While afaik not available publically ( mailed the script to the lang/fpc porter), there is some support for FreeBSD 5.x now. (5.x means 5.2 and later, 5.0, 5.1)

Actually there are two changes for 5.x:

  • the startup code is different due to the addition of an ABI tag, and
  • (after 5.2) libkse becomes the new scheduler in 5-CURRENT.

I'll try to keep 4.x working till my provider, Stack doesn't use 4.x anymore on its shell machines.

5.x startup code

The first can be fixed for 1.0.10 (lang/fpc port) by running this shell script if you have 5.x, which takes the prefix where FPC is installed as optional parameter. (tested on 5.2)

There is no such script for 1.9.x yet, but creating it should not be hard, and I hope to have it running with 1.9.4, maybe even integrate it into the makefiles


The second is only fixed in CVS (and therefore will only be available in 1.9.4 and later). This functionality is barely tested though, but adding parameter -Xf to the commandline of the compiler (when linking) or to fpc.cfg should use libpthreads instead of libc_r.

For this to work there must be at least one header set that has {$linklib c} {$linklib pthreads}

and there should be no direct use of {$linklib c_r} anymore, the compiler transforms the library list automatically depending on -Xf.

The best way to this is by simply use "USES systhrds"

Ports tree

FPC is currently available in both flavours in the ports tree

  • John Merryweather-Cooper maintains an independant 1.0.10 port as lang/fpc which was originally based on the binary 1.0. .tar.gz, but seems to be changing to source builder using lots of different modules right now.

see here for current FPC ports/ PR status

  • I myself maintain the lang/fpc-devel port, which is a source based bootstrapping system for the 1.9.x series. (currently 1.9.2).

The FPC 1.0/freebsd branch is considered legacy since I do all of the FreeBSD development, and have been working on 1.9 nearly exclusively since early 2003.

Moreover 1.0.10 is probably is the last release of the 1.0 branch, though maybe there will be some additional releases for the m68k and other non-core platforms that haven't been ported to 1.9.x yet.

So 1.0 is considered legacy, and I advise people to use the 1.9 series as much as possible. While officially a beta, 1.9.x is except some crashes on faulty code occasionally in general a compiler in better shape. The same goes for the 1.9.x rtl.

When when critical problems arrive, I'm willing to make patches for 1.0.x, but I won't do any release engineering for a new 1.0.x releases anymore, let alone official ports tree entries.


Since jan 2004, most Unix ports of FPC can be recompiled with FPC_USE_LIBC, and in those cases the RTL will use libc functions as much as possible. This was mainly introduced for the Darwin port, and may also be used for e.g. Lazarus distributions. (Lazarus links its apps to libc anyway, because of gtk)

Unix RTL, 1.0.x/1.9.x RTL compability

The 1.0.x rtl was essentially a linux only hackish rtl. The rtl was rewritten in version 1.9.x (and this still continues), and unfortunately, compatibility had to be broken.

For reasons and discussion, see Unix Rtl Doc