Re: [fpc-devel] Cross compiling x86_64 - ARM (RPi) | EABI mis-match.
On 23 May 2013, at 05:54, Bruce Tulloch wrote: I built FPC 2.7.1 from trunk to cross compile as: make crossall crosszipinstall \ CPU_TARGET=arm OS_TARGET=linux \ CROSSBINDIR=/usr/local/opt/binutils/bin \ BINUTILSPREFIX=arm-linux- \ OPT=-XX -CX -dFPC_ARMHF When using this cross compiler to build my code (also with - dFPC_ARMHF) I get this error at the end of the link: /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/cprt0.o has EABI version 0, but target a.out has EABI version 5 which suggests the RTL was not built with EABI 5. cpr0.o is not generated by the compiler from Pascal code, but directly from assembler. The code in that file is not specific to any ABI. The Makefile does not appear to pass the proper parameters to the assembler when processing that file during a compilation for the ARMHF target, so it doesn't get the proper markers. I'm not even certain whether the Makefile can easily determine that we are compiling for ARMHF. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Cross compiling x86_64 - ARM (RPi) | EABI mis-match.
Okay, thanks, so I should be able to simply patch the makefile in my copy of the fpc source to apply the correct assembler parameters when (re)building the RTL to fix this problem, right? If so, I'll look into doing this when I've resolved the cthreads issue. -b On Thu, May 23, 2013 at 10:29 PM, Jonas Maebe jonas.ma...@elis.ugent.bewrote: On 23 May 2013, at 05:54, Bruce Tulloch wrote: I built FPC 2.7.1 from trunk to cross compile as: make crossall crosszipinstall \ CPU_TARGET=arm OS_TARGET=linux \ CROSSBINDIR=/usr/local/opt/**binutils/bin \ BINUTILSPREFIX=arm-linux- \ OPT=-XX -CX -dFPC_ARMHF When using this cross compiler to build my code (also with -dFPC_ARMHF) I get this error at the end of the link: /usr/local/lib/fpc/2.7.1/**units/arm-linux/rtl/cprt0.o has EABI version 0, but target a.out has EABI version 5 which suggests the RTL was not built with EABI 5. cpr0.o is not generated by the compiler from Pascal code, but directly from assembler. The code in that file is not specific to any ABI. The Makefile does not appear to pass the proper parameters to the assembler when processing that file during a compilation for the ARMHF target, so it doesn't get the proper markers. I'm not even certain whether the Makefile can easily determine that we are compiling for ARMHF. Jonas __**_ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/**mailman/listinfo/fpc-develhttp://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Cross compiling x86_64 - ARM (RPi) | EABI mis-match.
On 23 May 2013, at 14:49, Bruce Tulloch wrote: Okay, thanks, so I should be able to simply patch the makefile in my copy of the fpc source to apply the correct assembler parameters when (re)building the RTL to fix this problem, right? If so, I'll look into doing this when I've resolved the cthreads issue. -b Yes. In theory, you could specify it on the command line via ASTARGET=somepara, but the problem is that this flag is used both when building natively and when cross-compiling. There is no separate cross version of that flag available. When cross-building from i386 to ARM it would work because for that target the assembler-based loader files are not used, but for x86-64 they are. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Cross compiling x86_64 - ARM (RPi) | EABI mis-match.
Thanks for the tip; I will see if I can apply a patch dynamically when building the ARM cross-compiler and remove it when building all the others (they're all done in a multi-target build script I've written so presumably I just need to amend the clause that builds for ARM). -b On Thu, May 23, 2013 at 10:55 PM, Jonas Maebe jonas.ma...@elis.ugent.bewrote: On 23 May 2013, at 14:49, Bruce Tulloch wrote: Okay, thanks, so I should be able to simply patch the makefile in my copy of the fpc source to apply the correct assembler parameters when (re)building the RTL to fix this problem, right? If so, I'll look into doing this when I've resolved the cthreads issue. -b Yes. In theory, you could specify it on the command line via ASTARGET=somepara, but the problem is that this flag is used both when building natively and when cross-compiling. There is no separate cross version of that flag available. When cross-building from i386 to ARM it would work because for that target the assembler-based loader files are not used, but for x86-64 they are. Jonas __**_ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/**mailman/listinfo/fpc-develhttp://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel