[fpc-devel] Re: freepascal support for debian armhf

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Sep 7 11:23:05 CEST 2011


On 06 Sep 2011, at 14:00, Wookey wrote:

> section 5 tells you about the calling conventions, and section 6 about
> the normal variants (note the bit about it applying only to
> non-variadic functions - does pascal support variadic functions?)


It does, in two ways:
a) calling variadic functions implemented in C (-> uses the variadic  
calling convention from the ABI)
b) it's own variant, which uses a non-variadic calling convention from  
the ABI (the variadic part there is implemented via an array that is  
constructed on the caller side)

> 2) The extra functionality available: a VFP unit with 31 single
> precision or 16 double precision registers. Note that newer hardware
> will have twice as many registers, but that doesn't affect the
> calling convention. In debian armhf (and Ubuntu armhf, and hopefully
> everyone else shipping arm binary distros) we've picked the VFP3d16
> hardware variant as a baseline to build for. Obviously it is useful to
> people who build their own code if the compiler supports the d32
> hardware variants too, but that won't be used in distro-built  
> binaries.

We already support both (with the softfp calling convention).

> 3) Some other things change that might catch you out:
> a) Thumb interworking needs to be supported, which has requirements  
> on state
> between function calls (any function can be thumb or not-thumb).

If that only means that you have to use b(l)x everywhere, we already  
support that (only in svn trunk though).

> b) The SWP instruction is gone. It may fault, it may get fixed up by
> the kernel (slowly), but it shouldn't be used anymore (it's not
> compatible with mutli-core designs, Load/store exclusive should be
> used instead).


swp is currently replaced with ldrex/strex in the run time library in  
you target ARMv6 or above.

> Hopefully that's helpful to anyone looking at this.

Thanks, and nice to see you again in a completely different setting :)


Jonas



More information about the fpc-devel mailing list