error can't build gcc

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
User avatar
overburn
Member
Member
Posts: 50
Joined: Sun Feb 22, 2009 9:15 am

error can't build gcc

Post by overburn »

ok, i have the exact framework of the barebones kernel tutorial , and i compiled it , linked and put it on an image.
when i boot it , grub starts
and when i type kernel 200+18 it gives the error in the title
as the kernel.o file was PE, i tried adding OUTPUT_FORMAT("elf32-i386") to the ld file, but i get "ld: cannot perform PE operations on non PE output file 'kernel.bin'. "

anyone know wat's happening?
i'm using windows and cygwin and haven't figured out yet how to make gcc output elf files
Last edited by overburn on Tue Feb 24, 2009 9:23 am, edited 1 time in total.
One Tequila, Two Tequila, Three Tequila, Floor!
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Re: grub error 13: unsupported executable format

Post by xyzzy »

Build a cross compiler that can create ELF files: http://wiki.osdev.org/GCC_Cross-Compiler
User avatar
overburn
Member
Member
Posts: 50
Joined: Sun Feb 22, 2009 9:15 am

Re: grub error 13: unsupported executable format

Post by overburn »

i have a cross compiler... followed the tut
but how do i make it elf?
One Tequila, Two Tequila, Three Tequila, Floor!
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: grub error 13: unsupported executable format

Post by xDDunce »

search google for a program called "ld-elf.exe" that sorted my problems out whilst using windows. its the easy way round that error. although you will need a cross compiler eventually, it makes it all so much easier! but ld-elf is a simple quick fix if you just wanna build the barebones tutorials.

Cheers,
James.
User avatar
overburn
Member
Member
Posts: 50
Joined: Sun Feb 22, 2009 9:15 am

Re: grub error 13: unsupported executable format

Post by overburn »

ld-elf.exe are you sure?
i mean i find only blabla on google, no file
One Tequila, Two Tequila, Three Tequila, Floor!
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: grub error 13: unsupported executable format

Post by Solar »

overburn wrote:i have a cross compiler... followed the tut
but how do i make it elf?
Easy - if you followed the tutorial, that cross compiler you build there doesn't generate anything but ELF files.

If your kernel.o is still a PE file, chances are you did build the cross-compiler, but aren't using it. Check GCC Cross-Compiler: Usage.
Every good solution is obvious once you've found it.
User avatar
overburn
Member
Member
Posts: 50
Joined: Sun Feb 22, 2009 9:15 am

Re: grub error 13: unsupported executable format

Post by overburn »

i can't build gcc , followed the exact instructions in the wiki. downloaded everything.
but when i make all-gcc i get error at the end: make: *** [all-gcc] Error 2
and a whoooole bunch of warnings.
any tips?
One Tequila, Two Tequila, Three Tequila, Floor!
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: error can't build gcc

Post by Solar »

1) Can't help without the topmost error.

2) The tutorial in the Wiki works. Trust me. Proven dozens of times over. Every time someone said "it didn't work", he didn't follow the instructions closely enough.
Every good solution is obvious once you've found it.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: error can't build gcc

Post by AJ »

Hi,

Due to joining the Pedigree team, I've recently been playing a lot with cross compilers on Cygwin. Over the last couple of weeks, I have built cross compilers for GCC 4.3.0 - 4.3.3 using binutils 2.19 and it all works very nicely.

As Solar is aware, I originally had problems with building a cross-compiler myself, and I never figured out the cause (all I know is a new release of GCC solved my problem at the time - about 2 years ago). I can assure you, however, that the latest versions do work with the tutorial. Have you extended your PATH environment variable?

Cheers,
Adam
User avatar
overburn
Member
Member
Posts: 50
Joined: Sun Feb 22, 2009 9:15 am

Re: error can't build gcc

Post by overburn »

yes.. i have
so i should get a newer gcc .. thanx :D
One Tequila, Two Tequila, Three Tequila, Floor!
Post Reply