Project

General

Profile

Support #928

Updated by Daniel Curtis over 6 years ago

This is a guide for setting up a cross-compiling environment for ARM on Arch Linux 

 h2. Prepare the Environment 

 * Make sure the system is up to date: 
 <pre> 
 pacman -Syu 
 </pre> 

 * Install git and base-devel: 
 <pre> 
 pacman -S base-devel git 
 </pre> 

 h2. Install Raspberry Pi Toolchain 

 * Clone the toolchain repo (using @--depth 1@ will decrease the overall download size by 400MB): repo: 
 <pre> 
 mkdir ~/git && cd ~/git 
 git clone --depth 1 https://github.com/raspberrypi/tools.git 
 </pre> 

 * Add the tools to your path: 
 <pre> 
 echo 'export PATH=$PATH:~/git/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin' >> ~/.bash_profile 
 </pre> 

 * Source the @.bash_profile@: .bash_profile: 
 <pre> 
 source ~/.bash_profile 
 </pre> 

 * Check the ARM gcc version: 
 arm-linux-gnueabihf-gcc -v 
 #* _Example output:_ 
 <pre> 
 Using built-in specs. 
 COLLECT_GCC=arm-linux-gnueabihf-gcc 
 COLLECT_LTO_WRAPPER=/home/bob/Documents/git/github.com/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../libexec/gcc/arm-linux-gnueabihf/4.8.3/lto-wrapper 
 Target: arm-linux-gnueabihf 
 Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/.build/src/gcc-linaro-4.8-2014.01/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch --with-arch=armv6 --with-tune=arm1176jz-s --with-fpu=vfp --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-raspbian-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-float=hard 
 Thread model: posix 
 gcc version 4.8.3 20140106 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11) ~/bash_profile 
 </pre> 

 h2. Resources 

 * https://github.com/raspberrypi/tools 
 * https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/RaspberryPi

Back