Question about Cross-Compiler Build Wiki Tutorial

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
eulercircles
Posts: 3
Joined: Tue Nov 11, 2008 11:17 am

Question about Cross-Compiler Build Wiki Tutorial

Post by eulercircles »

I am going through the tutorials and now I am rebuilding binutils and gcc with the correct target platform. The only problem I am having is that the TARGET variable is set to "i586-elf". I assume this gets set in the configure file in the binutils folder, but what I want to know is can it be anything other than *5*86? What are the options available to me here? Thanks!
eulercircles
Posts: 3
Joined: Tue Nov 11, 2008 11:17 am

Re: Question about Cross-Compiler Build Wiki Tutorial

Post by eulercircles »

Hmmm... I found how to list the supported Architectures (objdump -i), but it only lists: pe-i386, pei-i386, elf32-little, elf32-big. Not only does this not include the value in the tutorial, but it doesn't show x86_64... Please help.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Question about Cross-Compiler Build Wiki Tutorial

Post by Combuster »

For the compiler, 64-bit mode is a different thing compared to 32-bit mode. It is larger, has more registers, and more prefixes to deal with. And when you have a 32-bit processor (i586) 64-bit code doesn't run on it, hence it doesn't get compiled.

Hence you should build a 64 bit compiler as per GCC Cross-Compiler for x86_64 if you want to support that too.

If you're looking for a list of configurations, look at the gcc/config.gcc file that comes with GCC
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
eulercircles
Posts: 3
Joined: Tue Nov 11, 2008 11:17 am

Re: Question about Cross-Compiler Build Wiki Tutorial

Post by eulercircles »

Alright, this helps very much. Thanks!
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Question about Cross-Compiler Build Wiki Tutorial

Post by AJ »

Hi,

I have just made an edit to that wiki page. Since GCC 4.3.2, I have had no problems building x86_64-elf out of the box (it may have been present for 4.3.1 as well), so have a go at the GCC Cross-Compiler tutorial first, simply substituting the build target.

Cheers,
Adam
Post Reply