elf in windows with cygwin

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.
Post Reply
ohboy

elf in windows with cygwin

Post by ohboy »

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.
User avatar
Pype.Clicker
Member
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

Post by Pype.Clicker »

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/
Curufir

Re:elf in windows with cygwin

Post by Curufir »

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.
Post Reply