http://sopc.et.ntust.edu.tw/pipermail/nios2-dev/2009-September/003066.html

Dear nios2 developers,

Please note that I have rebuilt the gcc4 toolchain. The compiler is renamed to nios2-linux-gnu-gcc. Please pull toolchain-mmu/master and 
uClinux-dist/trunk to get updates. You may find patches and rebuild instruction in http://sopc.et.ntust.edu.tw/pub/gnutools/nios2gcc4/README.

Cheers,
Thomas


Build nios2 gcc4 toolchain

0. you need gcc3 and makeinfo to build. install these packages,

yum install compat-gcc-34 texinfo tetex*

1. get the source

http://www.niosftp.com/pub/gnutools/wrs-linux-4.1-176-nios2-wrs-linux-gnu.src.tar.bz2

2. get the patches

ftp://sopc.et.ntust.edu.tw/pub/gnutools/nios2gcc4

0001-binutils-fix-makeinfo-version-check-in-configure.patch
0001-gcc-fix-makeinfo-version-check-in-configure.patch
0001-gdb-fix-makeinfo-version-check-in-configure.patch
0001-kbuild-fix-C-libary-confusion-in-unifdef.c-due-to-g.patch
build.sh
REAME (this file)

3. untar the source

tar jxf wrs-linux-4.1-176-nios2-wrs-linux-gnu.src.tar.bz2

4. in the wrs-linux-4.1-176-nios2-wrs-linux-gnu dir, there are source tarballs. extract them to build dir, /opt/nios2gcc4/src. 

cd wrs-linux-4.1-176-nios2-wrs-linux-gnu

tar jxf binutils-4.1-176.tar.bz2	-C /opt/nios2gcc4/src
tar jxf expat-4.1-176.tar.bz2		-C /opt/nios2gcc4/src
tar jxf gcc-4.1-176.tar.bz2		-C /opt/nios2gcc4/src
tar jxf gdb-4.1-176.tar.bz2		-C /opt/nios2gcc4/src
tar jxf glibc-4.1-176.tar.bz2		-C /opt/nios2gcc4/src
tar jxf glibc_localedef-4.1-176.tar.bz2	-C /opt/nios2gcc4/src
tar jxf glibc_ports-4.1-176.tar.bz2	-C /opt/nios2gcc4/src
tar jxf linux-4.1-176.tar.bz2		-C /opt/nios2gcc4/src

5. apply the patches

cd /opt/nios2gcc4/src/binutils-2.17.50
patch -p1 < 0001-binutils-fix-makeinfo-version-check-in-configure.patch
cd /opt/nios2gcc4/src/gcc-4.1
patch -p1 < 0001-gcc-fix-makeinfo-version-check-in-configure.patch
cd /opt/nios2gcc4/src/gdb-wrs
patch -p1 < 0001-gdb-fix-makeinfo-version-check-in-configure.patch
cd /opt/nios2gcc4/src/linux-2.6.21-wrs-nios2
patch -p1 < 0001-kbuild-fix-C-libary-confusion-in-unifdef.c-due-to-g.patch

6. run the build script, you can change the build dir, /opt/nios2gcc4 and install dir /opt/nios2.

sh build.sh

7. you will need mkimage of u-boot or install it from debian/ubuntu package uboot-mkinage.



Reply via email to