Sign in Join

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

Mailing lists / fpc-pascal / 2011-11

FPC for ARM

16 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Juha Manninen

Hi

Is FPC 2.2.2 really the latest native release for ARM processors? I guess it can build the more recent versions. (?)

In school we have an interesting project "Developing Open Source Systems" where the idea is to make an internet router out of small DreamPlug computer by Globalscale Technologies, using ready-made open source SW as much as possible.
It has a 1.2 GHz ARM CPU. I would like to install FPC there out of curiosity and then maybe use it in the project.
Installing cross-compilers in school machines is not an options, we will use native compilers instead.

The OS will be Linux Debian or Ubuntu. Can you install FPC for them from a repository as you can for the x86 versions?

I was already looking for net protocol related components. FPC has at least lnet for ARM.

Those small machines are amazing. 1.2 GHz CPU and half a GB memory was a decent desktop machine just few years ago, but those machines consumed power much more.

Has anyone got experience of editing source in a PC (with Lazarus) and then transferring the source through a serial port to an embedded device to be compiled. Are there any tools to make it easier?
Maybe people only use cross-compilers and move binaries, I don't know.

Juha

Reply by email

Henry Vermaak
to Juha Manninen: Hi Is FPC 2.2.2 really the latest native release for ARM processors? I guess it can build…
Juha Manninen wrote
Hi Is FPC 2.2.2 really the latest native release for ARM processors? I guess it can build the more recent versions. (?)

There is an arm release for 2.6.0rc1, but it was built using old binutils (last time I checked, at least):

ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/arm-linux/

So you'll probably have to build it yourself. It does build fine natively on Ubuntu for arm, if you have a bootstrap compiler that works. The one inside
ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/bootstrap/ does not work for me (probably old binutils issue). Let me know if you'd like my bootstrap binary.

Those small machines are amazing. 1.2 GHz CPU and half a GB memory was a decent desktop machine just few years ago, but those machines consumed power much more.

I have a tegra 2 laptop (dual core) and it's pretty usable. Not exactly fast, but lazarus runs with the odd hiccup here and there.

Has anyone got experience of editing source in a PC (with Lazarus) and then transferring the source through a serial port to an embedded device to be compiled. Are there any tools to make it easier? Maybe people only use cross-compilers and move binaries, I don't know.

Install your favourite scm client on the device, then just pull the source over the network? Alternatively transfer the source with scp.

Henry

Reply by email

Thomas Schatzl
to Henry Vermaak

Hi,

Henry Vermaak wrote 10 lines
On 28/11/11 13:41, Juha Manninen wrote: > Hi > > Is FPC 2.2.2 really the latest native release for ARM processors? > I guess it can build the more recent versions. (?) There is an arm release for 2.6.0rc1, but it was built using old binutils (last time I checked, at least): ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/arm-linux/

What OS/version are you using? Maybe some OS setup issue? On an HP Touchpad and a Sheevaplug-like system, which are both eabi5, the bootstrap compiler and fpc produced executables work just fine.

The eabi4 type of the bootstrap compiler originates from the build machine running on the latest debian lenny (5.0.9) which unfortunately only has very old binutils from 2008 (2.18.x) in its distro, or defaults to eabi4 output. At least its GNU as seems to simply ignore a -meabi=5 assembler switch.

However even that build machine seems to be able to run eabi5 executables fine. E.g. I copied over the bzip2 executable from an eabi5 machine to the build machine.

$ objdump -x ./bzip2 | grep ersion
Version References:
private flags = 5000002: [Version5 EABI] [has entry point] $ ./bzip2 --version
bzip2, a block-sorting file compressor. Version 1.0.4, 20-Dec-2006.

Copyright (C) 1996-2006 by Julian Seward.

This program is free software; you can redistribute it and/or modify it under the terms set out in the LICENSE file, which is included in the bzip2-1.0.4 source distribution.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for more details.

bzip2: I won't write compressed data to a terminal. bzip2: For help, type: `bzip2 --help'.
$ objdump -x /bin/bzip2 | grep ersion
Version References:
private flags = 4000002: [Version4 EABI] [has entry point]

Might not be representative, but it seems to me that your system is somewhat oddly configured. (Maybe its some debian thing?)

I do not mind trying to switch to eabi5 by default, but there might be systems which absolutely require eabi4 which seems to be some lowest common denominator, i.e. also eabi5 setups seem to be able to run them anyway.

Thomas

