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?
When you invoke GCC, it normally does preprocessing, compilation, assembly and linking. The "overall options" allow you to stop this process at an intermediate stage. For example, the -c option says not to run the linker. Then the output consists of object files output by the assembler.
The different options of gcc command allow the user to stop the compilation process at different stages. Most Useful Options with Examples: Here source. c is the C program code file. -o opt: This will compile the source.
The / compiler option is used to turn on directives and specify constants. By adding this compile switch, you turn on the directive (or off, if the directive is preceded by NO).
If you only want some of the stages of compilation, you can use -x (or filename suffixes) to tell gcc where to start, and one of the options -c , -S , or -E to say where gcc is to stop. Note that some combinations (for example, ' -x cpp-output -E ') instruct gcc to do nothing at all.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With