Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-05

Cross compiling x86_64 -> ARM (RPi) | EABI mis-match.

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bruce Tulloch

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.

I used FPC 2.6.2 to build this FPC 2.7.1 cross compiler. Do I need to use FPC 2.7.1 to build it instead or is there some other reason for this problem?

Bruce.

Reply by email

Jonas Maebe
to Bruce Tulloch
Bruce Tulloch wrote 17 lines
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

Reply by email

Bruce Tulloch
to Jonas Maebe

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

Jonas Maebe wrote 35 lines
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 - http://lists.freepascal.org/**mailman/listinfo/fpc-devel<http://lists.freepascal.org/mailman/listinfo/fpc-devel>

Reply by email

Jonas Maebe
to Bruce Tulloch
Bruce Tulloch wrote 5 lines
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

Reply by email

Bruce Tulloch
to Jonas Maebe

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

Jonas Maebe wrote 23 lines
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 - http://lists.freepascal.org/**mailman/listinfo/fpc-devel<http://lists.freepascal.org/mailman/listinfo/fpc-devel>

Reply by email