PE GCC Cross Compiler

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
Hoozim
Member
Member
Posts: 53
Joined: Fri Jul 23, 2010 8:26 am

PE GCC Cross Compiler

Post by Hoozim »

How would I make a GCC cross compiler to spits out PE files instead of ELF files?

Hoozim
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: PE GCC Cross Compiler

Post by qw »

Set the target to pe instead of elf.
Hoozim
Member
Member
Posts: 53
Joined: Fri Jul 23, 2010 8:26 am

Re: PE GCC Cross Compiler

Post by Hoozim »

I tried that but I couldn't run the produced executables in the output bin.

Hoozim
Snake
Posts: 19
Joined: Wed Mar 21, 2012 7:38 pm

Re: PE GCC Cross Compiler

Post by Snake »

By any chance did you try to run your executables on a system that expects elf files?
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: PE GCC Cross Compiler

Post by gerryg400 »

Hoozim wrote:I tried that but I couldn't run the produced executables in the output bin.

Hoozim
How did you try ? What does 'couldn't run' mean ? What's an 'output bin' ?
If a trainstation is where trains stop, what is a workstation ?
Hoozim
Member
Member
Posts: 53
Joined: Fri Jul 23, 2010 8:26 am

Re: PE GCC Cross Compiler

Post by Hoozim »

What I meant to say is I am creating a GCC cross-compiler to compile newlib for my OS. I want to compile newlib into a PE format since that is what my OS supports. How do I do that since isn't newlib configured to spit out an ELF executable by default?

Hoozim
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: PE GCC Cross Compiler

Post by gravaera »

Yo:

Newlib is C code -- it is not biased toward any particular executable format, and the lib can be compiled into any format. Newlib isn't biased toward ELF at all.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: PE GCC Cross Compiler

Post by Brynet-Inc »

Hoozim wrote:What I meant to say is I am creating a GCC cross-compiler to compile newlib for my OS. I want to compile newlib into a PE format since that is what my OS supports. How do I do that since isn't newlib configured to spit out an ELF executable by default?

Hoozim
EDIT: Removed 2015: Imageshack replaced all links with spam.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply