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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.149.198 with SMTP id x46mr342665yhj.7.1390390791769; Wed, 22 Jan 2014 03:39:51 -0800 (PST) X-Received: by 10.50.87.129 with SMTP id ay1mr44952igb.16.1390390791526; Wed, 22 Jan 2014 03:39:51 -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!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!f11no1278154qae.1!news-out.google.com!vg8ni1igb.0!nntp.google.com!c10no315835igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 22 Jan 2014 03:39:51 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2602:306:cd9f:eab0:f44f:cefd:a053:762; posting-account=hLd-5woAAADYZwVMVKtPxDsPxCMLkwY- NNTP-Posting-Host: 2602:306:cd9f:eab0:f44f:cefd:a053:762 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Ada on Android and iOS? From: coding.rascal@gmail.com Injection-Date: Wed, 22 Jan 2014 11:39:51 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 7733 X-Received-Body-CRC: 2771412686 Xref: news.eternal-september.org comp.lang.ada:18246 Date: 2014-01-22T03:39:51-08:00 List-Id: Hi, 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 try= ing to figure out how to create my own cross compiler for the ARM processor= . Below are some of the links I've been using as reference. http://gcc.gnu.org/install/ http://cross-lfs.org/view/CLFS-2.1.0/x86_64-64/index.html https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compilin= g.html http://wiki.osdev.org/Building_GCC http://wiki.osdev.org/GCC_Cross-Compiler http://www.linux.com/community/blogs/127-personal/468920-cross-compiling-fo= r-arm Since both iOS and Android have a native interface API to allow people to d= evelop software in languages other than Objective-C and Java, I am really h= oping 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 th= e latest version of GCC) 2) Copy the header files of the target platform into my own target root dir= ectory 3) Compile and install a cross version of binutils 2.24 with My_Native_GCC. 4) Use My_Native_GCC to compile a minimal version of GCC that does not depe= nd on GLIBC and outputs code for the target platform. Let's call this Min_T= arget_GCC. (NOTE: This is really for Android since they have the crappy Bio= nic libc) 5) Use Min_Target_GCC to compile and install a new version of GLIBC for the= target platform. 6) Use Min_Target_GCC to compile and install a full version of GCC that gen= erates code for the target platform and uses the new GLIBC. So far, I've only attempted to do the above for the Android platform. I was= successful in creating my own GCC 4.8.2 with Ada enabled. The only weird t= hing about my version is that I always need to use -I to include the paths = of the C++ header files for my version of GCC. Otherwise, it can't find fil= es like cstring. 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 t= he version.h file they include), I ended up grabbing the 3.0.31 Linux heade= rs from Samsung's website http://opensource.samsung.com via their Jelly Bea= n update Zip file SGH-I747_JB_Opensource_Update1.zip. My phone is the ATT S= 3 model, btw. Step 3 and 4 completed without problems. However, I am now stuck at Step 5.= The building of the new GLIBC fails on ../sysdeps/unix/sysv/linux/gethosti= d.c with the following error: ### make[2]: Entering directory `/home/rascal/workspace/cross_build/glibc-2= .18/src/misc' ### /opt/custom_tools/cross/android/api/17/arm-linux-androideabi/bin/arm-li= nux-androideabi-gcc-4.8.2 ../sysdeps/unix/sysv/linux/gethostid.c -c -std=3D= gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fmerge-all-consta= nts -frounding-math -g -Wstrict-prototypes -fexceptions -I../include= -I/home/rascal/workspace/cross_build/glibc-2.18/build/misc -I/home/rascal= /workspace/cross_build/glibc-2.18/build -I../ports/sysdeps/unix/sysv/linux= /arm/nptl -I../ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/s= ysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysd= eps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../s= ysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv= -I../sysdeps/unix/sysv -I../ports/sysdeps/unix/arm -I../nptl/sysdeps/un= ix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../po= rts/sysdeps/arm/nptl -I../ports/sysdeps/arm/include -I../ports/sysdeps/arm= -I../ports/sysdeps/arm/soft-fp -I../sysdeps/wordsize-32 -I../sysdeps/ie= ee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysde= ps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /= opt/custom_tools/cross/android/api/17/arm-linux-androideabi/lib/gcc/arm-lin= ux-androideabi/4.8.2/include -isystem /opt/custom_tools/cross/android/api/1= 7/arm-linux-androideabi/lib/gcc/arm-linux-androideabi/4.8.2/include-fixed -= isystem /opt/custom_tools/cross/android/api/17/arm-linux-androideabi/includ= e -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -o /home= /rascal/workspace/cross_build/glibc-2.18/build/misc/gethostid.o -MD -MP -MF= /home/rascal/workspace/cross_build/glibc-2.18/build/misc/gethostid.o.dt -M= T /home/rascal/workspace/cross_build/glibc-2.18/build/misc/gethostid.o ### ../sysdeps/unix/sysv/linux/gethostid.c: In function 'gethostid': ### ../sysdeps/unix/sysv/linux/gethostid.c:71:17: error: 'MAXHOSTNAMELEN' u= ndeclared (first use in this function) ### char hostname[MAXHOSTNAMELEN + 1]; ### ^ ### ../sysdeps/unix/sysv/linux/gethostid.c:71:17: note: each undeclared ide= ntifier is reported only once for each function it appears in ### ../sysdeps/unix/sysv/linux/gethostid.c:71:8: warning: unused variable '= hostname' [-Wunused-variable] ### char hostname[MAXHOSTNAMELEN + 1]; I tried compiling a native version of GLIBC to see if I get the same error,= but it compiled just fine. So it appears to be an issue when I have the bu= ild process use my designated target root path that includes the header fil= es from the Android NDK and the Galaxy S3 header files. But before I contin= ue spending a great deal of time investigating this error, I'd like to know= the following: 1) Will the 6 step process I laid out above only lead me to a dead end? I k= now about GNATdroid. The main reason why I am trying to avoid using GNATdro= id 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). 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. 3) Does GNAT work with EGLIBC and uCLIBC? 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)? BTW, my development machine is Kubuntu 13.10 running on a Core-i7 based lap= top. Thanks. Coding Rascal