[fpc-pascal] Is this the correct way to configure fpc for multiple arm-embedded subarchs?

Christo christo.crause at gmail.com
Sun Dec 17 09:27:52 CET 2017


On Mon, 2017-12-04 at 08:22 +0100, Michael Ring wrote:
> Hi Florian!
> 
> I would like to work on this patch, can you share it with me?

> Am 03.12.17 um 19:05 schrieb Florian Klämpfl:
> > 
> > Am 29.11.2017 um 06:36 schrieb Christo:
> > > 
> > > On Sun, 2017-11-26 at 17:19 +0100, Michael Ring wrote:
> > > > 
> > > > I am looking for an easy way to have all cortex-m compilers available
> > > > at the same time to be able to do automated building/testing
> > > There is a similar problem with the AVR target having several
> > > subarchitectures.  One option I think is to have a subarch defined by
> > > the compiler, then it would be easy to lay out the compiled unit
> > > structure in fpc.cfg according to subarch.  I've made an attempt at
> > > adding a subarch define to my local compiler source for AVR, but
> > > haven't developed the idea further.  I'm not a compiler dev so there
> > > may be better options.
> > Subarch directories are imo the best solution, I have a half-backen patch for this, not yet
> > finished
> > though.

I've missed a critical bit om information until now - there is a config file macro replacement
option called $FPCSUBARCH available since r29316.  At the moment I've modified my .fpc.cfg to
use the following include to locate RTL units:

#IFDEF EMBEDDED
-Fu~/fpc/$fpcversion/rtl/units/$fpctarget/$FPCSUBARCH/
#ELSE
-Fu~/fpc/$fpcversion/rtl/units/$fpctarget/
#ENDIF

So far I've compiled the AVR RTL for different subarch types, then copied the units into their
respective subdirectories.  Once this is done switching between different controllers
irrespective of subarch type works.

The additional work required is in my opinion:
* Change makefile to automatically compile all available controllers by subarch type and specify
output directory as rtl/units/$FPCTARGET/$FPCSUBARCH/ or as appropriate for directory
configuration.
* Update fpc.cfg template to reflect change in default rtl directory structure.

Not sure if this approach will work for all embedded targets though.



More information about the fpc-pascal mailing list