Page 1 of 1

Question about Cross-Compiler Build Wiki Tutorial

Posted: Tue Nov 11, 2008 11:30 am
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!

Re: Question about Cross-Compiler Build Wiki Tutorial

Posted: Tue Nov 11, 2008 11:38 am
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.

Re: Question about Cross-Compiler Build Wiki Tutorial

Posted: Tue Nov 11, 2008 3:17 pm
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

Re: Question about Cross-Compiler Build Wiki Tutorial

Posted: Tue Nov 11, 2008 3:35 pm
by eulercircles
Alright, this helps very much. Thanks!

Re: Question about Cross-Compiler Build Wiki Tutorial

Posted: Wed Nov 12, 2008 2:34 am
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