Page 1 of 1
Problem when porting Newlib (toolchain binaries missing ?)
Posted: Thu Dec 22, 2011 5:59 am
by fiveayem
Hello,
I'm currently trying to port Newlib for my OS and I need you help because I cannot manage compile it. I first compiled successfully an i586 toolchain (
GCC Cross-Compiler) and now I'm porting Newlib according to the instructions of this tutorial :
Porting Newlib. I use Newlib 1.15.0 to be as close as possible to tutorial. After configuring, I fixed the Makefile, correcting the path to makeinfo, which was wrong ("/usr/src/newlib-1.15.0/missing makeinfo" instead of "/usr/bin/makeinfo"). Then, the compilation started well, with no error, no warning, but after a minute, I got an error saying that
i586-elf-ar could not be found. I had set the following variables before configuring and compiling :
PREFIX=/usr/local/cross
TARGET=i586-elf
PATH=$PATH:$PREFIX/bin
I used the same variables to build binutils and gcc. The /usr/local/cross/bin directory contains the following binaries :
i586-elf-cpp i586-elf-gcc i586-elf-gcc-4.6.2 i586-elf-gcov
Any idea of where the problem comes from ?
Thank you for your help.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 6:26 am
by gerryg400
Does i586-elf-ar work when you type it from the command line ?
BTW, use the newest newlib.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 6:32 am
by fiveayem
No, i586-elf-ar does not work. I will try with Newlib 1.20.0.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 6:37 am
by fiveayem
Well, I get the same error with the last version.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 6:39 am
by gerryg400
Wait a minute, if it doesn't work then it's not installed or the path is wrong. It's not anything to do with new lib. Binutils is wrong.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 6:48 am
by gerryg400
Have you tested your assembler/compiler/linker toolchain. I'd advise writing a few test programs and making sure all your paths are correct first before trying something like newlib.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 7:17 am
by Solar
fiveayem wrote:i586-elf-cpp i586-elf-gcc i586-elf-gcc-4.6.2 i586-elf-gcov
That's all from the GCC package. Where is binutils? i586-elf-as, i586-elf-ld, i586-elf-ar, ...
It looks like your cross-binutils is utterly missing. Which begs the question, how did you actually
build the crosscompiler?
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 7:28 am
by fiveayem
I'm going to build binutils again, then.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 7:37 am
by fiveayem
Now I have built binutils again and I have got the necessary files in /usr/local/cross/bin directory, but I get the following error when compiling Newlib :
"i586-elf-gcc: internal compiler error: Segmentation fault (program as)"
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Thu Dec 22, 2011 12:53 pm
by bluemoon
As solar asked, how did you actually build the crosscompiler?
Specifically, what's your host platform, which versions of the tools, newlib and their and configure flags?
I'm not sure on gcc 4.6.2 but I'm using binutils 2.21, gcc 4.6.1 and newlib 1.19.0 and they works perfectly.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Fri Dec 23, 2011 3:27 am
by Solar
fiveayem wrote:Now I have built binutils again and I have got the necessary files in /usr/local/cross/bin directory, but I get the following error when compiling Newlib :
"i586-elf-gcc: internal compiler error: Segmentation fault (program as)"
You could not have built the cross-compiler according to the tutorial, as that would have given you functional binutils executables in /usr/local/cross in the first place. That means your cross-compiler - if it even
is a cross-compiler - was configured to use a
different binutils backend.
Now you built the binutils - not "again", but for the first time in the right place - and suddenly the cross-compiler uses a
different binutils backend, one it was
not configured for.
My suggestion: Don't waste your time patching around. Delete /usr/local/cross, and re-build your toolchain from scratch.
Re: Problem when porting Newlib (toolchain binaries missing
Posted: Sat Dec 24, 2011 4:32 am
by fiveayem
I changed my gcc and binutils version and I built the whole toolchain in /usr/local/cross directory. Now, it is OK, thanks.