Reply by email

Juha Manninen
to Thomas Schatzl

2011/11/29 Thomas Schatzl

Show quoted text 15 lines
There is an arm release for 2.6.0rc1, but it was built using old > binutils (last time I checked, at least): > > ftp://freepascal.stack.nl/pub/**fpc/beta/2.6.0-rc1/arm-linux/<ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/arm-linux/> > What OS/version are you using? Maybe some OS setup issue? On an HP Touchpad and a Sheevaplug-like system, which are both eabi5, the bootstrap compiler and fpc produced executables work just fine. The eabi4 type of the bootstrap compiler originates from the build machine running on the latest debian lenny (5.0.9) which unfortunately only has very old binutils from 2008 (2.18.x) in its distro, or defaults to eabi4 output. At least its GNU as seems to simply ignore a -meabi=5 assembler switch.

I don't even know what means eabi4 and eabi5. I guess I will learn it on the way with the new gadget.
I think it now has Debian lenny but it will be replaced with a more recent Linux as part of the exercise.
I will write more when I actually start to install FPC there.

Juha

Reply by email

Henry Vermaak
to Thomas Schatzl: What OS/version are you using? Maybe some OS setup issue? On an HP Touchpad and a…
Thomas Schatzl wrote 17 lines
Hi, Am 28.11.2011 15:18, schrieb Henry Vermaak: > On 28/11/11 13:41, Juha Manninen wrote: >> Hi >> >> Is FPC 2.2.2 really the latest native release for ARM processors? >> I guess it can build the more recent versions. (?) > > There is an arm release for 2.6.0rc1, but it was built using old > binutils (last time I checked, at least): > > ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/arm-linux/ What OS/version are you using? Maybe some OS setup issue? On an HP Touchpad and a Sheevaplug-like system, which are both eabi5, the bootstrap compiler and fpc produced executables work just fine.

Ubuntu, which is quite a popular distro for arm systems, for some weird reason. What setup issue do you think can cause an internal error in the bootstrap compiler?

I had no idea, so I cross compiled my own bootstrap compiler (with -gl) to try and debug the error, but the one I built with an up to date binutils simply worked.

I do not mind trying to switch to eabi5 by default, but there might be systems which absolutely require eabi4 which seems to be some lowest common denominator, i.e. also eabi5 setups seem to be able to run them anyway.

I don't mind either way, since I tend to build my own compilers. I just wanted to point out that eabi version 4 is out of date. It was used in pre-releases of the abi. I honestly don't know what the differences are between the versions and whether they even affect the workings of fpc. I thought that the linker probably wont let you link against objects that have a different eabi version (at least it refused to link version 0 and 4, which is understandable).

Henry

Reply by email

Marco van de Voort
to Felipe Monteiro de Carvalho

In our previous episode, Felipe Monteiro de Carvalho said:

Show quoted text 6 lines
wrote: > I don't even know what means?eabi4 and?eabi5. I'm not sure what it means exactly either, but for example Android no longer supports eabi 4, so it looks obsolete. I use eabi 5 for my Android development.

It's obsolete to use these for new devices lines.

But device lines that have started using older EABI lines still use this, even for new devices from that series.

E.g. many filers still use the original Marvell Montevista release using kernel 27 or so.

Reply by email

Juha Manninen
to Henry Vermaak: There is an arm release for 2.6.0rc1, but it was built using old binutils (last time I…

2011/11/28 Henry Vermaak

Show quoted text 5 lines
There is an arm release for 2.6.0rc1, but it was built using old binutils (last time I checked, at least): ftp://freepascal.stack.nl/pub/**fpc/beta/2.6.0-rc1/arm-linux/<ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/arm-linux/>

I finally got into installing and testing FPC in the ARM-gadget. Other people had replaced the original Debian with Ubuntu 9.something. I was able to copy and install your FPC 2.6.0-rc1 package there. It was easier than I thought!
The compiler itself works but assembler is missing. See : ---
fpc hello.pp
Free Pascal Compiler version 2.6.0rc1 [2011/10/20] for arm Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for ARMEL
Compiling hello.pp
Assembling hello
hello.pp(19,27) Error: Assembler as not found, switching to external assembling
hello.pp(19,27) Fatal: There were 1 errors compiling module, stopping ---

Does it mean an assembler is always needed with ARM? In my understanding x86 based PCs don't need a separate assembler with FPC. "apt-get install as" didn't install anything.

So you'll probably have to build it yourself. It does build fine natively

on Ubuntu for arm, if you have a bootstrap compiler that works. The one inside ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/bootstrap/ does not work for me (probably old binutils issue). Let me know if you'd like my bootstrap binary.

I think it works with old binutils because the Ubuntu version is not very new either.
Or, is this related to the missing assembler issue somehow?

Juha

Reply by email

Henry Vermaak
to Juha Manninen
Juha Manninen wrote 16 lines
The compiler itself works but assembler is missing. See : --- fpc hello.pp Free Pascal Compiler version 2.6.0rc1 [2011/10/20] for arm Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling hello.pp Assembling hello hello.pp(19,27) Error: Assembler as not found, switching to external assembling hello.pp(19,27) Fatal: There were 1 errors compiling module, stopping --- Does it mean an assembler is always needed with ARM? In my understanding x86 based PCs don't need a separate assembler with FPC. "apt-get install as" didn't install anything.

You probably have to install the binutils package.

Henry

Reply by email

Thomas Schatzl
to Juha Manninen: 2011/11/28 Henry Vermaak I finally got into installing and testing FPC in the ARM-gadget.…

Hi,

Juha Manninen wrote 26 lines
2011/11/28 Henry Vermaak There is an arm release for 2.6.0rc1, but it was built using old binutils (last time I checked, at least): ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/arm-linux/ I finally got into installing and testing FPC in the ARM-gadget. Other people had replaced the original Debian with Ubuntu 9.something. I was able to copy and install your FPC 2.6.0-rc1 package there. It was easier than I thought! The compiler itself works but assembler is missing. See : --- fpc hello.pp Free Pascal Compiler version 2.6.0rc1 [2011/10/20] for arm Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling hello.pp Assembling hello hello.pp(19,27) Error: Assembler as not found, switching to external assembling hello.pp(19,27) Fatal: There were 1 errors compiling module, stopping --- Does it mean an assembler is always needed with ARM? In my understanding x86 based PCs don't need a separate assembler with FPC. "apt-get install as" didn't install anything.

Afaik only the Windows platforms have an internal assembler and linker. At least arm/ppc*-linux needs GNU binutils.

The solution is to install the "binutils" package on Debian systems.

The error reported by the original poster (H. Vermaak) seems to be caused by some compiler internal error observed when running the bootstrap compiler on that system, which may have various reasons. (http://permalink.gmane.org/gmane.comp.compilers.free-pascal.general/25299)

"... What setup issue do you think can cause an *internal error* in the bootstrap compiler?" (emphasis mine)

Since you already reached the assembling/linking stage with the bootstrap compiler, you did not encounter it.

Thomas

Reply by email

Marco van de Voort
to Thomas Schatzl

In our previous episode, Thomas Schatzl said:

Show quoted text 5 lines
> Does it mean an assembler is always needed with ARM? In my > understanding x86 based PCs don't need a separate assembler with FPC. > "apt-get install as" didn't install anything. Afaik only the Windows platforms have an internal assembler and linker.

FreeBSD and Linux x86 and x86_64 have internal assembler, but not linker. Though the FreeBSD/x86_64 internal assembler is only enable in trunk afaik.

Be careful with binutils on ARM though, there are multiple ABIs, and the installed ones must match the device.

Reply by email

Juha Manninen
to Marco van de Voort

2011/12/19 Marco van de Voort

Show quoted text 6 lines
FreeBSD and Linux x86 and x86_64 have internal assembler, but not linker. Though the FreeBSD/x86_64 internal assembler is only enable in trunk afaik. Be careful with binutils on ARM though, there are multiple ABIs, and the installed ones must match the device.

I ran "apt-get install binutils" in the already installed Ubuntu and it worked.
I have understood ARM also supports many instruction sets like Thumb and Thumb-2.
I have no idea which one is running now, but it is not important because it works.
Thanks for help.

Is there an embedded web-server that would run on the ARM machine?

Juha

Reply by email

Marco van de Voort
to Juha Manninen

In our previous episode, Juha Manninen said:

Show quoted text 9 lines
I ran "apt-get install binutils" in the already installed Ubuntu and it worked. I have understood ARM also supports many instruction sets like Thumb and Thumb-2. I have no idea which one is running now, but it is not important because it works. Thanks for help. Is there an embedded web-server that would run on the ARM machine?

Afaik most ARMs simply run httpd/apache.

Reply by email