30

I am writing a program which if I compile on a Suse 10 32-bit system without adding the -m32 option and execute it on Suse 10 64-bit, it works fine.

In this case, is it not required for me to add the -m32 option?

Can we execute programs built on 32-bit systems directly on their 64-bit counterparts without any side-effects? Or are there any updates or changes required?

Kevdog777
  • 860
  • 6
  • 18
  • 42
Jay
  • 23,225
  • 23
  • 88
  • 135

2 Answers2

36

There is no problems in running 32 bits executables on 64 bit OS (as long as 32 bit dynamic libraries are present and found).

-m32 is there to compile 32 bits objects on a compiler configured to compile 64 bits objects by default.

AProgrammer
  • 49,582
  • 8
  • 87
  • 140
11

As long as the OS supports both 32bit and 64bit programs (hint: not all do, such as OpenBSD) on a 64bit OS, then you shouldn't have any kind of problems as long as you have all of the 32bit dependencies for it..

Earlz
  • 59,859
  • 94
  • 288
  • 489