简体   繁体   English

什么时候应该使用gcc的-m32选项?

[英]When should -m32 option of gcc be used?

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. 我正在编写一个程序,如果我在Suse 10 32位系统上编译而不添加-m32选项并在Suse 10 64位上执行它,它工作正常。

In this case, is it not required for me to add the -m32 option? 在这种情况下,我不需要添加-m32选项吗?

Can we execute programs built on 32-bit systems directly on their 64-bit counterparts without any side-effects? 我们是否可以直接在64位系统上执行基于32位系统的程序而没有任何副作用? Or are there any updates or changes required? 或者是否需要更新或更改?

There is no problems in running 32 bits executables on 64 bit OS (as long as 32 bit dynamic libraries are present and found). 在64位操作系统上运行32位可执行文件没有问题(只要存在并找到32位动态库)。

-m32 is there to compile 32 bits objects on a compiler configured to compile 64 bits objects by default. -m32用于在编译器上编译32位对象,默认情况下配置为编译64位对象。

只要操作系统支持64位操作系统上的32位和64位程序(提示:并非所有操作,例如OpenBSD),只要您具有所有32位依赖项,就不应该遇到任何问题。 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM