View Single Post
Old 13th November 2008
nfries88's Avatar
nfries88 nfries88 is offline
Port Guard
 
Join Date: Sep 2008
Posts: 24
Default

Quote:
Originally Posted by TerryP View Post
The processor used to host the compiler, has less effect effect on the binaries generated by the compiler, then most people think. If it wasn't this way, the word "cross compiler" would have a different meaning.

You can use the machine flags (-m) to adjust the output created by the GNU Compiler Collection (GCC), -m32 -> 32-bit environment, -m64 -> 64-bit environment. I don't know off hand if you need both a 32-bit and 64-bit version of binutils for the platforms in question, but you probably do.
Interesting to know.
How would I get GCC to use the 32-bit binutils then?
Also guessing that I can't build a 64-bit binary on 32-bit x86 using -m64 if a 64-bit binutils is required?
Just making sure I understand all this.

Quote:
Originally Posted by TerryP
The x86-64 chips we usually call AMD64, understand the instruction sets used for 32-bit/16-bit x86 programs + the relevant 64-bit portions of the instruction set / Long Mode, etc.

So, as the processor can understand the machine code, the Operating System can be made to understand the binary format used for the executable images -> this is ELF in 32-bit/64-bit forms; in the case of modern Linux/BSD systems if memory serves.
I had assumed that was the case (I already knew 64-bit processors understand 32-bit instructions the same way that 32-bit processors understand 16-bit instructions) but am completely uncertain as to whether or not systems other than Windows support that behavior.
Reply With Quote