Forum Discussion
Altera_Forum
Honored Contributor
21 years agogcc compiler for nios2
Hi, I am looking for a nios2-elf-gcc compiler that runs under linux. I have a working nios-elf-gcc compiler for NIOS1 but can't find the NIOS2 version anywhere. Jelle
Altera_Forum
Honored Contributor
21 years agoThe Nios II toolchain can be rebuilt under Linux using the source code found on the Nios II Embedded Processor CD.
The source code should be installed onto your windows machine. I tarred and bzipped it, and then transferred it to my Linux machine. Word of warning... the toolchain is littered with CRLF's that really cause problems with the configure scripts and Makefiles. Any problems you might have are quite likely due to CRLF's. You may want to try running the source tree through a "dos2unix" type utility. I used "flip" to fix up the tree. I used the following environment variables while following the instructions below:target = nios2-elf
prefix = /home/kenw/work/r6200
scratch = /home/kenw/tmp <div class='quotetop'>QUOTE </div> --- Quote Start --- Building/Installing binutils $ mkdir -p $scratch/build/binutils $ cd $scratch/build/binutils $ $scratch/src/binutils/configure --target=$target --prefix=$prefix -v 2>&1 | tee configure.out $ make -w all install 2>&1 | tee make.out $ export PATH=$prefix/bin:$PATH Building/Installing gcc $ mkdir -p $scratch/build/gcc $ cd $scratch/build/gcc $ $scratch/src/gcc/configure --target=$target --prefix=$prefix --with-gnu-as --with-gnu-ld --with-newlib -v 2>&1 | tee configure.out $ make -w all-gcc install-gcc LANGUAGES="c c++" 2>&1 | tee make.out Building/Installing newlib $ mkdir -p $scratch/build/newlib $ cd $scratch/build/newlib $ $scratch/src/newlib/configure --target=$target --prefix=$prefix 2>&1 | tee make.out $ cd $scratch/src/newlib/newlib $ cp configure.host.smallc configure.host $ make 2>&1 | tee make.out $ make install[/b] --- Quote End --- Good luck!