Difference between revisions of "PowerPC64 Port"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 1: Line 1:
 
The PowerPC64 port is in some sort of early beta-stage. It started as entry for the Linux On Power contest.
 
The PowerPC64 port is in some sort of early beta-stage. It started as entry for the Linux On Power contest.
  
This page contains only a rough outline of what is working and especially what not, more information later.
+
This page contains only a rough outline of what is working and especially what not, some notes about the port and several other related information. More, detailed information (about calling conventions and so on) later.
  
  
Line 20: Line 20:
 
* object messages do not work. This is an alignment problem of generated internal structures.
 
* object messages do not work. This is an alignment problem of generated internal structures.
 
* there are some problems with packages/FCL due to missing workaround for non-aligned accesses in some records. A workaround for this (instruction) limitation is being worked on.
 
* there are some problems with packages/FCL due to missing workaround for non-aligned accesses in some records. A workaround for this (instruction) limitation is being worked on.
* performance is really bad. Programs compiled with the ppc32 compiler are much faster, and the same program on a slower clocked x86_32 dances circles around both. Note that regularly compiled programs for the powerpc32 platform do '''NOT''' work on POWER and G5s on Linux at the moment.
+
* performance is really bad. Programs compiled with the ppc32 compiler are much faster, and the same program on a slower clocked x86_32 dances circles around both.
 
* in general, the compiler needs more testing.
 
* in general, the compiler needs more testing.
  
 
Of course, all of this (except maybe the performance part :-) will be fixed for an "official" release.
 
Of course, all of this (except maybe the performance part :-) will be fixed for an "official" release.
 +
 +
== 32 bit compatibility ==
 +
 +
During porting several compatibility problems of 32 bit PowerPC programs with the 32 bit emulation layer of Linux were found. They are:
 +
 +
* the default cache line size is 128 byte instead of 32 byte. This affects some RTL routines which assume 32 byte cache line length, i.e. the assembly fillchar() and move() methods. For this reason, most (except very trivial) FPC compiled programs immediately segfault on PowerPC64. Fixing this involves selecting cache line aware fillchar() and move() methods at program startup.
 +
* Signal handlers for exceptions are not registered properly by the RTL at program startup. This is due to Linux/32 on powerpc64 using different syscall numbers than Linux/32 on PowerPC32. In particular it uses the rt_sig* constants, not the old ones. This also affects OO-exception handling, which does not work at all. (Note from oliebol: "Either ppc64 improving or fpc linux/x86 switching to rt_sig*").
  
 
== Contacts ==
 
== Contacts ==
  
 
Message to the fpc-devel mailing list, or look for "tom_at_work" in the IRC channel (or of course discuss it here).
 
Message to the fpc-devel mailing list, or look for "tom_at_work" in the IRC channel (or of course discuss it here).

Revision as of 21:06, 9 October 2005

The PowerPC64 port is in some sort of early beta-stage. It started as entry for the Linux On Power contest.

This page contains only a rough outline of what is working and especially what not, some notes about the port and several other related information. More, detailed information (about calling conventions and so on) later.


Status

  • 2.1.x compiler support
  • Supports POWER4 and derivative (G5) for Linux at the moment.
  • Base RTL units and compiler is cycling fine.

Building

Since it's beta, with some slight bugs, only the knowledgeable and interested people should try it. As usual, if you do not have a G5, you need crossbinutils for linux-ppc64.

The target name is "powerpc64", so a "make PPC_TARGET=powerpc64-linux" (or "make PPC_TARGET=powerpc64" if you are already on Linux) should do the trick.

Issues

  • -Or is currently broken
  • Exception handling does not seem to work, there is an issue with the sigaction() call (signal handlers fail to register).
  • object messages do not work. This is an alignment problem of generated internal structures.
  • there are some problems with packages/FCL due to missing workaround for non-aligned accesses in some records. A workaround for this (instruction) limitation is being worked on.
  • performance is really bad. Programs compiled with the ppc32 compiler are much faster, and the same program on a slower clocked x86_32 dances circles around both.
  • in general, the compiler needs more testing.

Of course, all of this (except maybe the performance part :-) will be fixed for an "official" release.

32 bit compatibility

During porting several compatibility problems of 32 bit PowerPC programs with the 32 bit emulation layer of Linux were found. They are:

  • the default cache line size is 128 byte instead of 32 byte. This affects some RTL routines which assume 32 byte cache line length, i.e. the assembly fillchar() and move() methods. For this reason, most (except very trivial) FPC compiled programs immediately segfault on PowerPC64. Fixing this involves selecting cache line aware fillchar() and move() methods at program startup.
  • Signal handlers for exceptions are not registered properly by the RTL at program startup. This is due to Linux/32 on powerpc64 using different syscall numbers than Linux/32 on PowerPC32. In particular it uses the rt_sig* constants, not the old ones. This also affects OO-exception handling, which does not work at all. (Note from oliebol: "Either ppc64 improving or fpc linux/x86 switching to rt_sig*").

Contacts

Message to the fpc-devel mailing list, or look for "tom_at_work" in the IRC channel (or of course discuss it here).