开发者

what could make 32 bit app incompatible with 64 bit linux OS?

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 experienc开发者_运维百科e could comment on what functions (if any) would cause a 32 bit app to be incompatible with a 64 bit OS.


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.


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


If Linux is compiled without 32bit legacy support your 32bit program won't function very well.


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.


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 -

  1. Different alignment in memory of the data

  2. 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

http://dnjonline.com/article.aspx?ID=jun07_access3264

Probably this is what you are looking for !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