Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Emerge a package for RPi on my desktop and put it to RPi
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
iq180
n00b
n00b


Joined: 23 Mar 2015
Posts: 7

PostPosted: Tue Jan 05, 2021 7:01 pm    Post subject: Emerge a package for RPi on my desktop and put it to RPi Reply with quote

Hi. Merry christmas, happy new year etc.

Using crossdev on my desktop, I successfully created a kernel and firmware for my RPi4b. RPi boots, everything is OK. I used this manual : https://wiki.gentoo.org/wiki/Raspberry_Pi_3_64_bit_Install.

I do not want to build any package on my RPi. I'd like to build everything on my desktop computer. And I can't understand how can I do it.

Is it possible to emerge some additional package using crossdev on my desktop and put it to the RPi file system to get this package working on RPi?

If the answer is "You need distcc" - then how can I build distcc on desktop and put it to RPi?

Is it possible at all?
Back to top
View user's profile Send private message
Jarodiv
n00b
n00b


Joined: 17 Jan 2020
Posts: 38

PostPosted: Wed Jan 06, 2021 5:58 pm    Post subject: Reply with quote

Short: It highly depends on which packages you want to use since not all compilers work with distcc+crossdev+aarch64. For example haven't found a way yet to get CLAN and Rust working.

The general approach for you would/could be to build your system entire system, including distcc, in a chroot environment on your workhorse host. Once done, copy it on the medium you are using for your Pi (Micro-SD Card or USB Stick). A guide for that can be found in the wiki:
-> https://wiki.gentoo.org/wiki/Cross_build_environment
Back to top
View user's profile Send private message
iq180
n00b
n00b


Joined: 23 Mar 2015
Posts: 7

PostPosted: Thu Jan 07, 2021 2:01 pm    Post subject: Reply with quote

Jarodiv wrote:
Short: It highly depends on which packages you want to use since not all compilers work with distcc+crossdev+aarch64. For example haven't found a way yet to get CLAN and Rust working.

The general approach for you would/could be to build your system entire system, including distcc, in a chroot environment on your workhorse host. Once done, copy it on the medium you are using for your Pi (Micro-SD Card or USB Stick). A guide for that can be found in the wiki:
-> https://wiki.gentoo.org/wiki/Cross_build_environment


Thank you.

I found Sakaki's Wiki, it helped: https://github.com/sakaki-/gentoo-on-rpi-64bit/wiki.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Jan 08, 2021 10:48 am    Post subject: Reply with quote

iq180,

There are several ways to do this. They all have their advantages and disadvantages. In order of complexity of set up.

The easiest to set up is cross distcc. Install the arm64 cross compiler on your desktop.
Install the *identical* gcc on the Pi and configure distcc in the normal way.
It only works for C and C++ and the Pi still does the configure and link steps.

Since you have the arm64 cross compiler installed, you have a whole 'empty' /usr/aarch64-unknown-linux-gnu/ target root filesystem.
Copy the Pis /etc/portage there, with the exception of make.conf so you have /usr/aarch64-unknown-linux-gnu/etc/portage but with the cross make.conf.
Merge the two make.confs so the cross compile elements are retained.
Now you can cross emerge for the Pi and build binaries to install on the Pi.
This is less than perfect. Many build systems don't work with cross compiling and a few are completely hostile in that they will build arm64 code then try to run it on the build host.

Having got the above cross emerge working, you can do a little more and chroot into it. Yes, run arm64 code on your desktop,
Build qeum with static-user and install it in your target root.
Switch the target root make.conf to be pure Pi. Now chroot into /usr/aarch64-unknown-linux-gnu.
qemu is now emulating an arm64 CPU in software. Its slow due to the emulation but you have all your desktop RAM.
A few things don't work here too, so there is no silver bullet.

Its all documented on the wiki
_________________
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
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