[fpc-devel] How hard is it to port FPC to AIX

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Sep 13 10:24:42 CEST 2008


On 11 Sep 2008, at 20:36, Peter Popov wrote:

> Peter
>
>> It should not be that hard. There are two main ABI's for PowerPC:  
>> the sysv and the aix ABI. Linux/*BSD use the sysv ABI, and Mac OS,  
>> Mac OS X and AIX uses the aix ABI. Hence, the aix abi is already  
>> supported in the compiler. A libc-based rtl port based on the  
>> solaris rtl shouldn't be that hard either.
>
> Could you give me some pointers how to begin?

The wiki page pointed to by Felipe describes the compiler changes  
fairly well. For the rtl: just copy the contents of rtl/solaris to rtl/ 
aix, and  adapt the files (lookup constants and structure definitions  
in the C header files and adapt the corresponding Pascal definitions).  
Apart from rtl/solaris/termio*.*, I think you need everything to get a  
basic rtl working.

You can avoid having to use assembler for the entry point code by  
using the same trick that is used for Darwin. Have a look at rtl/bsd/ 
system.pp (search for FPC_DARWIN_JMP_MAIN, which is defined by current  
compilers -- just copy that entire {$ifdef darwin} block to your own  
system unit) and add your newly added system_powerpc64_aix identifier  
to the set of OSes that use this functionality in compiler/ncgutil.pas  
in the procedure gen_proc_symbol_end (in the if-test).


Jonas



More information about the fpc-devel mailing list