[fpc-devel] FPC for FreeBSD/PowerPC

Marco van de Voort marcov at stack.nl
Thu Aug 10 15:44:13 CEST 2017

In our previous episode, Karoly Balogh (Charlie/SGR) said:
> > To my knowledge there is no universal "newer" and "older" BSD syscall
> > set. Are you talking about something NetBSD specific? So the first thing
> > would be to qualify that, and/or verify in how much the other BSDs
> > follow.
> Well, you can turn off the COMPAT calls in the kernel config.

(I assume NetBSD only then, what comes instead of it? What does gcc use? etc etc)

I assume you mean the ifdef use_stat30? Talk to Pierre for that:

r20741 | pierre | 2012-04-07 17:37:03 +0200 (Sat, 07 Apr 2012) | 1 line

 Add NETBSD_USE_STAT30 conditional for recent NetBSD changes, not yet used

> While they're enabled now by default, it certainly looks like something
> which might go away, or optional.  Also while fixing up stuff I ran into
> the fact that the alignments have changed anyway between aout and ELF it
> seems, so some of the stuff we have won't work on really old systems
> anyway, even if you plug in some old binutils for them.

> But I was mainly referring to stat and fsstat structures and the syscalls
> which are using them. It's quite an ifdef-mess already, so I was hoping to
> remove some of that. And there were a few other calls, but I can't
> remember. I just remember using ktruss, and running into a few compat
> calls shown.

The alignment is awfully ad-hoc, I think I originally started out as packed
with padding without much practical grasp of how alignment worked.  (most
notably fixed vs natural alignment)

Anything netbsd/PPC specific can be considered scratch and changable at your
discretion.  It is terribly old.  I only care for the synergy of the BSD
ports in general.

> > It might require revalidating all ports, since e.g. structures might change
> > which in turn might mean validating them on all targets (mostly due to
> > padding)
> Yapp, see above. :) I'm pretty certain some if not all of the netbsdppc
> $ifdef'ing and the related hacks are pretty much unnecessary at this
> point. But I understand the compiler has advanced a lot since these were
> added, so I don't mean to point fingers.

Iirc some of the extra named pad field came from the original headers. 
Probably they exist to make the stat record definition the same over all
architectures, regardless of architecture padding rules.  So they are
probably not my/Pierre's inventions.  They can be outdated though.
> > I remembered btw that NetBSD did run briefly on PPC though, around FPC
> > 1.9.2 on a PPC603, Florian helped with the assembler back then.  I
> > remember the main issue was some problem with fpu instructions needing
> > alignment on 603 but not on 604e.

(and I tested on a 603e-200 pmac 4400 iirc)

More information about the fpc-devel mailing list