User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Gnat-4.6 for Raspbian

Fri Jul 13, 2012 6:33 pm

I just wanted to move the topic of getting gnat-4.6 (and Ada compiler) for Raspbian to its own topic. It's one of the last Debian packaged compilers that we don't yet support in Raspbian.

For a number of reasons this package has been giving me a lot of problems to build. Part of the issue is that it's one of the last packages that requires us to use an armv7 version of the compiler so that it can built itself into an armv6 version. Haven't had to do that in a while.

Anyway, I've made multiple attempts with gnat-4.6 and they have all failed for one reason for another. Looking into the last attempt I noticed I forgot to remove one of the arm thumb code options which isn't supported in armv6. I'll fix that up and try again.

I hope to have a working gnat-4.6 package by this evening.

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Gnat-4.6 for Raspbian

Sat Jul 14, 2012 5:35 am

OK, I got gnat-4.6 built for Raspbian and the packages should be hitting the public repository in a few hours. Also, this freed up a about a half-dozen other packages dependent upon gnat and those should be built within the next day.

I notice that gnat-4.4 sources are in the repository as well. I guess I'll need to look into getting that built as well.

plugwash
Forum Moderator
Forum Moderator
Posts: 3475
Joined: Wed Dec 28, 2011 11:45 pm

Re: Gnat-4.6 for Raspbian

Sat Jul 14, 2012 12:15 pm

I don't think there is any point in building gnat-4.4, my understanding of debian ada policy is that only one ada compiler is "supported" at a time and the others are just for experimental purposes. In particular unlike gcc and g++ gnat doesn't have a stable ABI between versions so we can't use switching versions as a workaround for build problems.

DonOregano
Posts: 13
Joined: Wed Jul 11, 2012 3:30 pm

Re: Gnat-4.6 for Raspbian

Tue Jul 17, 2012 10:22 am

Appears to work like a dream!

Have yet to run any tests on the produced binaries, but at least compilation seems to be going fine!

Thanks for your hard work!

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Gnat-4.6 for Raspbian

Tue Jul 17, 2012 5:31 pm

Terrific. Let us know if you run into any problems. Keep in mind that the configuration switches to the Gnu compilers to produce optimized armv6+vfp code for the Raspberry Pi is relatively less tested than other more popular arm configurations (ie. armv5 for armel or armv7 for armhf). Fortunately, problems seem relatively rare. Of the 18,000+ binary packages built using Gnu compilers, we encountered relatively few problems with the code produced by the compiler. Fixes usually involved adjusting optimization levels and such.

adauser
Posts: 3
Joined: Sat Sep 15, 2012 10:12 am

Re: Gnat-4.6 for Raspbian

Sat Sep 15, 2012 10:57 am

Thanks for making my favorite language available on the Raspberry Pi.
I have successfully compiled and installed XMLAda from the AdaCore libre site.
I haven't made use of the library yet but the compiler seemed happy :)

The next step is to compile and install AWS - also from the AdaCore libre site.
So far this has not gone so well. The compiler crashed out asking me to make
a bug report.

So, being unfamilar with the bug reporting process my question is who should get
the report. The compiler says to file lots of information with the GNAT developers,
but is the problem likely to be from the stock compiler or the port?

I would like some advice on how to proceed.

For your interest, here are more details:

XMLAda : version aws-gpl-2.11.0
AWS : version xmlada-4.3w

And what the compiler said:

+===========================GNAT BUG DETECTED==============================+
| 4.6.3 (arm-unknown-linux-gnueabihf) GCC error: |
| in update_ssa_across_abnormal_edges, at tree-inline.c:1853 |
| Error detected around /home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-filter.adb:832:15|
| Please submit a bug report; see http://gcc.gnu.org/bugs.html. |
| Use a subject line meaningful to you and us to track the bug. |
| Include the entire contents of this bug box in the report. |
| Include the exact gcc-4.6 or gnatmake command that you entered. |
| Also include sources listed below in gnatchop format |
| (concatenated together with no headers between files). |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser.adb
/home/pi/Ada/aws-gpl-2.11.0-src/.build/native/release/static/obj/src/GNAT-TEMP-000001.TMP
/home/pi/Ada/aws-gpl-2.11.0-src/.build/native/release/static/obj/src/GNAT-TEMP-000002.TMP
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser.ads
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser_tasking.ads
/home/pi/Ada/aws-gpl-2.11.0-src/config/src/templates_parser-configuration__aws.ads
/home/pi/Ada/aws-gpl-2.11.0-src/src/core/aws.ads
/home/pi/Ada/aws-gpl-2.11.0-src/src/core/aws-resources.ads
/home/pi/Ada/aws-gpl-2.11.0-src/src/core/aws-utils.ads
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-utils.ads
/home/pi/Ada/aws-gpl-2.11.0-src/include/zlib.ads
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-input.ads
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-cached_files.adb
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-macro.adb
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-simplifier.adb
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-data.adb
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-definitions.adb
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-expr.adb
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-filter.adb
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-print_tree.adb
/home/pi/Ada/aws-gpl-2.11.0-src/templates_parser/src/templates_parser-utils.adb
/home/pi/Ada/aws-gpl-2.11.0-src/config/src/templates_parser-input__aws.adb


raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:423

compilation of templates_parser.adb failed


Best regards

Tom

Heater
Posts: 13859
Joined: Tue Jul 17, 2012 3:02 pm

Re: Gnat-4.6 for Raspbian

Sat Sep 15, 2012 11:27 am

I think the approach to figuring out f you have an ADA compiler bug or a port to Raspian bug is to get yourself a regular Debian setup on the Pi and try to build the same things with the same versions there.

If it all goes well then you know it is an issue with the Raspian port.

Of course if it fails it could be an ARM Debian problem so I'd want to do the same on my x89 PC as well.
Memory in C++ is a leaky abstraction .

plugwash
Forum Moderator
Forum Moderator
Posts: 3475
Joined: Wed Dec 28, 2011 11:45 pm

Re: Gnat-4.6 for Raspbian

Sat Sep 15, 2012 10:28 pm

I'd speak to upstream and see if they can suggest anything. Make it clear that you are using a compiler from raspbian (which in turn is based on the one from debian) though.

Testing on other systems such as debian armel and debian armhf would also be a good idea if possible.

adauser
Posts: 3
Joined: Sat Sep 15, 2012 10:12 am

Re: Gnat-4.6 for Raspbian

Sun Sep 16, 2012 3:42 pm

Thanks for the advice. The only ARM hardware I have at the moment is the RPi and my N900 phone.
I did get as far as compiling XMLada on my phone, but when the RPi came along I thought it would be the better platform - more up-do-date kernel etc.

There was something that prevented me compiling AWS on the N900 too. Can't remember what, so might go back and try again having got some more experience on the RPi.

I think the Debian chroot on my phone is armel. Are there armel and armhf images for RPi?

Best regards

Tom

Heater
Posts: 13859
Joined: Tue Jul 17, 2012 3:02 pm

Re: Gnat-4.6 for Raspbian

Sun Sep 16, 2012 3:54 pm

Well, we are here on the Raspian section of the Raspberry Pi forums. There is a neighbouring thread for regular Debian.
Raspian is specially rebuilt version of Debian using the harware foating point support of the Raspberry Pi.

I belive the Debian is "armel" and the Raspian is "armhf".

So my suggestion was to get yourself a regular Debian image for the raspi and try building installing things. If they fail in the same way as they do on the Raspian image then at least we have learned that it is not a Raspian specific problem.
Memory in C++ is a leaky abstraction .

plugwash
Forum Moderator
Forum Moderator
Posts: 3475
Joined: Wed Dec 28, 2011 11:45 pm

Re: Gnat-4.6 for Raspbian

Sun Sep 16, 2012 11:43 pm

It should be easy enough to create a debian armel chroot on a raspbian system. Something like:

debootstrap --arch=armel --no-check-gpg wheezy /chroots/wheezy-armel http://ftp.uk.debian.org/debian

Debian armhf will not run on the Pi. That is why raspbian exists in the first place. It should however be possible to bootstrap a debian armhf chroot on your phone.

adauser
Posts: 3
Joined: Sat Sep 15, 2012 10:12 am

Re: Gnat-4.6 for Raspbian

Tue Sep 18, 2012 1:50 am

Thanks Pugwash,

Compiling AWS in the debian armel chroot resulted in the same error. So looks like a genuine compiler error rather than a porting (to Rasbian) error.

I will try to find the time to get the information to the compiler team.

Cheers

Tom

Return to “Raspbian”