GnatDroid on FreeBSD has been updated build from GCC 4.6.3 on both ARMv5 and ARMv7. Now that the FreeBSD GNAT-AUX port is modular, the GnatDroid ports should automatically upgrade with GNAT-AUX is upgraded. gnatdroid-armv5 20120301 GnatDroid now supports Fortran and Objective-C as another benefit of the port modularity. These additional languages are not built by default, but they are easily activated when building GnatDroid from source. An option configuration screen will appear after "make" command allowing GnatDroid to support one or both of these extra languages. The screen can be forced to appear later with the "make config" command. C++ is not yet supported as it is in GNAT-AUX. There is a build error on this language that needs to be examined in depth before C++ support can be added. GCC 4.6.3 was released on 1 March 2012. Due to recent work on the gnat-aux package, it was relatively easy to update the pkgsrc version of gnat-aux to version 20120301 which syncs with GCC Release 4.6.3. It has already been tested and committed to the pkgsrc CVS trunk. The same can't be said for the FreeBSD version. The port updated okay, and would work fine on FreeBSD 8.x and below, but it's failing FreeBSD 9.0 ACATS testsuite. It turns out that version 4.6.2 was failing as well. Specifically 23 tasking tests are failing with "Fatal error 'thread exits with resources held!'". This is caused by an update to the thread library that detects this sort of thing and FreeBSD 9.0 is the first version to use the updated library. I will try to modify GNAT to free the thread's resources so that tasking for FreeBSD will work. Also, the gnatdroid port will use part of the gnat-aux makefiles and patches so that it will automatically update when gnat-aux updates. It is still at gcc version 4.6.1, but an update for that port will follow shortly after gnat-aux is fixed. This has been a long time coming, but the upgrade of GNAT-Aux to version 4.6.2 was not straight-forward. First, two more languages were added: Fortran and Objective-C. As a result of added these two languages and running their testsuites, platform misconfigurations were uncovered, and fixing them is a long iterative process. The second major change is that custom tarballs are no longer used. Instead, the basis for the compiler are official GCC releases and then GNAT-AUX changes are applied as patches on top of that. This has two benefits: It will be easier to move to GCC 4.7.0 when it is released and it will be easier to isolate patches to send back to FSF to permanently incorporate into the code base. Both additional languages and patch isolation have been requested, so this important upgrade satisfies those requests.
Test resultsTest results over 5 languages on 9 platforms are available on this report. From an Ada view, all pkgsrc and ports platforms still pass 100%. Unfortunately, OpenSolaris died when Oracle took over Sun Microsystems. However, out of the ashes rose the Illumos project, which took over powering platforms like Nexenta and spawned new distributions such as OpenIndiana. The Illumos-powered platforms gained Pkgsrc through the Illumos Pkgsrc Project, which boasted an impressive 6600 built packages soon after getting launched. GNAT-AUX was already available on Pkgsrc, but it only works on platforms in which a bootstrap compiler is provided. Before this week, this covered exactly four platforms:
I had previously built a flawless GNAT-AUX on an obsolete OpenSolaris version SXCE 130. It was fairly trivial to built a static bootstrap compiler on the latest version of OpenIndiana (oi_151a). The lang/gnat-aux package has been updated to support the x86 Solaris target, and also updates all supported platforms to provide working runtime symbolic traceback. It just missed the 2011Q3 branch, so it's only available in the pkgsrc trunk. After the GNATDroid compiler passed the ACATS testsuite flawlessly, it was submitted officially to the FreeBSD ports tree. It can sometimes take months for new ports to make it through the submission process, but the GNATDroid ports got approved and committed within a week. We are very grateful to FreeBSD committer Frederic Culot for the special attention he affords these Ada ports, and we can't express our appreciation enough. So now FreeBSD users can obtain the ports through the normal method (e.g. portsnap fetch update) and install the cross-compiler like any other FreeBSD software (e.g. cd /usr/ports/lang/gnatdroid-armv7 && make install). Now its up to you guys to utilize the strength of Ada on the Android platform. I finally acquired an Android device, a nice ASUS Transformer TF101 equipped with an NVIDIA Tegra2 dual-core CPU. After building GNATDroid-ARMv7, I confirmed that I could compile Ada programs on FreeBSD and execute them on the Android tablet. After some trial and error, I modified the ACATS test suite to execute the tests remotely on the transformer. After the first run, 57 tests failed with the same error. It turns out that the default location for temporary files (/tmp) doesn't exist on Android. I patched GNATDroid to first attempt to create temporary files at $ANDROID_DATA/local/tmp (/data/local/tmp) which normally requires a rooted device, and then try $EXTERNAL_STORAGE/ (/sdcard) which would require that the user permissions can write to that area. With that update, the temporary files could be created and the GNATDroid passed the ACATS testsuite without a single failure. Modifying Dejagnu test harness is a little trickier, so the gnat.dg testsuite still hasn't been run. In any case, the confidence in this cross-compiler is now quite high and these ports can be officially submitted to FreeBSD. The tarball and signature file referenced in the previous post have been updated to include the patch for adaint.c which controls the temporary file creation. If you have already built GNATDroid, you may wish to deinstall it, re-extract the files, and then rebuild it. -- John FreeBSD users now have an easy method to obtain their own Ada capable Android cross-compiler. We have created four FreeBSD ports that can build two different GNAT-AUX (gcc 4.6.1) compilers that target Android ARMv5 and Android ARMv7. The ARMv5 version creates binaries that can be run on the Android SKD emulator. The ARMv7 version is intended to produce binaries that can be run on ARM Cortex-A8+ CPUs, but until we get that Android tablet, we can't confirm it's functional. The emulator can NOT run ARMv7 binaries, so don't attempt it. The ports will not be submitted to FreeBSD until we can run the full testsuite on them, but in the meantime we're making them available to anyone that wants to use them now (no promises of course!) The four packages are:
The first two are dependencies of the last two which get automatically built, so the process to install a cross-compiler is simple (logged in as root):
If you prefer PGP-signed downloads, the signature file is available, and can be verified against John Marino's public key Feedback or comments about these cross-compilers are always welcome. We still don't own a real Android device, so continued work on the Android compiler has been difficult. This may change in the near future as we have our eyes on an Asus Transformer (ARM v7), but until then we are still limited to using the ARM v5 Android SDK emulator. A new cross-compiler was built, this time using FreeBSD64 as the host machine. The goal is to convert the cross compiler into a set of ports so that FreeBSD users can obtain the cross compiler like they get other software. This will be the next project, and once the Android tablet is obtained, the full testsuite will be run on the cross-compiler. In the meantime, I found a text version of Tetris written in Ada on the AdaPower site. It turns out this game takes advantage of tasking, and that's how we found out the the Android compiler had broken tasking. Luckily, it only took a couple of hours to figure out how to fix it. As proof, a screenshot of FreeBSD64-built Ada Tetris running inside an Android SKD emulator hosted on Ubuntu 10.04 LTS Linux is presented, and it works! The fact that tasking runs is a very good indicator that the compiler should do very well when the testsuite is run. Hopefully we can get these ports built were interested parties can untar them in FreeBSD's /usr/ports directory and get working Android cross-compilers so they can play with it as well. If all goes well, we'll get the ports officially added to the FreeBSD ports tree.
GCC 4.6.1 was released on June 27th. While not much was done directly to GNAT, 157 bugs were addressed. GNAT AUX was updated accordingly and it's already available to FreeBSD users. Patches have already been submitted to pkgsrc so that DragonFly and NetBSD fans will also receive the latest version of GNAT-AUX soon. It's been a while since the last update! GNAT AUX has been upgraded to the 25 March 2011 release of gcc 4.6.0. In addition, the C++ language has been added to the port/package, and it builds by default. The FreeBSD port of GNAT AUX was published today. The pkgsrc version that serves NetBSD and DragonFlyBSD will probably be published within a week. There were a lot of fixes added to the NetBSD version as well. The next version published will probably coincide with the future release of gcc 4.6.1. |
|