Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GNAT on Raspberry Pi?

329 views
Skip to first unread message

mockturtle

unread,
Oct 19, 2017, 4:13:23 PM10/19/17
to
Dear all,
I just got a Raspberry Pi 3. It works nicely and I wanted to install GNAT tools. I went to the libreada site, selected the ARM binary, downloaded it and installed it, but in the end I get a

Bad exec format

Calling "file" on gps_exe it says that gps_exe is for 80386, not for ARM, despite the fact that the name of the archive is

gnat-gpl-2017-arm-...

so, I guess, it should be for ARM. I also tried the 2016 Raspberry 2 specific version (there is not the 2017 release) and also the 2015 one, but still file says that the files are for 80386. Now I am trying with the 2015 release for ARM-linux, but I have little hope...

Any suggestion?

Thanks,

Riccardo

mockturtle

unread,
Oct 19, 2017, 4:28:37 PM10/19/17
to
I am replying to my own post to say that

* even 2015,arm version is recognized as 80386 code

* I looked directly inside the executable and the e_machine is actually 3 which is "80386", other executable on my RPi have 40 which is ARM

In alternative, does someone have experience in cross-compiling with GNAT GPL for RPi?

Riccardo

Anh Vo

unread,
Oct 19, 2017, 8:03:44 PM10/19/17
to
Make sure your GNAT-ARM is selected under your Project Properties -> Build -> Toolchain.

Anh Vo

Dmitry A. Kazakov

unread,
Oct 20, 2017, 3:28:22 AM10/20/17
to
On 19/10/2017 22:13, mockturtle wrote:

> I just got a Raspberry Pi 3.

A big disappointment regarding performance, but that's aide.

> It works nicely and I wanted to install GNAT tools. I went to the
> libreada site, selected the ARM binary, downloaded it and installed it,
> but in the end I get a
[...]
> Any suggestion?

Why don't you just install Debian or Fedora there? The FSF GNAT 7
compiler works right out of the box. Both armhf and arm64 (RPI 3 is
64-bit) flavors are available. I shortly tested arm64 Ada on Fedora,
before I switched back to 32-bit, it worked nicely.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

mockturtle

unread,
Oct 20, 2017, 6:31:12 AM10/20/17
to
On Friday, October 20, 2017 at 9:28:22 AM UTC+2, Dmitry A. Kazakov wrote:
> On 19/10/2017 22:13, mockturtle wrote:
>
> > I just got a Raspberry Pi 3.
>
> A big disappointment regarding performance, but that's aide.
>

True, pretty slow, especially for file system access (it is my impression). Anyway, I want to make a demonstrator with it and it is fairly good for that.

>
> Why don't you just install Debian or Fedora there? The FSF GNAT 7
> compiler works right out of the box. Both armhf and arm64 (RPI 3 is
> 64-bit) flavors are available. I shortly tested arm64 Ada on Fedora,
> before I switched back to 32-bit, it worked nicely.
>

Your suggestion gave me the idea of trying to install it via apt-get (it could seem strange that I did not think about it before, that is because I am used to install the version on the libre.adacore site and I did not consider apt-get). It works, it seems a pretty old version (2015? 2014?), but it is enough for my needs.

Anyway, I wrote to AdaCore anyway since it is strange that the package for ARM contains 80386 executables (is maybe something escaping me?).

mockturtle

unread,
Oct 20, 2017, 6:32:55 AM10/20/17
to
BTW, I am using the Rpi with its 7" touch screen. Cute, but using GPS over a 7" is kind of claustrophobic... Fortunately, I can do ssh and work remotly over a 17" screen...

Simon Wright

unread,
Oct 20, 2017, 6:57:55 AM10/20/17
to
mockturtle <frame...@gmail.com> writes:

> Anyway, I wrote to AdaCore anyway since it is strange that the package
> for ARM contains 80386 executables (is maybe something escaping me?).

The clue is in the "Select your platform" list on the download page:
"ARM ELF format (hosted on Linux)" - or "on Windows". This is a
cross-compiler, run on a host x86 computer (Windows or Linux) which
produces executables to run on an ARM ELF target computer.

What I don't know is whether the executables run on a bare metal target
(which might happen to be a Pi board) or whether they run on a Pi which
is running Linux. I strongly suspect the former, especially because the
"Select your platform" entry for "Raspberry Pi 2 Linux (32 bits) (hosted
on Linux)" is greyed out! (it was available in GNAT GPL 2016).

Dmitry A. Kazakov

unread,
Oct 20, 2017, 7:59:00 AM10/20/17
to
If you have a desktop you can develop just there. Ada is perfectly
portable. I write everything under Windows. Porting to ARM is a matter
of recompiling.

Björn Lundin

unread,
Oct 20, 2017, 10:35:44 AM10/20/17
to
On 2017-10-20 13:58, Dmitry A. Kazakov wrote:
> On 20/10/2017 12:32, mockturtle wrote:
>> BTW, I am using the Rpi with its 7" touch screen. Cute, but using GPS
>> over a 7" is kind of claustrophobic... Fortunately, I can do ssh and
>> work remotly over a 17" screen...
>
> If you have a desktop you can develop just there. Ada is perfectly
> portable. I write everything under Windows. Porting to ARM is a matter
> of recompiling.
>

Yes, just use some kind of version handling (git/svn)
and perhaps some variables in the gpr projectfile.
(different paths for external libs etc)

Depending on personal preference, some of our staff
do coding in windows, others in Linux.

And it is always compiled on those two OSes + AIX.
svn + scenario variables in gpr files handles the differences


--
--
Björn

mockturtle

unread,
Oct 20, 2017, 4:21:57 PM10/20/17
to
Ahhh... I saw the light...

Now it is clear! Instead I believed that it was a compiler *running* on ARM. The meaning of "hosted on Linux" it was not entirely clear to me, but I ignored it...
0 new messages