It seems that most 32 bit applications will run on 64 bit linux assuming all the 32 bit libraries are present. But it seems to me there could be issues with architecture-dependent functions, and here I'm thinking of signals and setjmp/longjmp. I'm wondering if someone with greater experience could comment on what functions (if any) would cause a 32 bit app to be incompatible with a 64 bit OS.
The biggest issue for 32-bit applications running on 64-bit systems would be where programers mistakenly make assumptions about integer or pointer lengths and subsequently do non-portable things with them. There's a pretty good overview of the issues for C/C++ programmers to consider in this article by Sun
Even setjmp
and longjmp
should work correctly. There are no particular issues, from a user space application, which would present any issues. The actual 32bit emulation is done by the processor. System calls are the interface back to the 64bit kernel, which Linux correctly handles.
If the application was evil, and sent executable code to another 64bit process to execute, then various things would break.
If Linux is compiled without 32bit legacy support your 32bit program won't function very well.
Let's take an example of 32 bit application which has a main module and loads a 32 bit dependent dll. If you are migrating both the main module as well as the 32 bit dependent dll, the application works fine on a 64 bit machine. But in case if you migrate only the main module, it will not be able to load 64 bit dependent dll from the 64 bit machine even if present. The reasons being -
Different alignment in memory of the data
Differences in the data type size
Please refer:
http://dev-faqs.blogspot.com/2008/03/accessing-32-bit-dlls-from-64-bit-code_02.html
Probably this is what you are looking for !
There really only two issues that arise with running 32 bit applications under 64 bit Linux, assuming you have the necessary 32 bit libraries:
Some
ioctl()
s for lesser-used drivers do not work correctly when used by a 32 bit user process on a 64 bit kernel;Applications that have hardcoded
/usr/lib
and/or/lib
paths to search for dynamic libraries won't work if the 32 bit libraries are located elsewhere.