help / color / mirror / Atom feed
From: jrmarino <>
Subject: Re: Ada on Android and iOS?
Date: Wed, 22 Jan 2014 08:55:53 -0800 (PST)
Date: 2014-01-22T08:55:53-08:00	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wednesday, January 22, 2014 12:39:51 PM UTC+1, wrote:
> I am interested in developing commercial Ada software for Android and iOS (both of which I have never developed for, btw). I've spent several days trying to figure out how to create my own cross compiler for the ARM processor. 
> Since both iOS and Android have a native interface API to allow people to develop software in languages other than Objective-C and Java, I am really hoping all I need to do is the following:
> 1) Compile my own native version of GCC 4.8.2 with Ada enabled. Let's call this My_Native_GCC (Note: I know I can just use 4.6, but I'd like to use the latest version of GCC)

I'm the creator of gnatdroid (Ada crosscompiler from FreeBSD/DragonFly to Android).  At least with gcc 4.6 and 4.7, GNAT doesn't build "out of the box" for the android target.  For 4.6 I had to implement the target and some functionality, and as I found out yesterday, I have to do more for gcc4.7.

> For step 2, I downloaded the latest r9c of the Android NDK and copied over the contents of ~/android-ndk-r9c/platforms/android-17/arch-arm/usr/include into my own target root directory. Since GLIBC requires headers for Linux v2.6.19 or higher, and the NDK is bundled with Linux headers v2.6.18 (per the version.h file they include), I ended up grabbing the 3.0.31 Linux headers from Samsung's website via their Jelly Bean update Zip file My phone is the ATT S3 model, btw.

If you want to verify the general process on how to create an ada cross compiler, just example the makefile of lang/gnatdroid-armv5 (or lang/gnatdroid/armv7) along with the helper ports lang/gnatdroid-sysutils and lang/gnatdroid-binutils on FreeBSD or DragonFly.  The makefile represents a step by step process.  Your outline is general correct.

> 1) Will the 6 step process I laid out above only lead me to a dead end? I know about GNATdroid. The main reason why I am trying to avoid using GNATdroid is because I am hoping I can figure out a common process that allows me to create toolchains for both Android and iOS (hopefully, with the need to simply switch between the set of header files between the two platforms).

You're at a dead-end because you think a stock gcc can build an ada compiler without patches.  You have some good news though:
1) A couple of days ago I made GNATDroid use binutils 2.24 (nonfactor as 2.21 is just fine too)
2) As we speak, and totally by coincidence, I'm running a testsuite on GNATDroid based on gcc 4.7.  The port will be updated today most likely.  It's on C9 right now, passed every test so far, but that was after I implemented additional functionality to the gcc 4.7 base on top of my previous patchset.

> 2) Does GNAT work with the Bionic library even though it doesn't implement the entire C runtime and is not POSIX compliant. I'd like to be able to use Ada tasks and protected types on Android.


> 4) GNATdroid is built for Android 2.3. Does this mean an Ada Android app is limited to the capabilities of that old Android API? If yes, then is there any chance GNATdroid will be updated to a more recent version of Android (preferably Jelly bean)?

I guess so.  It's not like anybody ever requested something newer.  I don't even know how many people use it.  I haven't even looked at GNATDroid in over a year, except for yesterday when I started to base it on gcc 4.7

I am skipping gcc 4.8 completely.
The next set of FreeBSD ports will be based on GCC 4.9.  From what I can tell, gcc 4.8 can't build any of the 2012 or 2012 Adacore packages like polyorb or GPRBuild but GCC 4.9 should be able to.  So in my opinion GCC 4.8 didn't present enough of an improvement to take on the task of patching and test it.

Saying that, if you can use FreeBSD or DragonFly, GNATDroid based on gcc 4.7 should be sufficient for you as long as the Android 2.3 API is acceptable.  I don't know of any other officially packaged cross-compilers.  This was the first and only that I'm aware of.


  parent reply	other threads:[~2014-01-22 16:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22 11:39 Ada on Android and iOS? coding.rascal
2014-01-22 15:43 ` Ludovic Brenta
2014-01-22 16:55 ` jrmarino [this message]
2014-01-22 21:35   ` coding.rascal
2014-01-22 23:07     ` jrmarino
2014-01-23 19:20 ` Dan'l Miller
2014-01-23 20:19   ` Micronian Coder
2014-01-23 23:48 ` Lucretia
2023-06-20 13:31   ` Guillermo Hazebrouck
2023-06-20 17:43     ` Luke A. Guest
2023-06-20 18:08       ` Luke A. Guest
2023-06-20 18:45         ` Luke A. Guest
2023-06-20 19:17       ` Simon Wright
2023-06-20 19:29         ` Luke A. Guest
2023-06-20 19:35         ` Luke A. Guest
2023-06-20 21:27     ` Luke A. Guest
2023-06-21  7:01       ` Guillermo Hazebrouck
2023-06-21  9:06         ` Luke A. Guest
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox