[fpc-devel]Mac OS X pre-release version of the Free Pascal Compiler available!

Jonas Maebe jonas at zeus.ugent.be
Sun Jan 4 23:23:40 CET 2004


I'm very glad I can announce that today, for the first time I've been  
able to do a "make cycle" under Mac OS X (compile the compiler with  
itself, and then again with the resulting compiler, and then once  
more). This means that the compiler is now self-hosting under  
Darwin/Mac OS X, and ready for first testing!

--- What is ready?

* The basic units required to cycle the compiler (mostly file-system  
and exception handling related)
* The PPC code generator is in quite good shape (correctness-wise). On  
Linux/PPC, our regression test suite currently shows 17 errors (on 2185  
tests), versus 10 for the 80x86 version. I have not yet run the test  
suite under Mac OS X, and some OS-specific things will probably still  
need fixing

--- What is still left to do?

* Mac OS (X) specific:
   * Port the missing RTL units (mainly text console handling)
   * Create a Mac OS X installer package definition
   * Try to create some kind of plug-in so the compiler can be called  
from XCode and Project Builder
   * Run the test suite and fix bugs
   * Fix support for importing global variables from shared libraries
   * Replace as many of my handwritten assembler routines with calls to  
libc versions, as Apple is much better at writing fast ppc assembler  
code that I am :) Do the same for the generic math routines.
   * Support the Apple dialect so we can use the Universal Interfaces
   * Finish Classic Mac OS support
   * ...

* PPC-specific:
   * improve AIX abi-compatibility (e.g., we don't pass records as the  
AIX abi prescribes)
   * create a PPC-optimizer (if only a peephole optimizer for starters)
   * re-enable support for register variables (that's not really  
PPC-specific, but the PPC will benefit a *lot* of that)

--- System requirements

The Darwin RTL is based on libc and uses only a few basic library  
calls. Therefore, even though I compiled the binary below on Mac OS X  
10.3.2, it should theoretically run on everything, even the Mac OS X  
Public Beta :) The BSD subsystem and the Developer Tools (or XCode)  
must be installed, though. There are no further requirements.

--- Where to get it

* The source

You can get the source code of the compiler and rtl by following the  
instructions at <http://www.freepascal.org/develop.html#cvs>. To  
recompile the compiler and rtl, first download and install the binary  
snapshot as indicated below, then go in the fpc/compiler directory you  
checked out from cvs and type "make cycle".

* The binary snapshot

You can download a minimal binary snapshot from  
-20040104.tar.bz2>. I would suggest not unpacking it with Stuffit  
Expander, but on the command line. Use

gnutar xjvf fpc-darwinppc-20040104.tar.bz2

and it will expand the file in the current directory. You'll get one  
directory (fpc) with two subdirectories: bin and rtl. The bin directory  
contains the two program files, ppcppc (the actual compiler) and fpc  
(the compiler front-end). The rtl directory contains a darwin  
subdirectory with all units.

The easiest will be if you put this fpc directory in your home  
directory, then create a file called ".fpc.cfg" (note the extra "." at  
the start) in your home directory with as contents (replace  
<your_short_name> with your short login name)


Next, if your shell is bash, add the following to the file  
.bash_profile in your home directory (create the file if it doesn't  
exist yet):

export PATH=~/fpc/bin:"$PATH"

If your shell is tcsh, add the following to the file .tcshrc in your  
home directory:

setenv PATH ~/fpc/bin:{$PATH}

Type 'exit' in the Terminal window, and then open a new one. From now  
on, you can compile programs by going to the directory with your source  
files and typing e.g.

fpc helloword.pas

Run the result by typing


Happy programming, and bug reports are of course welcome!


More information about the fpc-devel mailing list