• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Cross-compiling latest TFS for Raspberry Pi

LaloHao

Member
Joined
Sep 14, 2008
Messages
73
Reaction score
14
Location
Mexico
This is in fact a guide for Distributed Cross-Compiling on ARMv6.
For the sake of easiness, i will use Arch Linux which greatly simplifies the steps needed.

Requirements:
  • RPi Model B+ with Arch Linux
  • Slave(s) PC(s) (another computer with Arch Linux x64)
The slave(s) will be the one compiling and doing all the hard work for the RPi, so the more slaves you have the faster it will compile.
If you want to do this for Raspberry Pi 2 you need to download the cross-compiling tools for ARMv7.

Let's get to it
First you need to install distcc on both devices(or moar) with:
PHP:
pacman -S distcc
Also install the libraries needed:
PHP:
pacman -S git cmake lua gmp boost boost-libs libmariadbclient

On the Raspberry Pi
Edit following lines on file /etc/makepkg.conf
PHP:
BUILDENV=(fakeroot distcc color !ccache)
DISTCC_HOSTS="your.slave.pc.ip"
MAKEFLAGS="-j3"
BUILDENV un-negate (remove !) distcc to enable distributed compiling
DISTCC_HOSTS add your slave(s) ip(s)
MAKEFLAGS this should enumerate your total cores (computers) plus 1. Example: Raspberry Pi + 1 Laptop slave = 2 plus 1 = 3; it means it should say -j3
If you have 2 slaves then it should say -j4; 4 slaves = -j6 and so on

Now on each your slaves
Edit /etc/conf.d/distccd
PHP:
PATH=/home/hao/x-tools6h/arm-unknown-linux-gnueabihf/bin:$PATH
DISTCC_ARGS="--allow 192.168.0.0/24"
PATH is the directory where we will be downloading the cross-compiling tools, dont remove :$PATH at the end
Change 192.168.0.0 for your own local network address

Download the RPi B+ cross-compiling pre-compiled binaries
http://archlinuxarm.org/builder/xtools/x-tools6h.tar.xz

I extracted them on /home/hao/x-tools6h/, remember to change PATH for your own
Start the daemon on the slaves
PHP:
systemctl enable distccd
systemctl start distccd

You're ready to start compiling
On your Raspberry Pi download the package i created for TFS with:
PHP:
wget https://aur.archlinux.org/cgit/aur.git/snapshot/forgottenserver-git.tar.gz
Extract and navigate to it:
PHP:
tar xvzf forgottenserver-git.tar.gz
cd forgottenserver-git
And start compiling with
PHP:
makepkg -Acs

Once makepkg finishes, you should have TFS compiled on /tmp/forgottenserver, move the folder to wherever you want

Congratulations, you just cross-compiled for your RPi

You can check on your slave that it is actually helping your Raspberry Pi
Capturadepantalla_2015-10-30_19-38-17.png


You can read this in spanish:
Part 1.
Part 2.
 
Last edited:
Back
Top