Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
For several days now I have been trying to build a GCC cross compiler capable of producing plain binary files for my kernel. I cannot get it to work no matter how hard I try. Any help or suggestions?
Host Compiler: GCC version 3.4.4
Host binutils: version 2.17.50
The binutils version I am trying to build is 2.17 from gnu.org
I am using Cygwin. Everything is up too date and I just downloaded it a couple of days ago. I tried:
there's a step-by-step explanation on the wiki. It lists some pitfalls. So far, that always worked for me.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Candy wrote:i686-elf isn't a valid target, try i686-pc-elf. That could be a small problem, but I don't think it's your main problem...
I never noticed any differences between i386-elf and i386-*-elf...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Hello,
I've uploaded a cygwin hosted toolchain to my sourceforge project some time ago (link). It's should still be up to data and you might give it a try if you can't solve your compiler issue.
Thanks gaf. I will look into that. Can they output a plain binary?
I followed the step by step explanation on the wiki and I still get those errors. I never get past building binutils. Do you think that I should try to build earlier version of binutils, like 2.16.1.
I've had different trouble with building i686-elf targetted tools before--they kept segfaulting on my kernel builds. I tried building for i586-elf instead and it worked, so it might be worth trying it out. (Reference thread: http://www.osdev.org/phpBB2/viewtopic.php?t=11813)
frank wrote:I followed the step by step explanation on the wiki and I still get those errors. I never get past building binutils.
Check again pedantically that you are following the steps in the Wiki. I mean, pedantically.
For example, your example configure call doesn't have the leading ../binutils-... part - are you really outside the binutils source tree, and are you really calling the configure script of the binutils source tree? Please do try the exact instructions from the Wiki before trying any deviations. The Wiki instructions do work, and do so reliably.
Do you think that I should try to build earlier version of binutils, like 2.16.1.
No. 2.17 is proven to work.
Every good solution is obvious once you've found it.
frank wrote:Do you think that I should try to build earlier version of binutils, like 2.16.1.
From user experience: 2.16.1 has a nasty bug in GAS.
Also what people tend to forget, you need flex and bison installed
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Frank Holton@franks-computer /usr/src/build-binutils
$ export PREFIX=/usr/cross
Frank Holton@franks-computer /usr/src/build-binutils
$ export TARGET=i586-elf
Frank Holton@franks-computer /usr/src/build-binutils
$ cd /usr/src/build-binutils
Frank Holton@franks-computer /usr/src/build-binutils
$ ../binutils-2.17/configure --target=$TARGET --prefix=$PREFIX --disable-nls
creating cache ./config.cache
checking host system type... i686-pc-cygwin
checking target system type... i586-pc-elf
checking build system type... i686-pc-cygwin
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for gnatbind... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f
2
checking for correct version of gmp.h... no
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... expect
checking for runtest... runtest
checking for i686-pc-cygwin-ar... no
checking for ar... ar
checking for i686-pc-cygwin-as... no
checking for as... as
checking for i686-pc-cygwin-dlltool... no
checking for dlltool... dlltool
checking for i686-pc-cygwin-ld... /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../
i686-pc-cygwin/bin/ld.exe
checking for i686-pc-cygwin-lipo... no
checking for lipo... no
checking for i686-pc-cygwin-nm... no
checking for nm... nm
checking for i686-pc-cygwin-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-cygwin-strip... no
checking for strip... strip
checking for i686-pc-cygwin-windres... no
checking for windres... windres
checking for i686-pc-cygwin-objcopy... no
checking for objcopy... objcopy
checking for i686-pc-cygwin-objdump... no
checking for objdump... objdump
checking for i586-elf-cc... no
checking for i586-elf-gcc... no
checking for i586-elf-c++... no
checking for i586-elf-g++... no
checking for i586-elf-cxx... no
checking for i586-elf-gxx... no
checking for i586-elf-gcc... no
checking for i586-elf-gcj... no
checking for i586-elf-gfortran... no
checking for ar... no
checking for i586-elf-ar... no
checking for as... no
checking for i586-elf-as... no
checking for dlltool... no
checking for i586-elf-dlltool... no
checking for ld... no
checking for i586-elf-ld... no
checking for lipo... no
checking for i586-elf-lipo... no
checking for nm... no
checking for i586-elf-nm... no
checking for objdump... no
checking for i586-elf-objdump... no
checking for ranlib... no
checking for i586-elf-ranlib... no
checking for strip... no
checking for i586-elf-strip... no
checking for windres... no
checking for i586-elf-windres... no
checking where to find the target ar... just compiled
checking where to find the target as... just compiled
checking where to find the target cc... pre-installed
checking where to find the target c++... pre-installed
checking where to find the target c++ for libstdc++... pre-installed
checking where to find the target dlltool... just compiled
checking where to find the target gcc... pre-installed
checking where to find the target gcj... pre-installed
checking where to find the target gfortran... pre-installed
checking where to find the target ld... just compiled
checking where to find the target lipo... pre-installed
checking where to find the target nm... just compiled
checking where to find the target objdump... just compiled
checking where to find the target ranlib... just compiled
checking where to find the target strip... just compiled
checking where to find the target windres... just compiled
checking whether to enable maintainer-specific portions of Makefiles... no
updating cache ./config.cache
creating ./config.status
creating Makefile
Frank Holton@franks-computer /usr/src/build-binutils
$ make all install
make[1]: Entering directory `/usr/src/build-binutils'
mkdir -p -- ./libiberty
Configuring in ./libiberty
configure: error: invalid feature name: nls
make[1]: *** [configure-libiberty] Error 1
make[1]: Leaving directory `/usr/src/build-binutils'
make: *** [all] Error 2
I'm sorry if I'm missing something really simple.
Yes I have flex and bison.
By the way, do I need to download the GCC packages to be able to build just binutils?
Thanks gaf, they will do just fine. I would really like to get all of this to work so I can build a compiler for my OS( one day )
At this point, I suspect a broken cygwin download...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]