develooper Front page | perl.perl5.porters | Postings from June 2012

Cross compilation (official status ? + my work on Android)

Thread Next
Alexandre Jousset
June 22, 2012 08:59
Cross compilation (official status ? + my work on Android)
Message ID:
Hi all,

I have some remarks and questions about cross compilation of perl5.

- What is the official status of cross compilation of perl5?

I mean, looking at the Configure script and at the Cross directory, I've seen 2 ways of cross compiling.

The first one, using 'sh Configure -Dusecrosscompile ...' seems to be the old way and not supported anymore. Is it true?

The second one, with files located in the Cross directory, seems to be a little bit outdated (some patches aren't applying on source tree).

So, my question is: is cross compilation of perl5 deprecated in some manner?

- Without having any answer so far about my question above, I am proud to announce that I still managed to cross compile perl-5.16.0, along with all core modules, on Android with the latest NDK toolchain at current day (NDK-r8, toolchain android-14).

If you are interested on how to reproduce it using my patches, please look at:

It took me about 30 hours of work to achieve this. I'm sure I did some things the "wrong way", but anyway, it works ;-)

Basically, I first started the Configure script with the -Dusecrosscompile and -Dtargethost=..., etc, to generate an adequate script. This way, the tests of the Configure script were cross compiled, ssh'ed to an Android device emulator, then tested on it.

After this, I used the other method, the one of the Cross directory, with adapting the patches and making new ones.

- To run correctly the Configure script, I had to edit it and to add at the end of the line 4813:

-rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
+rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core* try.xok"

I checked in bleadperl just before sending this email, this modification still has to be done at the same place. I think that even if it's not the good way to cross compile anymore, it is, as I used it, a good way to generate a correct file when you can't have a compiling environment on the target.

- Would someone be interested that, after some people review my method to point mistakes I've done, I try to port bleadperl on Android?

Android is now a widely used platform and a lot of people are interested on using perl on it. There is the SL4A Google project, but it uses perl-5.10.x and, AFAIK, it doesn't compile all core modules. Moreover, there is another project aiming to allow distributing my port of perl along with the SL4A framework (if I understood well) in a standalone APK. This way perl programmers will be able to distribute their applications written in Perl on Android Market / Player.

Following this, would it be a good idea to include my patches in the perl distribution? I've postfixed all my files and patches with ".android" and they are all located in the Cross directory, so no file will collide with anything already existing.

For this, I think some work could be done on the perl source tree to correct some of the things I had to patch, and the rest could stay as patches in the Cross directory.

- What do you think about all this?

I mean, I am quite unknown to the perl community (except some French Perl Mongers (Hi BooK! ;-) )) and I come here saying all these things. Please be lenient, and I know you are, about my work and this message. I am eager to learn from other people ;-)

- Lastly, I just would like to inform the P5P FAQ maintainer (Rafael?) that the web link to the FAQ is broken and that the "get bleadperl" from the mail FAQ is not up to date (it refers to activestate servers using Perforce). Just FYI, I think you already know that ;-)

Thanks for reading :-)
--      \^/                                            --
--    -/ O \---------------------------------------    --
--   | |/ \|      Alexandre (Midnite) Jousset      |   --
--    -|___|---------------------------------------    --

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About