什么时候应该使用 gcc 的 -m32 选项? [英] When should -m32 option of gcc be used?
问题描述
我正在编写一个程序,如果我在 Suse 10 32 位系统上编译而不添加 -m32
选项并在 Suse 10 64 位系统上执行它,它可以正常工作.
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.
这种情况,是不是我不需要添加-m32
选项?
In this case, is it not required for me to add the -m32
option?
我们能否直接在 64 位系统上执行在 32 位系统上构建的程序而没有任何副作用?或者是否需要更新或更改?
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?
推荐答案
在 64 位操作系统上运行 32 位可执行文件没有问题(只要存在并找到 32 位动态库).
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 用于在配置为默认编译 64 位对象的编译器上编译 32 位对象.
-m32 is there to compile 32 bits objects on a compiler configured to compile 64 bits objects by default.
这篇关于什么时候应该使用 gcc 的 -m32 选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!