Can a native 64-bit CPU run 32-bit code ?
My laptop has a AMD Athlon 64 Processor 3700+, Architecture is x86_64. My problem is that I have to compile a code that will then be linked to pre-compile binaries produced on 32-bit machines. In short, everything must be compiled to generate 32-bit code for the sake of compatibility. There should be an option in the gcc compiler that forces it to generate 32-bit code.. But assuming I've got an executable for 32-bit machines, then can I run such an exectable on MY OWN laptop which is 64-bit ? If the answer is "yes" (I hope so) then I'd be grateful to know how I can do that . Thank you in advance for your help. Maura
GCC option -m32 will generate x86 (32-bit) code on an x86_64 (64-bit) machine. It will run on any x86 machine, and on the x86_64 machine as well. No need to use the "linux32" shell. Joe Maura Edeweiss Monville wrote:
My laptop has a AMD Athlon 64 Processor 3700+, Architecture is x86_64. My problem is that I have to compile a code that will then be linked to pre-compile binaries produced on 32-bit machines. In short, everything must be compiled to generate 32-bit code for the sake of compatibility. There should be an option in the gcc compiler that forces it to generate 32-bit code.. But assuming I've got an executable for 32-bit machines, then can I run such an exectable on MY OWN laptop which is 64-bit ? If the answer is "yes" (I hope so) then I'd be grateful to know how I can do that .
Thank you in advance for your help.
Maura
participants (2)
-
Joe Georger
-
Maura Edeweiss Monville