From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-129851-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RFTdZ-00081B-VF
	for garchives@archives.gentoo.org; Sun, 16 Oct 2011 16:32:34 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 97CAF21C162;
	Sun, 16 Oct 2011 16:32:18 +0000 (UTC)
Received: from mail-vw0-f53.google.com (mail-vw0-f53.google.com [209.85.212.53])
	by pigeon.gentoo.org (Postfix) with ESMTP id 45D5221C067
	for <gentoo-user@lists.gentoo.org>; Sun, 16 Oct 2011 16:31:16 +0000 (UTC)
Received: by vws19 with SMTP id 19so3598787vws.40
        for <gentoo-user@lists.gentoo.org>; Sun, 16 Oct 2011 09:31:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=mIGZaPO/pmeGn9pVGshhbpKsc8p83oBdwCZePguucLM=;
        b=EgNaf/bdxb9hhvclzZRTSK6t9cjhxHjV6drgDq4IaziATjX23Pyv0Tr6huexbPjQwX
         euaw7PmXTRGnOCMGTU0bcetuBSaygSJJQ4dQXdh/2pVtF8PxvyBq1BXT47mX4yVfglGy
         a/UjUl05Dtgxbgq1kH3N15vP7jlDT/iYOPO08=
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Received: by 10.52.185.225 with SMTP id ff1mr15673510vdc.125.1318782675397;
 Sun, 16 Oct 2011 09:31:15 -0700 (PDT)
Received: by 10.52.188.37 with HTTP; Sun, 16 Oct 2011 09:31:15 -0700 (PDT)
In-Reply-To: <32760918.1731.1318765805596.JavaMail.geo-discussion-forums@vbzc27>
References: <hLNXX-4A6-13@gated-at.bofh.it>
	<hLQCt-Gi-9@gated-at.bofh.it>
	<32760918.1731.1318765805596.JavaMail.geo-discussion-forums@vbzc27>
Date: Sun, 16 Oct 2011 18:31:15 +0200
Message-ID: <CAPFNKCLXC1FFNbSKFq-taMrt06HwyA4brkoNZQt_EqJo_zBUng@mail.gmail.com>
Subject: Re: [gentoo-user] How to cross compile Perl for ARM?
From: czernitko <czernitko@gmail.com>
To: gentoo-user@lists.gentoo.org
Content-Type: multipart/alternative; boundary=bcaec548a3a7e72b4504af6d040d
X-Archives-Salt: 
X-Archives-Hash: a5aa9078917cfac55a2b907a9ffd9a3b

--bcaec548a3a7e72b4504af6d040d
Content-Type: text/plain; charset=ISO-8859-1

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@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
>
>

--bcaec548a3a7e72b4504af6d040d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Leho!<br>Thanks for many links, Jude Pereira&#39;s work totally missed m=
y search results. <br>In fact I focused on playing with Qemu. First approac=
h was to emulate whole board (using qemu-system-arm) which works so far bes=
t of all, but is painfully slow (but not more than other options). As for c=
hrooted environment, I used armv5tel stage3 tarballs available at my univer=
sity site: <a href=3D"http://ftp.fi.muni.cz/pub/linux/gentoo/releases/arm/a=
utobuilds/current-stage3-armv5tel/">http://ftp.fi.muni.cz/pub/linux/gentoo/=
releases/arm/autobuilds/current-stage3-armv5tel/</a> - it is one of officia=
l gentoo mirrors and stage3 tarball contains everything necessary already c=
ompiled, including fully operational perl 5.12.3. I had no problems emergin=
g any other packages, but as I said, compilation takes ages.<br>
<br>Then I tried to move contents of my emulated folder to my ARM target ma=
chine 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.<br>
<br>The last approach I tried was using binfmt support to be able to run ar=
m binaries on my x64 box without the necessity to emulate whole board - I h=
oped to have much better performance than when using qemu-system-arm. Unfor=
tunately it seems that qemu-arm does not support some system calls or whate=
ver. I untared stage3 on my x64 machine, chrooted into the folder and tried=
 running emerge - simple arm binaries were running fine, but emerge ended w=
ith errors like &quot;qemu: Unsupported syscall: 242&quot;...<br>
<br>And last of all, I started documenting my approach on google sites: <a =
href=3D"https://sites.google.com/site/czernitko/cross-compilation/cross-com=
piling-perl-for-arm-architecture">https://sites.google.com/site/czernitko/c=
ross-compilation/cross-compiling-perl-for-arm-architecture</a><br>
<br>Peter<br><br><div class=3D"gmail_quote">2011/10/16 Leho Kraav <span dir=
=3D"ltr">&lt;<a href=3D"mailto:leho@kraav.com">leho@kraav.com</a>&gt;</span=
><br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex;">
i have managed to cross-compile a pretty complete stage3 for arm i believe =
with perl-5.10.1 from <a href=3D"http://git.overlays.gentoo.org/gitweb/?p=
=3Dproj/embedded-cross.git;a=3Dtree;f=3Ddev-lang/perl" target=3D"_blank">ht=
tp://git.overlays.gentoo.org/gitweb/?p=3Dproj/embedded-cross.git;a=3Dtree;f=
=3Ddev-lang/perl</a><br>

<br>
overall the cross-compile experience was a nightmare, esp. re perl and pyth=
on. many packages obscurely fail, but not enough for you to immediately giv=
e 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 thin=
k guys in #gentoo-embedded told me it is a lot of effort to patch these lar=
ge packages like perl and python to sanely cross-compile, and since i think=
 their product thing didn&#39;t work out too well, they weren&#39;t going t=
o sink any more time into maintaining for newer versions.<br>

<br>
but jude pereira i believe is doing something with arm stages at least semi=
-actively <a href=3D"http://judepereira.com/blog/gentoo-linux-uclibc-stage3=
-2010-for-embedded/" target=3D"_blank">http://judepereira.com/blog/gentoo-l=
inux-uclibc-stage3-2010-for-embedded/</a> and it is definitely a lot of fun=
 booting pretty much full blown gentoo on things like Nokia N8x0 internet t=
ablets <a href=3D"https://github.com/slonopotamus/n8x0-overlay" target=3D"_=
blank">https://github.com/slonopotamus/n8x0-overlay</a><br>

<br>
</blockquote></div><br>

--bcaec548a3a7e72b4504af6d040d--