Sign in Join

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

Mailing lists / lazarus / 2011-01

Cross-compile for ARM-Linux on a Windows host????

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

I am setting up an environment for developing a simple GUI application for RS232 communications that will eventually be loaded on an embedded ARM system running a debian linux port.

I am not used to Linux so I figured I could develop on Windows and test it natively there and then cross-compile for the ARM-linux platform when I am done.

For the development I have installed FPC 2.4.2 and gotten Lazarus, both trunk and the fixes_0_9_30 branch from SVN. Both compiled OK so I am good concerning the Windows dev tools.

Question 1:
Is the scenario I am after at all possible?

Question 2:
I have tried to locate an FPC 2.4.2 cross compiler for ARM targets running on a Windows host, but failed. Is one available or must I change my development hosting to a (for me unknown) linux system? I *have* googled some wiki pages outlining cross-compile for ARM, but these are using linux as the host, unfortunately...

TIA

Bo Berglund Developer in Sweden

Reply by email

Henry Vermaak
to Bo Berglund
Bo Berglund wrote
Question 1: Is the scenario I am after at all possible?

At least for fpc, I don't see why not, but I haven't tried it. It will be a lot more natural when the host and target os are the same, though.

Show quoted text 6 lines
Question 2: I have tried to locate an FPC 2.4.2 cross compiler for ARM targets running on a Windows host, but failed. Is one available or must I change my development hosting to a (for me unknown) linux system? I *have* googled some wiki pages outlining cross-compile for ARM, but these are using linux as the host, unfortunately...

The procedure should be more or less the same. You'll need the cross binutils, which Marco has built (with handy modifications):

ftp://ftp.freepascal.org/pub/fpc/contrib/cross/binutils-2.20-arm-linux-elf.zip

Henry

Reply by email

Paul Breneman
to Bo Berglund: I am setting up an environment for developing a simple GUI application for RS232…

Hi Bo,

Show quoted text 21 lines
I am setting up an environment for developing a simple GUI application for RS232 communications that will eventually be loaded on an embedded ARM system running a debian linux port. I am not used to Linux so I figured I could develop on Windows and test it natively there and then cross-compile for the ARM-linux platform when I am done. For the development I have installed FPC 2.4.2 and gotten Lazarus, both trunk and the fixes_0_9_30 branch from SVN. Both compiled OK so I am good concerning the Windows dev tools. Question 1: Is the scenario I am after at all possible? Question 2: I have tried to locate an FPC 2.4.2 cross compiler for ARM targets running on a Windows host, but failed. Is one available or must I change my development hosting to a (for me unknown) linux system? I *have* googled some wiki pages outlining cross-compile for ARM, but these are using linux as the host, unfortunately...

What you want is certainly possible but you might need to learn how to build your own cross-compile FPC and Lazarus. You might consider doing what I did and install CodeTyphon in a virtual machine: http://www.pilotlogic.com/

That uses a recent FPC and Lazarus trunk so it isn't the stable versions you want. But it might be useful for you to see what is possible on Windows:
http://www.pilotlogic.com/codetyphon_help/layers_and_areas.htm

Paul

Reply by email

Bo Berglund
to Paul Breneman
Paul Breneman wrote 35 lines
Hi Bo, > I am setting up an environment for developing a simple GUI application > for RS232 communications that will eventually be loaded on an embedded > ARM system running a debian linux port. > > I am not used to Linux so I figured I could develop on Windows and > test it natively there and then cross-compile for the ARM-linux > platform when I am done. > > For the development I have installed FPC 2.4.2 and gotten Lazarus, > both trunk and the fixes_0_9_30 branch from SVN. Both compiled OK so I > am good concerning the Windows dev tools. > > Question 1: > Is the scenario I am after at all possible? > > Question 2: > I have tried to locate an FPC 2.4.2 cross compiler for ARM targets > running on a Windows host, but failed. Is one available or must I > change my development hosting to a (for me unknown) linux system? > I *have* googled some wiki pages outlining cross-compile for ARM, but > these are using linux as the host, unfortunately... What you want is certainly possible but you might need to learn how to build your own cross-compile FPC and Lazarus. You might consider doing what I did and install CodeTyphon in a virtual machine: http://www.pilotlogic.com/ That uses a recent FPC and Lazarus trunk so it isn't the stable versions you want. But it might be useful for you to see what is possible on Windows: http://www.pilotlogic.com/codetyphon_help/layers_and_areas.htm Paul

Thanks,
if most people use Linux (Ubuntu?) to do the cross-compile stuff I might as well fix me up with a virtual machine running Ubuntu. In fact I have done this several times already but every time I never get around to actually using the Ubuntu VM for anything....

Incidentally, my target as you might guess is the board you told me about a couple of months back...

Since then I am retiring my old DELL XP-Pro PC in favour of an HP EliteBook laptop with Win7 X64. Turns out that I had to also create a virtual machine for running some of my older dev tools on since they would not work on Win7. So I already have decided to put all the dev tools in an XP VM (VMWare), which is what I am setting up right now.

Could as well also create an Ubuntu 10 VM for the FPC and Lazarus cross compile.
But now I had a quick look at the CodeTyphon project you linked to and found that it probably runs on Win32 (my XP VM), so I will download it and have alook. :-)
Thanks again.

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Paul Breneman: What you want is certainly possible but you might need to learn how to build your own…
Paul Breneman wrote 11 lines
What you want is certainly possible but you might need to learn how to build your own cross-compile FPC and Lazarus. You might consider doing what I did and install CodeTyphon in a virtual machine: http://www.pilotlogic.com/ That uses a recent FPC and Lazarus trunk so it isn't the stable versions you want. But it might be useful for you to see what is possible on Windows: http://www.pilotlogic.com/codetyphon_help/layers_and_areas.htm Paul

