Problem when porting Newlib (toolchain binaries missing ?)
Problem when porting Newlib (toolchain binaries missing ?)
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.
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
Does i586-elf-ar work when you type it from the command line ?
BTW, use the newest newlib.
BTW, use the newest newlib.
If a trainstation is where trains stop, what is a workstation ?
Re: Problem when porting Newlib (toolchain binaries missing
No, i586-elf-ar does not work. I will try with Newlib 1.20.0.
Re: Problem when porting Newlib (toolchain binaries missing
Well, I get the same error with the last version.
Re: Problem when porting Newlib (toolchain binaries missing
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.
If a trainstation is where trains stop, what is a workstation ?
Re: Problem when porting Newlib (toolchain binaries missing
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.
If a trainstation is where trains stop, what is a workstation ?
Re: Problem when porting Newlib (toolchain binaries missing
That's all from the GCC package. Where is binutils? i586-elf-as, i586-elf-ld, i586-elf-ar, ...fiveayem wrote:i586-elf-cpp i586-elf-gcc i586-elf-gcc-4.6.2 i586-elf-gcov
It looks like your cross-binutils is utterly missing. Which begs the question, how did you actually build the crosscompiler?
Every good solution is obvious once you've found it.
Re: Problem when porting Newlib (toolchain binaries missing
I'm going to build binutils again, then.
Re: Problem when porting Newlib (toolchain binaries missing
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)"
"i586-elf-gcc: internal compiler error: Segmentation fault (program as)"
Re: Problem when porting Newlib (toolchain binaries missing
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.
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
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.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)"
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.
Every good solution is obvious once you've found it.
Re: Problem when porting Newlib (toolchain binaries missing
I changed my gcc and binutils version and I built the whole toolchain in /usr/local/cross directory. Now, it is OK, thanks.