c-urchin
c-urchin

Reputation: 4504

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 experience could comment on what functions (if any) would cause a 32 bit app to be incompatible with a 64 bit OS.

Upvotes: 1

Views: 651

Answers (5)

caf
caf

Reputation: 239041

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.

Upvotes: 1

pankajt
pankajt

Reputation: 7864

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 !

Upvotes: 0

Edward Strange
Edward Strange

Reputation: 40859

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

Upvotes: 1

Yann Ramin
Yann Ramin

Reputation: 33177

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.

Upvotes: 6

bjg
bjg

Reputation: 7477

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

Upvotes: 3

Related Questions