什么时候应该使用gcc的-m32选项? [英] When should -m32 option of gcc be used?

查看:322
本文介绍了什么时候应该使用gcc的-m32选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个程序,如果我在Suse 10 32位系统上编译而不添加 -m32 选项并在Suse 10 64位上执行它,

在这种情况下,我不需要添加 -m32 选项吗? p>

我们是否可以直接在其64位对应程序上执行构建于32位系统上的程序,而无任何副作用?或者是否需要更新或更改?

解决方案

在64位操作系统上运行32位可执行文件没有问题因为32位动态库存在并被找到)。

-m32是在编译器上编译32位对象的,编译器被配置为默认编译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.

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?

解决方案

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.

这篇关于什么时候应该使用gcc的-m32选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