xenogenesi::blog
memento
3d adt android apache2 app apt aria2 build bullet cflags chromium codeigniter debian demoscene dependencies dpkg driver emulator freeglut gcc gfx git glut htaccess javascript json kernel linux make metalink minimal mysql opengl php python raspbian realtime rpi specs template toolchain update-alternatives video wifi wordpress

build a gcc i686 toolchain with crosstool-ng

git clone https://github.com/crosstool-ng/crosstool-ng.git
cd crosstool-ng
./bootstrap
./configure --prefix=$HOME/install/crosstool-ng
make install
echo 'export PATH="${PATH}:$HOME/install/crosstool-ng/bin"' >>~/install/crosstool-ng/crosstool-ng.env

. ./install/crosstool-ng/crosstool-ng.env
mkdir -p ~/workdir
cd ~/workdir
ct-ng list-samples
ct-ng i686-ubuntu16.04-linux-gnu
ct-ng menuconfig
nice -19 ct-ng build.4

ls ~/x-tools/i686-xg-linux-gnu/

Raspberry Raspbian pre-built toolchains

raspberrypi/tools on github

download tools-master.zip

cd /tmp
# I'm using i686 the directory depend on host architecture (32/64 bit)
unzip ~/Downloads/tools-master.zip "tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/*"
mv tools-master/arm-bcm2708 ~/toolchains/raspberry-pi/
export PATH=$HOME/toolchains/raspberry-pi/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH

test.cpp:

#include <iostream>
int main(int argc, char **argv)
{
   std::cout << "hello world" << std::endl;
   return 0;
}

run test on rpi:

arm-linux-gnueabihf-g++ -Wall -O2 -o test test.cpp
scp test pi@rpi-host:/tmp
ssh pi@rpi-host
/tmp/test
$ hello world