Thanks to covid, I had some time on my hands and thought I'd use it to write up how to cross compile from a Linux intel box to a Raspberry Pi. Cannot be that hard.
Indeed, almost trivial to make an arm binary (ie armel), but not a armhf one. Now, the softfloat works fine on a Raspberry Pi and unless its doing a lot of maths, it would not matter. EXCEPT that if you make a debian package that includes a soft arm binary, apt says, "wow, this binary is arm, it therefore depends on somepackage:arm and I cannot find any of them"
So, doing my research, seems I need to pass -CaEABIHF to the compiler, probably while I build the cross compiler, probably in the app. Nope, Error: Illegal parameter: -CaEABIHF in either case. Seems the cross compiler builds OK but first thing it tries to make, system.pp, fails. See -
/usr/arm-linux-gnueabihf/bin/as -meabi=5 -o /usr/share/fpcsrc/3.2.2/rtl/units/arm-linux/ucprt0.o arm/ucprt0.as
/usr/share/fpcsrc/3.2.2/compiler/ppcrossarm -Ur -Parm -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FD/usr/arm-linux-gnueabihf/bin -FE. -FU/usr/share/fpcsrc/3.2.2/rtl/units/arm-linux -CaEABIHF -darm -dRELEASE -CaEABIHF -Us -Sg system.pp
Error: Illegal parameter: -CaEABIHF
My command line to trigger this was -
make clean all OS_TARGET=linux CPU_TARGET=arm CROSSBINDIR=/usr/arm-linux-gnueabihf/bin CROSSOPT=" -CaEABIHF "
but I have tried several combinations of CROSSOPT="-CpARMV6 -CfVFPV2 -OoFASTMATH" - that works OK but makes an armel, as soon as I put the -CaEABIHF in there it fails. Likewise, putting the -CaEABIHF in after the cross compiler and lcl is built triggers a problem when compiling an app.
So, my question is, is -CaEABIHF no longer the way to go, whats its replacement. Or is there some other way to cross compile an armhf binary ?
On a 'real' raspberry pi, the compiler is capable of doing either default or EABIHF, I assume default is armel. But v=cannot find anything written on the subject.
Any ideas please ?
Davo