Hello!
I want to compile to ELF with cygwin, but LD doesn't recognize the file format.
I've tried to fix it by using newos' toolchains (newos.sf.net) but it didn't help.
I don't want to do it with djgpp, only cygwin.
elf in windows with cygwin
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:elf in windows with cygwin
You need to build an elf-enabled version of Cygwin's GCC to do so, iirc. Check out the "cross-compiler guide" from Solar&Candy at http://www.osdev.org/osfaq2/
Re:elf in windows with cygwin
I got curious about this so I went ahead and did it.
http://www.osdev.org/osfaq2/index.php/GCC%20Cross-Compiler
Follow that.
I used binutils 2.15, gcc 3.3.2 (You need the --with-newlib argument when compiling), both are vanilla sources from the gnu ftp site.
Seems to build my test kernel quite nicely.
Someone was asking about making binaries for bootsectors using Cygwin. Happy to report that with this cross-compiler I can use the '--oformat binary' flag on LD to produce a pure binary.
http://www.osdev.org/osfaq2/index.php/GCC%20Cross-Compiler
Follow that.
I used binutils 2.15, gcc 3.3.2 (You need the --with-newlib argument when compiling), both are vanilla sources from the gnu ftp site.
Seems to build my test kernel quite nicely.
Someone was asking about making binaries for bootsectors using Cygwin. Happy to report that with this cross-compiler I can use the '--oformat binary' flag on LD to produce a pure binary.