当前位置: 技术问答>linux和unix
64位的gcc能否编译出32位的程序?
来源: 互联网 发布时间:2015-12-12
本文导语: 我的gcc是4.10版的,默认情况下编译出来的是64位程序。可我现在需要编译出32位的,是否加上某个选项后就可以达到目的了? 谢谢 | 没试过,试一下 -m32: These -m switches are supported in additio...
我的gcc是4.10版的,默认情况下编译出来的是64位程序。可我现在需要编译出32位的,是否加上某个选项后就可以达到目的了?
谢谢
谢谢
|
没试过,试一下 -m32:
These -m switches are supported in addition to the above on AMD x86-64 processors in 64-bit environments.
-m32, -m64
Generate code for a 32-bit or 64-bit environment. The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any i386 system. The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and generates code for AMD's x86-64 architecture.
These -m switches are supported in addition to the above on AMD x86-64 processors in 64-bit environments.
-m32, -m64
Generate code for a 32-bit or 64-bit environment. The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any i386 system. The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and generates code for AMD's x86-64 architecture.