From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.112.231 with SMTP id it7mr962743obb.22.1390409753774; Wed, 22 Jan 2014 08:55:53 -0800 (PST) X-Received: by 10.140.95.144 with SMTP id i16mr55327qge.1.1390409753746; Wed, 22 Jan 2014 08:55:53 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!c10no758998igq.0!news-out.google.com!gg4ni967qab.0!nntp.google.com!k15no1565518qaq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 22 Jan 2014 08:55:53 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=130.255.19.191; posting-account=Zsf4jwoAAADEqwCydv835KU9-S3h_Y26 NNTP-Posting-Host: 130.255.19.191 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Ada on Android and iOS? From: jrmarino Injection-Date: Wed, 22 Jan 2014 16:55:53 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:18249 Date: 2014-01-22T08:55:53-08:00 List-Id: On Wednesday, January 22, 2014 12:39:51 PM UTC+1, coding...@gmail.com 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 t= rying to figure out how to create my own cross compiler for the ARM process= or.=20 > > 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: >=20 > 1) Compile my own native version of GCC 4.8.2 with Ada enabled. Let's cal= l 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 A= ndroid). 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 f= unctionality, 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 ove= r the contents of ~/android-ndk-r9c/platforms/android-17/arch-arm/usr/inclu= de into my own target root directory. Since GLIBC requires headers for Linu= x 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 hea= ders from Samsung's website http://opensource.samsung.com via their Jelly B= ean update Zip file SGH-I747_JB_Opensource_Update1.zip. My phone is the ATT= S3 model, btw. If you want to verify the general process on how to create an ada cross com= piler, just example the makefile of lang/gnatdroid-armv5 (or lang/gnatdroid= /armv7) along with the helper ports lang/gnatdroid-sysutils and lang/gnatdr= oid-binutils on FreeBSD or DragonFly. The makefile represents a step by st= ep 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 GNATd= roid is because I am hoping I can figure out a common process that allows m= e to create toolchains for both Android and iOS (hopefully, with the need t= o 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 compile= r 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 GNAT= Droid 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 patchse= t. > 2) Does GNAT work with the Bionic library even though it doesn't implemen= t the entire C runtime and is not POSIX compliant. I'd like to be able to u= se Ada tasks and protected types on Android. yes. > 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 the= re 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 o= ver 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 te= ll, gcc 4.8 can't build any of the 2012 or 2012 Adacore packages like polyo= rb or GPRBuild but GCC 4.9 should be able to. So in my opinion GCC 4.8 did= n't present enough of an improvement to take on the task of patching and te= st 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. John