All these instructions are described from the view on a Debian-based Linux system.
  1. Get the lastest binutils sources, and build these with:


  2. Put a repository, which contains a current FreePascal build, for your Debian-based Distribution in your /etc/apt/sources.list

  3. Run: "apt-get install fpc subversion" (Subversion to checkout the FPC svn)

  4. Go in the directory, where you want to checkout the FPC sources from the FPC svn

  5. Run: "svn co http://svn.freepascal.org/svn/fpc/trunk fpc"

  6. Create a directory for the .so Libs from your N900 device, and copy these from your N900 into this directory incl. symlinks as full "non-symlink!!!" copies

  7. Create script "doit" in the from N900 "copied" lib directory with follow content:
    #!/bin/bash
    for FILE in *.so* ; do
      if [ -L "$FILE" ] ; then
        rm -f $FILE
      fi
    done
    for FILE in *.so* ; do
      G=`echo "${FILE}" | grep ".so."`
      if [ -n "${G}" ] ; then  
        A="${FILE%.so*}.so"
        if [ "${A}" != "{$FILE}" ] ; then
          if [ "${A}" != "{$FILE}.so" ] ; then
            ln -s $FILE $A
          fi
        fi
      fi
      G=`echo "${FILE}" | grep "-"`
      if [ -n "${G}" ] ; then  
        A="${FILE%-*}.so"
        if [ "${A}" != "{$FILE}" ] ; then
          if [ "${A}" != "{$FILE}.so" ] ; then
            ln -s $FILE $A
          fi
        fi
      fi
    done
    ln -s ld.so ld-linux.so.2 >/dev/null
            
  8. Chmod 0755 the script and execute it in a terminal
  9. Add follow text to /etc/fpc.cfg:
    #IFDEF CPUARM
    -Fu/usr/lib/fpc/2.5.1/units/$fpctarget/*
    -Fl/usr/lib/fpc/2.5.1/units/$fpctarget/rtl/
    
    -a
    -Sd
    -Xd
    -Xs
    
    -O-
    
    -CpARMV6
    -CfVFPV3
    
    -XP/opt/armbinutils/
    -Xr/usr/lib/fpc/2.5.1/units/arm-linux/rtl/
    -Xr/YOURDIRECTORYWITHTHEN900LIBS
    -XR/YOURDIRECTORYWITHTHEN900LIBS
    -darm
    -Tlinux
    #ENDIF       
            
  10. Create a bash script file "doit" with follow context in the FPC trunk directory:
    #!/bin/sh
    sudo make clean
    sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/opt/armbinutils OPT=-dFPC_ARMEL INSTALL_PREFIX=/usr CROSSOPT="-CpARMV6 -CfVFPV3"
            
  11. Set chmod 0755 for this script file and execute it in a terminal and wait :-)

Now use per project follow make script code:

#!/bin/sh
cp -s /YOURDIRECTORYWITHTHEN900LIBS/*.so* .
ppcarm -s -a -CpARMV6 -CfVFPV3 -Sd -B -dSDL -Xd -Xs -darm -Tlinux -TParm -O3 \
       -XP/opt/armbinutils/ -Xr/usr/lib/fpc/2.5.1/units/arm-linux/rtl/ -Xr/YOURDIRECTORYWITHTHEN900LIBS \
       -XR/YOURDIRECTORYWITHTHEN900LIBS -Fl/YOURDIRECTORYWITHTHEN900LIBS yourmainsourcefile.pas
./ppas.sh
rm -f ppas.sh
rm -f *.so*
    
The cp of the all N900 libs to the current project directory is a temp. workaround hack in the moment to force that the linker ld finds always the "right" .so files from our N900, until LD interprets the -rpath parameter correctly.

Have fun with it! :-)