Now I went ahead and downloaded and extracted the CodeTyphon zipfile to the root of my C-drive so it created the CodeTyphon directory with everything inside.
Then I started the batch file setup.bat and selected mode 7. This started a lot of activity in a command window, which went on and on.

I noted that this batch file somehow used my already existing FPC 2.4.2 installation, which I think it should not do. Anyway I went off to have dinner and meanwhile the script finished, but without leaving the window visible so one could see the end result.
And there was no sign of any lazarus executable anywhere...

So then I tried to modify the setup.bat file as follows:
1) Reset path such that the path to C:\Programs\fpc\2.4.2\.... would be removed, thereby making the existing fpc invisible to the setup script.
2) Add a pause at the end so that it is possible to still see what had been going on.

Then I deleted the lazarus and pp folders the first run had created and ran the setup.bat file once more.

Strangely after a while I noticed that STILL my existing FPC was used from my previous install from the windows installer.... How could the setup script find it?????

And there were errors in the now remaining window, some of them here:

Compiling .\source\core\ZClasses.pas
ZClasses.pas(93,38) Fatal: Syntax error, ":" expected but "identifier IID" found
Fatal: Compilation aborted
make.exe[2]: *** [pl_zeosdbocomp.ppu] Error 1
make.exe[2]: Leaving directory `c:/lazarus/components/pl_ZeosDBO' make.exe[1]: *** [bigidecomponents] Error 2
make.exe[1]: Leaving directory `c:/lazarus/components' C:\pp\bin\i386-win32\make.exe: *** [bigidecomponents] Error 2

---------------------------------------------------------- Strip Lazarus
---------------------------------------------------------- INFO: Lazarus.exe NOT EXIST !!!
...

?????????????????????????????????????????????????????? ERROR: Lazarus32 IDE NOT Build
??????????????????????????????????????????????????????

What is going on?

Bo Berglund Developer in Sweden

Reply by email

Vincent Snijders
to Bo Berglund

2011/1/4 Bo Berglund :

Show quoted text 7 lines
And there were errors in the now remaining window, some of them here: Compiling .\source\core\ZClasses.pas ZClasses.pas(93,38) Fatal: Syntax error, ":" expected but "identifier IID" found Fatal: Compilation aborted make.exe[2]: *** [pl_zeosdbocomp.ppu] Error 1

I have not enough information to tell you anything, but I would investigate http://wiki.freepascal.org/User_Changes_Trunk#IInterface.QueryInterface.2C_._AddRef_and_._Release_definitions_have_been_changed

Vincent

Reply by email

Sven Barth
to Bo Berglund: On Mon, 03 Jan 2011 10:37:41 -0500, Paul Breneman Now I went ahead and downloaded and…
Bo Berglund wrote 42 lines
On Mon, 03 Jan 2011 10:37:41 -0500, Paul Breneman wrote: > What you want is certainly possible but you might need to learn how to > build your own cross-compile FPC and Lazarus. You might consider doing > what I did and install CodeTyphon in a virtual machine: > http://www.pilotlogic.com/ > > That uses a recent FPC and Lazarus trunk so it isn't the stable versions > you want. But it might be useful for you to see what is possible on > Windows: > http://www.pilotlogic.com/codetyphon_help/layers_and_areas.htm > > Paul Now I went ahead and downloaded and extracted the CodeTyphon zipfile to the root of my C-drive so it created the CodeTyphon directory with everything inside. Then I started the batch file setup.bat and selected mode 7. This started a lot of activity in a command window, which went on and on. I noted that this batch file somehow used my already existing FPC 2.4.2 installation, which I think it should not do. Anyway I went off to have dinner and meanwhile the script finished, but without leaving the window visible so one could see the end result. And there was no sign of any lazarus executable anywhere... So then I tried to modify the setup.bat file as follows: 1) Reset path such that the path to C:\Programs\fpc\2.4.2\.... would be removed, thereby making the existing fpc invisible to the setup script. 2) Add a pause at the end so that it is possible to still see what had been going on. Then I deleted the lazarus and pp folders the first run had created and ran the setup.bat file once more. Strangely after a while I noticed that STILL my existing FPC was used from my previous install from the windows installer.... How could the setup script find it?????

Just a guess: the FPC directory is in your PATH variable.

Regards,
Sven

Reply by email

Bo Berglund
to Sven Barth
Sven Barth wrote 6 lines
> Strangely after a while I noticed that STILL my existing FPC was used > from my previous install from the windows installer.... > How could the setup script find it????? Just a guess: the FPC directory is in your PATH variable.

Yes, originally it is. But I modified the setup.bat file as follows: SET PATH = %systemroot%
is put in at the start of processing for mode 7 to get rid of that connection....

But overnight I got it to work using brute force:
I renamed the C:\Programs\fpc dir to fpc.disable.
Then the setup.bat file worked. :-)

What I cannot understand is why this PATH change did not work, normally a batch file that includes setting of the PATH variable means that any other path is removed and for the running of the batch file only the new settings are active. This is how I have arranged my lazarus build batch files for example and they work just fine. I have several such files for building lazarus using different FPC versions.

Bo Berglund Developer in Sweden

Reply by email

Henry Vermaak
to Henry Vermaak: At least for fpc, I don't see why not, but I haven't tried it. It will be a lot more…
Henry Vermaak wrote 6 lines
On 2 January 2011 22:28, Bo Berglund wrote: > > Question 1: > Is the scenario I am after at all possible? At least for fpc, I don't see why not, but I haven't tried it. It

I've tried this, now. FPC and lazarus lcl builds without issue. I used msys/mingw and cross-built my own binutils. This should also be possible using the binutils Marco built.

Henry

Reply by email