Solaris Port

From Free Pascal wiki
Revision as of 14:48, 21 March 2005 by Synopsis (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Below are some basic things how you can compile it. Note that cross compiling is not easy, especially not since you need to link to libc.

Also the assembler and linker calls are not correct for assembling and linking on the target platform and may need some manual tweaking in ppas.sh and finally in t_sunos.pas.

Build binutils

Download the latest GNU binutils and build a cross-assembler and linker

./configure --target=i386-pc-solaris2.7

Cross Compile the RTL

In the fpc/rtl/solaris/ the rtl with:

make BINUTILSPREFIX=i386-pc-solaris2.7- OPT=-g


Compile the famous hello world #1

Copy the solaris libc.* files to a dir on Linux

ppc386 -g -Xd -XPi386-pc-solaris2.7- -Fl<pathtosolarislibc> -Tsolaris helloworld

Run the executable on solaris (in gdb)


Compile the famous hello world #2

Another option is to compile on i386 and assemble and link on solaris

ppc386 -a -st -Tsolaris helloworld

This creates a ppas.sh script that can be run on solaris.