Forum Discussion
Altera_Forum
Honored Contributor
20 years agobuild nios2-elf-gcc with fedore4
Hi,
I try to build the compiler tools with fedora4. Binutils compiled and installed well. Following error on the screen when trying building gcc :checking whether byte ordering is bigendian... cross-compiling...
unknown
checking to probe for byte ordering... /usr/local/nios2-elf/nios2-elf/bin/ld: crt0.o: No such file: No such file or directory
collect2: ld returned 1 exit status
unknown
configure: error: unknown endianess - sorry
/src/src/gcc/libiberty/configure: line 3289: exit: please: numeric argument required
/src/src/gcc/libiberty/configure: line 3289: exit: please: numeric argument required I used : # ../configure --target=nios2-elf --prefix=/usr/local/nios2-elf --with-newlib --enable-languages=c,c++ and then make. I'm using gcc32 (not gcc 4.0), and the sources from the linux CDRom from Altera (Nios2 - 5.0). I first extracted GNUSRC.TGZ from the COMMON directory, and then copied in the sources found in LINUX/GNUBIN.TGZ Any idea what I do wrong? Stefaan15 Replies
- Altera_Forum
Honored Contributor
Got it !!
I got it works using src from Nios2 window cd. 1. binutils , configure --target=nios2-elf, make, make install 2. gcc in dir pass1, configure --target=nios2-elf --enable-languages=c --with-newlib, make, make install 3. newlib, configure --target=nios2-elf, make, make install 4. gcc in dir pass2, configure --target=nios2-elf --enable-languages=c,c++ --with-newlib, make, make install The libs are for newlib, and can not be used for uclinux. - Altera_Forum
Honored Contributor
Hippo,
just found some time for playing around with it again. I tried with the sources from the window cd on the fedora system, but the configure step gives me the following message immediate :
Stefaan: bad interpreter: No such file or directory - Altera_Forum
Honored Contributor
Use "zip -r" and "unzip -a" to convert the source.
It is similar to "dos2unix", but easier to use. You can find some details from earlier post, http://forum.niosforum.com/forum/index.php?showtopic=3040 (http://forum.niosforum.com/forum/index.php?showtopic=3040) post# 1 and post# 5. - Altera_Forum
Honored Contributor
I got there now (thanks to hippo, who showed me the way)
I did like this now : - get the windows sources, zip -r and unzip -a (I've put modified sources in /usr/src/nios2) - binutils : like expected :
- gcc first pass ( = without Clib and C++ support) :cd /usr/src/nios2/binutils mkdir build cd build ../configure --target=nios2-elf --prefix=/usr/local/nios2-elf make make install
- newlib c libraryPATH=/usr/local/nios2-elf:$PATH cd /usr/src/nios2/gcc mkdir build cd build ../configure --target=nios2-elf --prefix=/usr/local/nios2-elf --enable_languages=c --without-headers --with-newlib make make install
- gcc second pass :cd /usr/src/nios2/newlib mkdir build cd build ../configure --prefix=/usr/local/nios2-elf --target=nios2-elf make make install
The trick seems to be the --without-headers in the first gcc pass (see porting gcc (http://http://www.mega-tokyo.com/osfaq2/index.php/gcc%20cross-compiler))cd /usr/src/nios2/gcc/build ../configure --target=nios2-elf --prefix=/usr/local/nios2-elf --enable_languages=c,c++ --with-headers --with-newlib make make install - Altera_Forum
Honored Contributor
I have updated buildroot to compile c++ and libstdc++ for used with uClibc/uClinux.
Try out post#1 in http://forum.niosforum.com/forum/index.php?showtopic=3174 (http://forum.niosforum.com/forum/index.php?showtopic=3174)