Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
aarch64 rust-1.25.0 for RPi3, via QEMU PC chroot (tutorial)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Sat Apr 28, 2018 5:55 pm    Post subject: aarch64 rust-1.25.0 for RPi3, via QEMU PC chroot (tutorial) Reply with quote

Hello,

To get aarch64 rust-1.25.0 to build for my gentoo-on-rpi3-64bit project's binhost recently, I had to resort to emerging in a user-mode QEMU binfmt_misc chroot on my PC (it now isn't really feasible to build this natively on an RPi3, as it needs over 3GiB of swap (and isn't distcc-friendly), so the emerge time was literally stretching out to multiple days). Been a while since I tried this for aarch64 (gave up last time due to too many unimplemented syscalls), but I was pleasantly surprised to see that it now works pretty well.

As such, and since the technique (which lets you easily leverage the memory, CPU and peripherals bandwidth of your PC) may be of interest to others, I have written up a short wiki tutorial, here.

Any feedback on errors etc. in the above appreciated!

Acknowledgement: I used the following articles as reference, thank you all:

PS Unfortunately, some things, such as javac, don't seem to run in QEMU user mode right now (see e.g. this bug report), so no icedtea this way. But most things will build.
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Sat Apr 28, 2018 6:18 pm    Post subject: Reply with quote

Sakaki,

Looks good. Building on the SDCard will be painfully slow.
You could borrow the hosts build space ... or am I missing something?

Bootstrapping icedtea is painful now. However, icedtea-bin-3.7.0.ebuild has
Code:
KEYWORDS="-* amd64 ~arm ~arm64 ppc64 x86"


So icedtea-bin works on arm64.

Purists need to install gcc-5.x with USE=gcj
Then use that to bootstrap icedtea:7, which is no longer in the tree.
icedtea:7 can then be used to build icedtea:8.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Sun Apr 29, 2018 7:05 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Looks good. Building on the SDCard will be painfully slow.
You could borrow the hosts build space ... or am I missing something?

Good point - I use an SSD via a USB adaptor on the RPi3 for sysroot, lets me then mount it on either USB3 or sata on the desktop machine. But most people trying this will have a microSD card-based image I guess, so it makes sense just to bind mount /var/tmp/portage into the chroot - that's what you mean by the above?
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Sun Apr 29, 2018 7:27 pm    Post subject: Reply with quote

Sakaki,

Pretty much.
As long as QEMU and the host don't build the same thing at the same time it will be safe.
I tend to build binaries in QEMU then either move the tarballs to the Pi or setup a BINHOST.

I have a SSD on a USB adaptor too. My USB adaptor stops me using discard and fstrim, so every now and again, I fit the SSD to my desktop and do a fstrim.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Mon Apr 30, 2018 9:19 am    Post subject: Reply with quote

NeddySeagoon,

I've updated the wiki page per your suggestion.

Thanks again.
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum