Version 4, changed by nw-kawk. 03/24/2007. Show version history
The nios2-elf gcc toolchains will be installed in /usr/local/bin and /usr/local/nios2-elf .
This gcc use newlib, and need a lot of efferts to build uClinux applications.
If you are newbie and want to develope uClinux applications, don't use this one, use the prebuild nios2gcc in nios2 uClinux wiki.
Download the source .
NOTE, you can not use gcc4 to compile the binutils 2.15 .
You must use gcc3, (gcc32 on FC4, gcc34 on FC6) .
Enable wheel group in sudoers and add yourself to group wheel, so that you can use sudo command to install the tools.
as root, run visudo,
# Uncomment to allow people in group wheel to run all commands
%wheel ALL=(ALL) ALL
save file with ESC :wq
Then edit /etc/group, and add yourself to wheel group
wheel:x:10:root,hippo
Now, as a user, start the build, and it may take a long time.
mkdir ~/nios2
cd ~/nios2
tar zxf niosii-gnutools-src-6.1.gz
cp src/newlib/newlib/configure.host.smallc src/newlib/newlib/configure.host # Select small library set of newlib
zip -r src.zip src
rm -rf src
unzip -a src.zip # convert the CRLF
mkdir build
cd build
mkdir binutils gcc newlib gcc2 gdb
cd binutils
../../src/binutils/configure --target=nios2-elf
make
sudo make install
cd ..
cd gcc
../../src/gcc/configure --target=nios2-elf --enable-languages=c
make
sudo make install
cd ..
cd newlib
../../src/newlib/configure --target=nios2-elf
make
sudo make install
cd ..
cd gcc2
../../src/gcc/configure --target=nios2-elf --enable-languages=c,c++ --with-newlib
make
sudo make install
cd ..
cd gdb
../../src/gdb/configure --target=nios2-elf
make
sudo make install
Check the new gcc, nios2-elf-gcc -v
Reading specs from /usr/local/lib/gcc/nios2-elf/3.4.1/specs
Configured with: ../../src/gcc/configure --target=nios2-elf --enable-languages=c,c++ --with-newlib
Thread model: single
gcc version 3.4.1 (Altera Nios II 5.1 b93)
This is the same as in v6.0 and some earlier IDE releases. The only change in the v6.1 source distribution since v6.0 is whitespace and proper inclusion of some files which were missing in v6.0 (in directories gcc/config/nios2 and newlib).