linux.gentoo.user

Re: [gentoo-user] How to cross compile Perl for ARM?


Hi Leho!
Thanks for many links, Jude Pereira's work totally missed my search results.
In fact I focused on playing with Qemu. First approach was to emulate whole
board (using qemu-system-arm) which works so far best of all, but is
painfully slow (but not more than other options). As for chrooted
environment, I used armv5tel stage3 tarballs available at my university
site:
http://ftp.fi.muni.cz/pub/linux/gentoo/releases/arm/autobuilds/current-stage3-armv5tel/-
it is one of official gentoo mirrors and stage3 tarball contains
everything necessary already compiled, including fully operational perl
5.12.3. I had no problems emerging any other packages, but as I said,
compilation takes ages.
Then I tried to move contents of my emulated folder to my ARM target machine
and on the machine try to chroot inside it. No problem with
compiling/emerging in chrooted environment directly on target machine, but
speed is maybe even lower.
The last approach I tried was using binfmt support to be able to run arm
binaries on my x64 box without the necessity to emulate whole board - I
hoped to have much better performance than when using qemu-system-arm.
Unfortunately it seems that qemu-arm does not support some system calls or
whatever. I untared stage3 on my x64 machine, chrooted into the folder and
tried running emerge - simple arm binaries were running fine, but emerge
ended with errors like "qemu: Unsupported syscall: 242"...
And last of all, I started documenting my approach on google sites:
https://sites.google.com/site/czernitko/cross-compilation/cross-compiling-perl-for-arm-architecture
Peter
2011/10/16 Leho Kraav <leho_at_kraav.com>
> i have managed to cross-compile a pretty complete stage3 for arm i believe
> with perl-5.10.1 from
> http://git.overlays.gentoo.org/gitweb/?p=proj/embedded-cross.git;a=tree;f=dev-lang/perl
>
> overall the cross-compile experience was a nightmare, esp. re perl and
> python. many packages obscurely fail, but not enough for you to immediately
> give up. so it keeps sucking you back in and waste even more time. at the
> time i discovered that embedded-cross overlay had mostly done all the
> difficult work for me, but it seems it is no longer updated for recent
> stuff. i think guys in #gentoo-embedded told me it is a lot of effort to
> patch these large packages like perl and python to sanely cross-compile, and
> since i think their product thing didn't work out too well, they weren't
> going to sink any more time into maintaining for newer versions.
>
> but jude pereira i believe is doing something with arm stages at least
> semi-actively
> http://judepereira.com/blog/gentoo-linux-uclibc-stage3-2010-for-embedded/and it is definitely a lot of fun booting pretty much full blown gentoo on
> things like Nokia N8x0 internet tablets
> https://github.com/slonopotamus/n8x0-overlay
>
>

Hi Leho!
Thanks for many links, Jude Pereira's work totally missed my search results.
In fact I focused on playing with Qemu. First approach was to emulate whole board (using qemu-system-arm) which works so far best of all, but is painfully slow (but not more than other options). As for chrooted environment, I used armv5tel stage3 tarballs available at my university site: http://ftp.fi.muni.cz/pub/linux/gentoo/releases/arm/autobuilds/current-stage3-armv5tel/ - it is one of official gentoo mirrors and stage3 tarball contains everything necessary already compiled, including fully operational perl 5.12.3. I had no problems emerging any other packages, but as I said, compilation takes ages.

Then I tried to move contents of my emulated folder to my ARM target machine and on the machine try to chroot inside it. No problem with compiling/emerging in chrooted environment directly on target machine, but speed is maybe even lower.

The last approach I tried was using binfmt support to be able to run arm binaries on my x64 box without the necessity to emulate whole board - I hoped to have much better performance than when using qemu-system-arm. Unfortunately it seems that qemu-arm does not support some system calls or whatever. I untared stage3 on my x64 machine, chrooted into the folder and tried running emerge - simple arm binaries were running fine, but emerge ended with errors like "qemu: Unsupported syscall: 242"...

And last of all, I started documenting my approach on google sites: https://sites.google.com/site/czernitko/cross-compilation/cross-compiling-perl-for-arm-architecture

Peter

2011/10/16 Leho Kraav <leho_at_kraav.com>
i have managed to cross-compile a pretty complete stage3 for arm i believe with perl-5.10.1 from http://git.overlays.gentoo.org/gitweb/?p=proj/embedded-cross.git;a=tree;f=dev-lang/perl

overall the cross-compile experience was a nightmare, esp. re perl and python. many packages obscurely fail, but not enough for you to immediately give up. so it keeps sucking you back in and waste even more time. at the time i discovered that embedded-cross overlay had mostly done all the difficult work for me, but it seems it is no longer updated for recent stuff. i think guys in #gentoo-embedded told me it is a lot of effort to patch these large packages like perl and python to sanely cross-compile, and since i think their product thing didn't work out too well, they weren't going to sink any more time into maintaining for newer versions.

but jude pereira i believe is doing something with arm stages at least semi-actively http://judepereira.com/blog/gentoo-linux-uclibc-stage3-2010-for-embedded/ and it is definitely a lot of fun booting pretty much full blown gentoo on things like Nokia N8x0 internet tablets https://github.com/slonopotamus/n8x0-overlay






Written by czernitko 16/10/2011 18.40.02
Check some pics on this site!
25/05/2012 4.23.41