I want to build programs with distcc
on a Raspberry Pi for my desktop (x86-64).
My idea:
- Build
crossdev-ng
on my desktop. - Build cross-compiler on my desktop to run on desktop and generate code for Pi.
- Build cross-compiler on my desktop to run on Pi and generate code for desktop with
gcc
from step 2.
How to do the last action? Is it a right way?
-
Is there a reason you want to do this? Your desktop is obviously capable of compiling its own code.David Yaw– David Yaw2016年03月08日 16:46:02 +00:00Commented Mar 8, 2016 at 16:46
-
@DavidYaw, I want to use distcc with three hosts: desktop, notebook and Pi.val - disappointed in SE– val - disappointed in SE2016年03月08日 16:54:41 +00:00Commented Mar 8, 2016 at 16:54
-
If you're setting up a cross-compilation environment to compile ARM on your x86, then just follow those same instructions to set up a cross-compilation environment to compile x86 on your Pi.David Yaw– David Yaw2016年03月08日 17:26:34 +00:00Commented Mar 8, 2016 at 17:26
1 Answer 1
Use cnadian build type. Now, you have got directory with name like aarch64-unknown-linux-gnueabi
(I call it cross-prefix). In configuration menu select Toolchain options
, then Type
, select Canadian
. After this action, you can see Host system
section! Enter cross-prefix (aarch64-unknown-linux-gnueabi
in my case) into Tuple
option (Host system
section, NOT build system
). Apply other changes (change target architecture to x86, etc.) and exit with saveing changes. Now, you need to add path to crosscompiler binares in your PATH. Run
export PATH="${PATH}:cross-prefix/bin"
Ok, tolchain is ready to build!