Keeping rest of the resources required by a platform same,can we run a image built for a 32bit processor on 64bit processor and vice versa? Please explain it thoroughly if it works then how would it work and if no,then why not?
Asked
Active
Viewed 40 times
0
-
2Possible duplicate of [is it possible to run 64 bit code in a machine with 32 bit processor?](https://stackoverflow.com/questions/21099642/is-it-possible-to-run-64-bit-code-in-a-machine-with-32-bit-processor) – GSerg Oct 01 '17 at 08:56
-
@GSerg: no, the answer to this is a trivial yes. Cross-compiling doesn't require executing target code on the build host at all. You can build AArch64 binaries on an x86-32 host, or x86-64 binaries on an ARM32 host. The compiler and linker on the 32-bit build host will be using `uint64_t` / `int64_t` to calculate target addresses, but that's nothing special. 64-bit math on a 32-bit machine was a solved problem *long* before any 64-bit systems existed. (Add-with-carry...) – Peter Cordes Oct 01 '17 at 16:23
-
Possible duplicate of [cross compilers](https://stackoverflow.com/questions/4325096/cross-compilers) – Peter Cordes Oct 01 '17 at 16:28
-
@PeterCordes The OP specifically asks about running an x64 image on x86 as opposed to compiling. – GSerg Oct 01 '17 at 16:43
-
@GSerg: ah, I misread "built" as "build". i.e. "run an image build" = compile. Oops! – Peter Cordes Oct 01 '17 at 16:54
-
BTW, there's *nothing* in this question about x86. It's written as a generic CPU-architecture question. I think *most* 64-bit extensions to 32-bit platforms have a mode for running 32-bit code, but AArch64 is a big enough change from ARM32 that some AArch64 chips dropped support for 32-bit. This is the case in the newest iPhone. https://arstechnica.com/gadgets/2017/04/what-the-death-of-32-bit-ios-could-mean-for-apples-hardware-and-software/ – Peter Cordes Oct 01 '17 at 16:57