首页 > 代码库 > 64位SUSE编译32位程序出错

64位SUSE编译32位程序出错

These `-m’ switches are supported in addition to the above on AMD x86-64 processors in 64-bit environments. 
-m32 
-m64 
-mx32 
Generate code for a 32-bit or 64-bit environment.

  • The -m32 option sets int, long and pointer to 32 bits and generates code that runs on any i386 system.
  • The -m64 option sets int to 32bits and long and pointer to 64 bits and generates code for AMD’s x86-64 architecture.
  • The -mx32 option sets int, long and pointer to 32 bits and generates code for AMD’s x86-64 architecture.

For darwin only the -m64 option turns off the -fno-pic and -mdynamic-no-pic options.

因此在32位 linux  make编译文件的时候  gcc  -g -c 无需带-m32

在x86_64位linux make编译文件的时候   cc -m64 -g -c 是-m64必须带的。

 

可参考

http://blog.csdn.net/yyywill/article/details/54426900

 

64位SUSE编译32位程序出错