running 64-bit binaries on a 32-bit OS
Yann E. MORIN
yann.morin.1998@anciens.enib.fr
Fri Apr 27 15:18:00 GMT 2007
Hello Robert and all!
On Tuesday 24 April 2007 19:52, Robert P. J. Day wrote:
> AFAIK, i can build a 64-bit toolchain, then compile a simple "hello,
> world" using that, right? i can't just run a 64-bit binary on the
> 32-bit OS, so testing a 64-bit binary would truly show that the
> toolchain was built correctly, right? with all of the libs properly
> built and so on.
On your 32-bit distro, build your "hello, world!" demo app with your 64-bit
cross-toolchain. A static link should be enough, while a dynamic link would be
more complex to set up.
Run your demo app: it doesn't run.
Then build a 64-bit enabled kernel with 32-bit (IA32) emulation.
Boot this 64-bit kernel. Your userland is still 32-bit, but your kernel should
just handle this.
Then run your demo app: it runs.
Plus, as already suggested, file and readelf to check the demo app.
That's what I'd do.
Note: simply booting the kernel is not a sufficient proof, because one could
argue that it is still 32-bit because it runs the 32-bit userland. By running
your 64-bit demo app with your 64-bit kernel, you can proove the 64-bitness
of your toolchain. Somewhat.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^ |
| --==< °_° >==-- °------------.-------: X AGAINST | /e\ There is no |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL | """ conspiracy. |
°------------------------------°-------°------------------°--------------------°
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list