get GCC producing ELF

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
Poseidon

get GCC producing ELF

Post by Poseidon »

normally i work in linux, but my internet is down there, so unfortunately i've to work in windows now.. to compile i use gcc and all the other stuff under a cygwin shell. how can I get gcc so far to produce ELF code?
AR

Re:get GCC producing ELF

Post by AR »

The included GCC in Cygwin supposedly produces bad ELFs, if it actually supports them at all. You will probably be better off downloading GCC and Binutils from the GNU FTP server and making a customised cross compiler.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:get GCC producing ELF

Post by Solar »

See GCC Cross-Compiler in the FAQ.
Every good solution is obvious once you've found it.
Chris Giese

Re:get GCC producing ELF

Post by Chris Giese »

Why do you need ELF? CygWin makes Win32 PE COFF files -- why won't that format work?

GRUB works with ELF or COFF or nearly anything else, and a PE file loader isn't much more difficult to write than an ELF loader.

Just wondering...
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:get GCC producing ELF

Post by Perica »

..
Last edited by Perica on Tue Dec 05, 2006 9:41 pm, edited 1 time in total.
AR

Re:get GCC producing ELF

Post by AR »

I read that somewhere in this forum (MinGW32), the Cygwin linker doesn't support ELF at all as far as I can tell, "PE operations on non PE file"
Poseidon

Re:get GCC producing ELF

Post by Poseidon »

i'll build a cross-compiler.. what target do i have to use? i686-elf?
AR

Re:get GCC producing ELF

Post by AR »

The Cross Compiler target should of course be ELF, the type should be i686 unless you're testing on something lower. If you use the Cygwin compiler to build the cross compiler, the produced cross compiler will be dependant on the Cygwin DLLs but that doesn't really matter unless you try to use them outside of bash.
Post Reply