[fpc-pascal] Is this the correct way to configure fpc for multiple arm-embedded subarchs?
mail at michael-ring.org
Sun Nov 26 17:19:10 CET 2017
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
Inspired by the -V parameter of fpc I started my journey and ended up
with something different.
My question is now did I go down the correct path or is there a better
way to fulfill my requirements:
- I want to be able to switch between armv6m, armv7m and armv7em without
the need to build the matching compiler/rtl
- I want lazarus to use fpc as start compiler, I want to be able to
configure the whole compiler switching via Project settings.
- I want to be able to use lazbuild so that I can do automated builds of
my lazarus projects.
I found this helpful page:
but in the end this approach did not work for me, FPC version switcher
is not available in lazarus svn (or I am too blind to find it) and in
the end I had some issues with using lazbuild when defining the -V
switch in my project settings.
In the end I came up with the following approach:
Build ppcrossarm and make sure that the rtls do end up in those directories:
created a softlink so that the crosscompiler can be caled via
ln -sf /usr/local/lib/fpc/3.1.1/ppcrossarm /usr/local/bin/ppcarm
added the following to my /etc/fpc.cfg:
and then I add the following lines to the user-defined project settings
I thought about putting
in the project Settings so that I do not need to tweak /etc/fpc.cfg but
I do not like the fact that I have to hardcode paths there, is there a
better way? If yes then I'd prefer that a lot over tweaking /etc/fpc.cfg
Here's how I build the cross-compiler:
make clean buildbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm
SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-none-eabi- ||
make installbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm
SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-none-eabi-
|| exit 1
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal