× CodeTyphon Cross-Build Development, discussions and problems

Question Problem Cross-Compiling for Rapberry Pi

  • mervynjoyce
  • Topic Author
  • Visitor
  • Visitor
6 years 4 months ago #7848 by mervynjoyce
Problem Cross-Compiling for Rapberry Pi was created by mervynjoyce
Hello,

This is my first post to the forum. I have been using CT 5.2 since early this year. I have been programming in pascal (Borland/CodeGear/Embarcadaro "Delphi") for about 30 years now. Recently I wanted to build some data collection utilities that could be used on both Linux and Raspberry Pi platforms ... and I found the CodeTyphon project.

My original development platform was/is 64-bit Windows 7 laptop using CT 5.2. It works great! Code for the project cross-compiles to x86_64 Linux (to run on Fedora Core 20, 21 and 22 target machines) without any problem, as well as the Raspberry Pi (running raspbian).

As the laptop is getting old I thought I would invest in a new development machine. I have built two platforms for testing:

1) x86_64 Linux (using Fedora Core 20 and CT 5.2
2) 64-bit Windows 10 using CT 5.4

The same source programs which cross-compile successfully from my original Windows 7 platform fail to produce Raspberry Pi builds on both the new platforms. They do however both successfully build code for the x86_64 Linux target OK. The problem reported when building for the Raspberry Pi is the same on both ... it is a link error complaining about EABI version mis-match.

To demonstrate the problem I have written a very basic console application that simply opens and closes a database connection (using ZeosDBO). I can compile it for a x86_64 Linux target, but not for the Raspberry Pi. I am using the raspbian library from the download binLibraries kit.

The source kit is available at: onedrive.live.com/redir?resid=16B875E4F9...83E&ithint=folder%2c

Any thoughts

Merv

Please Log in or Create an account to join the conversation.

More
6 years 4 months ago #7849 by universe
Replied by universe on topic Problem Cross-Compiling for Rapberry Pi
Hello, did you build "FPC32 build cross element arm-linux" or "FPC32 build cross element arm-linux--RaspberryPi"? cause I faced the same issue as yours and solved getting the toolchain and creating the specific compiler. Hope this helps
The following user(s) said Thank You: mervynjoyce

Please Log in or Create an account to join the conversation.

  • mervynjoyce
  • Topic Author
  • Visitor
  • Visitor
6 years 4 months ago #7850 by mervynjoyce
Replied by mervynjoyce on topic Problem Cross-Compiling for Rapberry Pi
Thanks for the comment, but i don't fully understand your question.

From within the IDE (using typhon32 not 64 on the Windows platform) i go into project options/Config and Target and change the target from default/default to linux/arm. I then go to Paths and set "libraries" to be c:\codetyphon\binlibraries\arm-linux-Raspbian and then perform a "run/build".

If you can explain your method I will give it a try

Merv

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
6 years 4 months ago - 6 years 4 months ago #7851 by Sternas Stefanos
Replied by Sternas Stefanos on topic Problem Cross-Compiling for Rapberry Pi
Sir
on Windows 10 (you must run CTCenter as Administrator) with Typhon32 we build your project (with no modifications)
without any problem.




I thing you are using NOT correct OS-LIbraries for Raspberry Pi,
for our test we used arm-linux-Raspbian.7z OS-LIbrary file




Now My Suggestions for better Multi-OS project
you can use $(TyphonDir)/ IDE variable
$(TyphonDir)/components/pl_ZeosDBO/source/component/
$(TyphonDir)/components/pl_ZeosDBO/source/core/
$(TyphonDir)/components/pl_ZeosDBO/source/dbc/
$(TyphonDir)/components/pl_ZeosDBO/source/parsesql/
$(TyphonDir)/components/pl_ZeosDBO/source/plain/

and $(CTDIR)/ IDE Variable
$(CTDIR)/binLibraries/arm-linux-Raspbian/



PilotLogic Architect and Core Programmer
Last edit: 6 years 4 months ago by Sternas Stefanos.
The following user(s) said Thank You: mervynjoyce

Please Log in or Create an account to join the conversation.

  • mervynjoyce
  • Topic Author
  • Visitor
  • Visitor
6 years 4 months ago #7852 by mervynjoyce
Replied by mervynjoyce on topic Problem Cross-Compiling for Rapberry Pi
sternas,

Many Many thanks for your reply. The problem is SOLVED!

My primary problem was that I had done a FreePascal 32-bit build for arm-Linux NOT arm-Linux-Raspberry-PI. This option did not exist under CT5.2 and I just blindly followed the process I used previously ... I should learn to read the prompts. I was using the arm-Linux-Raspian library as you indicated.

Also thanks for the suggestions on using the pre-defined directory variables ... this will make the source code portable between windows and Linux platforms.

The CodeTyphon package is an excellent development environment. Even as an IDE it is superior to others and when you consider how simple you have made it to do cross-build it is just amazing. Many thanks to you and your helpers/contributors for this EXCELLENT product.

Pascal has come a long way from the first pascal compiler I used under DEC RT11 back in 1978.

thanks and regards,
Merv

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
6 years 4 months ago #7853 by Sternas Stefanos
Replied by Sternas Stefanos on topic Problem Cross-Compiling for Rapberry Pi
Thanks Sir

Object Pascal has a lot more to give...
I thing we are only at the start...

have fun

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.