I noticed this thread being linked from the official Armory subforum which inspired me to include a step by step guide to get it working. This could probably be made into a shellscript, but my linuxfu is not strong enough and it will probably be broken very easily as time marches on and things gets updated.
These steps were tested on a clean install of Ubuntu 12.10 64-bit on 2013-03-26. The current version of Bitcoin Armory is 0.87-beta.
(This pretty much a copy paste from a markdown file I wrote for future me, however, there are a few manual edits to account for the forum syntax)
========================================
## Starting point
This step by step guide is done on a clean install of ubuntu 12.10 desktop amd64. During installation the option ”Download updates while installing” was left unchecked to make the results completly replicable.
After the installation process completed the only things I did before starting this guide is change the resolution of the screen and install OpenSSH-server since I’m used to the OS X terminal app.
sudo apt-get install openssh-server
to figure out the ip of the computer i used
ifconfig
(Yes, this is a
VERY thorough walkthrough, the idea is that when I’m doing this again, maybe in a year or two, nothing should have to be googled while following this guide)
## Download crosstool-ng
## Install required packages
My main gripe with the other guides was that apparantly they had some stuff already installed on their systems. I say this because when I followed their instructions I kept hitting roadblocks.
The complete list of packages i installed after the ubuntu installer was do is as follows:
* openssh-server (i can’t imagine this affects anything, but I’m not going to leave anything out)
* automake
* bison
* build-essential
* flex
* gawk
* gperf
* libncurses5-dev
* libtool
* subversion
* texinfo
## Create directories
mkdir -p ~/src/Crosstool/RaspberryPi/include
mkdir -p ~/src/Crosstool/RaspberryPi/staging
mkdir -p ~/bin/Crosstool/crosstool-ng
mkdir -p ~/bin/Crosstool/Toolchains/
## Configure and Build crosstool-ng
sudo apt-get install automake bison build-essential flex gawk gperf libncurses5-dev libtool subversion texinfo
wget
http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.17.0.tar.bz2 tar xfv crosstool-ng-1.17.0.tar.bz2
cd crosstool-ng-1.17.0/
./configure --prefix=/home/[USERNAME]/bin/Crosstool/crosstool-ng
make
make install
cd ..
rm -r crosstool-ng-1.17.0 crosstool-ng-1.17.0.tar.bz2
export PATH=$PATH:/home/[USERNAME]/bin/Crosstool/crosstool-ng/bin/
cd ~/src/Crosstool/RaspberryPi/staging/
ct-ng menuconfig
This opens up a menubased interface to configure crosstool before building it. Do the following steps:
Paths and misc options —> Try features marked as EXPERIMENTAL (NEW)
Paths and misc options —> Prefix directory (NEW) —> ${HOME}/bin/Crosstool/Toolchains/${CT_TARGET}
Target options —> Target Architecture(alpha) —> arm
Operating System —> Target OS (bare-metal) —> linux
Binary utilities —> binutils version (2.22 (EXPERIMENTAL)) —> 2.21.1a
C compiler —> Show Linaro versions (EXPERIMENTAL) (NEW)
C compiler —> C++
Exit —> Yes
Finally build it:
ct-ng build
## Modify path permanently
(untested)Add these lines to the bottom of the ~/.profile file:
export PATH=$PATH:/home/[USERNAME]/bin/Crosstool/Toolchains/arm-unknown-linux-gnueabi/bin
## Check compiler
arm-unknown-linux-gnueabi-gcc --version
mkdir /tmp/helloWorld/
cd /tmp/helloWorld/
cat > test.c
#include <stdio.h>
int main() { printf("Hello, world!\n"); return 0; }
^D
arm-unknown-linux-gnueabi-gcc -o test test.c
chmod +x test
scp test pi@@[IP_OF_PI_GOES_HERE]:/tmp/
ssh pi@[IP_OF_PI_GOES_HERE] /tmp/test
## Resources / References
* [Kitware blog: Cross-Compiling for Raspberry Pi](
http://kitware.com/blog/home/post/426)
* [Building a Raspberry Pi Cross Compiler: could not retrieve eglibc-2_16](
http://brains.witsmith.com/2012/10/building-cross-compiling-toolchain-for.html)
* [How to build a cross compiler for your Raspberry Pi](
http://www.bootc.net/archives/2012/05/26/how-to-build-a-cross-compiler-for-your-raspberry-pi/)
* [crosstool-ng](
http://crosstool-ng.org/)