Welcome, guest ( Login )

WikiHome » OperatingSystems » µClinux » BinaryToolchain

BinaryToolchain

Version 38, changed by maddogbattie. 05/16/2008.   Show version history

Linked from UClinuxDist

Attached are binary of the tools to run on Linux PC and root fs from buildroot. You can use it to compile kernel and apps.You don't have to download and build buildroot (but you should try it later, once you've got more experienced using the BuildrootGuide).

Login as a user account on Linux PC, eg, hippo. The user home dir will be /home/hippo, short form as ~/ .

Use web browser to download the cross tools (69MB). Best thanks to Altera's kindly hosting these files.
(sha1sum 6873249d8eae7c2981aac6791f044ddaab507566  nios2gcc-20080203.tar.bz2)
Open a terminal. Run as root or use sudo,
sudo tar jxf nios2gcc-20080203.tar.bz2 -C /

The cross gcc tools MUST be installed in /opt/nios2 dir. Then setup the PATH for the cross gcc, you can add a line at the end of file ~/.bash_profile (or ~/.profile on Debian/Ubuntu) ( the file is hidden, you have to use "ls -a" to find it . For "gedit" use open Location, and enter the file name)

PATH="\${PATH}":/opt/nios2/bin                   (PATH="$PATH:/opt/nios2/bin" might be better for ~/.profile - Experts??)

After you change the .bash_profile or .profile, you need to logout and login again. So that it will be in the PATH when you login.

Check with,
echo $PATH
It should display like this, with nios2 path at the end,
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/nios2/bin

To verify the cross gcc, try out,
nios2-linux-uclibc-gcc -v

It should display the info,
Reading specs from /opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/specs
Configured with: /root/buildroot/toolchain_build_nios2/gcc-3.4.6/configure --prefix=/opt/nios2 --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=nios2-linux-uclibc --enable-languages=c --enable-shared --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-nls --enable-threads --disable-multilib --enable-cxx-flags=-static
Thread model: posix
gcc version 3.4.6

Then try build kernel and apps as in the UClinuxDist .



Optionally, you can install ccache, the compiler cache, which can reduce the compilation time a lot.
Install required package, as root or via sudo
On Fedora,RHEL, 
yum install ccache
On Debian/Ubuntu, (via sudo)
apt-get install ccache


Then add links, still as root or via sudo
ln -s /usr/bin/ccache /usr/lib/ccache/nios2-linux-uclibc-gcc
ln -s /usr/bin/ccache /usr/lib/ccache/nios2-linux-uclibc-g++
ln -s /usr/bin/ccache /usr/lib/ccache/nios2-linux-uclibc-c++


When you compile something, the cache will be used, you can check cache status with,
ccache -s

Attachments (0)

  File By Size Attached Ver.