I was talking about the their ftp sites. I just tried to compile a simple hello world app and outputng to a ELF binary format and I get the same problem as you. It is to do with the object file format. The default format for gcc under cygwin is COFF(PE), because the COFF format is not compatable with the ELF binary format, the linker show that error. I have not tried to compile the gnu compiler.Candamir wrote: But anyway, your answer sounds to me as if I had already managed to build a cross-compiler and this cross-compiler would output some file GRUB wouldn't load... Wrong. Anyway, I already tested Solar's script under another WinXP machine (Cygwin, obviously) without Dev-C++ and without DJGPP installed - ever.
GCC Cross Compiler error in Cygwin
Re:GCC Cross Compiler error in Cygwin
Re:GCC Cross Compiler error in Cygwin
Correct so far.B.E wrote: The problem is that you are trying to get cygwin to do something at it was not designed for. cygwin was designed to be a UNIX-like envirnment for windows. the default gcc compiler links the cygwin dll to all excutables that it compiles. because cygwin is not a UNIX emulator, rather a "bridge" between the two systems, the cygwin can only link and run COFF format executables.
That is why I wrote a HOWTO about building a cross compiler, which will run in the Cygwin environment, yet still churn out ELF object format.I have tried to build a basic kernal with cygwin, it added extra stuff to the binary so that my kernal would not run.
I did, and still occasionally do, and that is why and how I wrote (central parts of) the FAQ page in question.I have not heard of anyone that uses cygwin for OS deving.
I hope this was not meant as a recommendation.BTW Did you unistall the default gcc compiler before you install the Cross compiler?
What are you talking about?I was talking about the their ftp sites. I just tried to compile a simple hello world app and outputng to a ELF binary format and I get the same problem as you.
For all I understood, Candamir is trying, and failing, to build a cross compiler (which would be a COFF / Cygwin executable). Of course you will fail to execute an ELF executable in Cygwin! But unless I am seriously mistaken, that is not Candamir's problem.
Every good solution is obvious once you've found it.
Re:GCC Cross Compiler error in Cygwin
Correct. Right now, I have no other C/ASM projects than Hermes...For all I understood, Candamir is trying, and failing, to build a cross compiler (which would be a COFF / Cygwin executable). Of course you will fail to execute an ELF executable in Cygwin! But unless I am seriously mistaken, that is not Candamir's problem.
Re:GCC Cross Compiler error in Cygwin
Just a quick question...
Since this is for Cygwin on Windows, wouldn't it be an idea to put a set of known good binaries online somewhere for a crosscompiler to i386 ELF? I can host this on my website (as long as the archive compresses to less than 1MB, thats the file size limit from my provider, not from me), but I don't have access to Windows so I can't make or test this.
Since this is for Cygwin on Windows, wouldn't it be an idea to put a set of known good binaries online somewhere for a crosscompiler to i386 ELF? I can host this on my website (as long as the archive compresses to less than 1MB, thats the file size limit from my provider, not from me), but I don't have access to Windows so I can't make or test this.
Re:GCC Cross Compiler error in Cygwin
It would be a good idea to make a host for crosscompilers running on windows + linux for crosscompiling to i386 ELF and x86_64 ELF, however, I usually add or remove some flags when I compile stuff. These would be pretty safe though, I'd be very happy with them. I'd also be happy to provide x86_64 crosscompiler binaries for linux , they're quite large though...paulbarker wrote: Just a quick question...
Since this is for Cygwin on Windows, wouldn't it be an idea to put a set of known good binaries online somewhere for a crosscompiler to i386 ELF? I can host this on my website (as long as the archive compresses to less than 1MB, thats the file size limit from my provider, not from me), but I don't have access to Windows so I can't make or test this.
Re:GCC Cross Compiler error in Cygwin
I know, its not just the binaries its the /usr/lib/gcc and /usr/lib/gcc-lib or whatever, and the platform triple (/usr/i386-pc-linux-gnu or other). I think a sourceforge project may be the best way of hosting this sort of stuff.
Re:GCC Cross Compiler error in Cygwin
I use cygwin for most of my programming, including osdev (when I get arround to it)
Following the information in the FAQ, I've successfully compiled cross compilers for the following platforms:
i386-elf
x86_64-elf
m68k-elf
that's with GCC 3.4.5 and 4.0.2, you may have to experiment with binutils versions.
I havn't tried others architectures yet, I may have a play arround though.
Following the information in the FAQ, I've successfully compiled cross compilers for the following platforms:
i386-elf
x86_64-elf
m68k-elf
that's with GCC 3.4.5 and 4.0.2, you may have to experiment with binutils versions.
I havn't tried others architectures yet, I may have a play arround though.
Re:GCC Cross Compiler error in Cygwin
@ paulbarker:
The thing is that some people might want to use GCC 4.x, some would want to use 3.4.x, then there's a new version of GCC released but the maintainer didn't do the compilation yet... I still think that providing a HOWTO about building your own toolchain works best for everybody.
And there's the issue that having a GCC cross-compiler binary installed doesn't give you a decent shell, make, version control etc. - you'd still have to install Cygwin for that, and it would probably generate as many problems as it would solve.
Of course you're free to set up such a service, but I'll stick to the HOWTO. (Looking forward to adding PDCLib and going to step 2... )
The thing is that some people might want to use GCC 4.x, some would want to use 3.4.x, then there's a new version of GCC released but the maintainer didn't do the compilation yet... I still think that providing a HOWTO about building your own toolchain works best for everybody.
And there's the issue that having a GCC cross-compiler binary installed doesn't give you a decent shell, make, version control etc. - you'd still have to install Cygwin for that, and it would probably generate as many problems as it would solve.
Of course you're free to set up such a service, but I'll stick to the HOWTO. (Looking forward to adding PDCLib and going to step 2... )
Every good solution is obvious once you've found it.
Re:GCC Cross Compiler error in Cygwin
thats crap. a lot of us use cygwin for osdeving and it works fine. just tell cygwin not to use default libraries and it wont add the 'extra stuff'.B.E wrote: I have tried to build a basic kernal with cygwin, it added extra stuff to the binary so that my kernal would not run. I have not heard of anyone that uses cygwin for OS deving.
-- Stu --
Re:GCC Cross Compiler error in Cygwin
Agreed, the beauty of a HOWTO is that it is independant of what version of GCC you want to use and also what platform you'r developing on and for.Solar wrote: @ paulbarker:
The thing is that some people might want to use GCC 4.x, some would want to use 3.4.x, then there's a new version of GCC released but the maintainer didn't do the compilation yet... I still think that providing a HOWTO about building your own toolchain works best for everybody.
And there's the issue that having a GCC cross-compiler binary installed doesn't give you a decent shell, make, version control etc. - you'd still have to install Cygwin for that, and it would probably generate as many problems as it would solve.
Re:GCC Cross Compiler error in Cygwin
The plan wasn't to replace the HOWTO, rather to suppliment it. It would help people who couldn't get the HOWTO working.
Re:GCC Cross Compiler error in Cygwin
Hey! Finally, I managed to build my cross compiler with Solar's script! I don't know /why/ it worked, I only know it worked. ??? I didn't modify anything in my Cygwin setup or anything... Strange but cool Now I can continue with OS-deving (hadn't had much time these days, either...)