I am doing something similar to what you are doing, see below....

I also needed to create a softlink so that fpc can call ppcrossarm, it expects to call ppcarm

By using 'INSTALL_UNITDIR' there is no need to copy files at the end.

You will need to do a little tweak in fpc.cfg, after this it is transparent to handle the different subarchs, at least for arm and mipsel ;-)

Now I can use fpc to select matching arch/subarch and Lazarus works just fine.

Michael

fpc-cfg change:

# searchpath for units and other system dependent things
#ifdef embedded
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/$fpcsubarch
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/$fpcsubarch/*
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/$fpcsubarch/rtl
#else
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/rtl
#endif

--- snip

Buildscript:

  CROSSOPT="-O1 -gw2 -dDEBUG"
  #CROSSOPT="-O1 -gw2 -dDEBUG -godwarfcpp"

  SUBARCH=armv6m
  make clean buildbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-none-eabi- || exit 1   make installbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-none-eabi- INSTALL_UNITDIR=/usr/local/lib/fpc/3.1.1/units/arm-embedded/$SUBARCH/rtl || exit 1   #mv /usr/local/lib/fpc/3.1.1/ppcrossarm /usr/local/lib/fpc/3.1.1/ppcrossarm-$SUBARCH

  SUBARCH=armv7m
  make clean buildbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-none-eabi- || exit 1   make installbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-none-eabi- INSTALL_UNITDIR=/usr/local/lib/fpc/3.1.1/units/arm-embedded/$SUBARCH/rtl || exit 1   #mv /usr/local/lib/fpc/3.1.1/ppcrossarm /usr/local/lib/fpc/3.1.1/ppcrossarm-$SUBARCH

  SUBARCH=armv7em
  make clean buildbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-none-eabi- || exit 1   make installbase CROSSINSTALL=1 OS_TARGET=embedded CPU_TARGET=arm SUBARCH=$SUBARCH CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-none-eabi- INSTALL_UNITDIR=/usr/local/lib/fpc/3.1.1/units/arm-embedded/$SUBARCH/rtl || exit 1   #cp /usr/local/lib/fpc/3.1.1/ppcrossarm /usr/local/lib/fpc/3.1.1/ppcrossarm-$SUBARCH
  ln -sf /usr/local/lib/fpc/3.1.1/ppcrossarm /usr/local/bin/ppcarm




Am 22.02.18 um 21:35 schrieb Christo:
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?

Thank you,

Michael


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 made a script file (attached) that iterates through the different 
subarchitectures
available for the AVR compiler, calls make and then moves the compiled units to 
a subdirectory.
I think the logic of this script should be moved to the existing rtl makefile 
so that all
subarchitectures for a target gets generated and sorted in one go.  Of course 
then the default
fpc.cfg ideally needs to be updated to reflect the subarch folder structure for 
ARM and AVR.

I'm putting this out there hoping that someone familiar with the topic and 
makefile syntax can
help with a patch for FPC.


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to