Cross Compile (Ubuntu 12.04) - FREEDM-DGI/FREEDM GitHub Wiki
This article is for Ubuntu 12.04 LTS
Before you start!
Do not install the Ubuntu boost package (libboost-all-dev) on the machine you are cross-compiling on. It makes all sorts of strange things happen.
If you did install it, you can remove it by doing
sudo apt-get remove libboost-all-dev
sudo apt-get autoremove
You can have the same version of boost installed from source: you just can't have the Ubuntu package installed or things get crazy.
Overview of Procedure
- Install packages
- Build Crosstool
- Download Boost 1.49
- Build Boost
- Get FREEDM source
- Build FREEDM
- Transfer to target.
Install Required Packages
sudo apt-get install flex bison automake libtool ncurses-dev texinfo lzma
sudo apt-get install gawk cvs patch g++ gpref subversion
Installing Crosstool-ng
Crosstool can be downloaded from their website. This guide is for version 1.19.0
Extract the downloaded package:
tar xjvf crosstool-ng-1.19.0.tar.bz2
Then, make crosstool-ng.
cd crosstool-ng-1.19.0
./configure
make
sudo make install
Configuring Crosstool & Building Compilers
Download a copy of the source for the TS7800 folder from this link. For my convience, I will refer to this tarball at 2.6.34.tar.gz
. I recommend renaming it to match.
- make a
ts7800
folder in your home directory. This will serve as the staging area for building the cross compiler. Collecting everything takes about 3.5GB, so keep that in mind. - Put the
2.6.34.tar.gz
file (the source tarball for the TS-7800 kernel) in this folder. - Invoke
ct-ng menuconfig
from inside the ts7800 folder. - Go into the Paths and Misc options menu and select "Try features marked as EXPERIMENTAL"
- Go back to the main menu and then into the Target Options menu. Confirm the following settings
- Target architecture is arm
- Endianness is Little Endian
- the Bitness is 32-bit
- Use EABI is selected
- Set the architecture Level to be
armv5t
- Select the line that says "Floating Point (hardware)" and select to software.
- Operating System Menu
- Target OS should be set to linux.
- Select the linux kernel version menu, then scroll to the bottom and choose "Custom Tarball or Directory" enter the path to the 2.6.34.tar.gz file (should be
/home/xxxx/ts7800/2.6.34.tar.gz
) - Select build shared libraries
- Check installed headers.
- Go into the binary utilities menu.
- Select binutils version 2.22
- Go into the C compiler menu
- Select GCC version 4.5.3
- Select C++ as an additional language
- Go into the C-Libray menu
- Select glibc version 2.13
- Go into Companion libraries (NEW)
- Set GMP version to 5.0.2
- Set MPFR Version to 3.1.0
- Set PPL version to 0.11.2
- Set CLooG/ppl version to 0.15.11
- set MPC version to 0.9
- If available set libelf version to 0.8.13
- Exit and save the configuration. Build to toolchain by invoking
ct-ng build
This part takes awhile. - Unless you changed the prefix from
${HOME}/x-tool/${CT_TARGET}
you should add${HOME}/x-tools/arm-unknown-linux-gnueabi/bin/
to your PATH. You can do this for one session by doingexport PATH=$PATH:${HOME}/x-tools/arm-unknown-linux-gnueabi/bin/
adding this to.bashrc
or similar will make it permanent.
Building Boost
You can now resume following the original tutorial at Building Boost