search

Home  >  Q&A  >  body text

c++ - 在gcc中同时使用“-arch i386”和"-arch x86_64"是什么意思?

难道编译出来的结果同时支持x86和x64么

阿神阿神2806 days ago557

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:20:42

    I don’t know gcc, but let’s analyze it from a CPU perspective:

    i386 is the name of Intel's earlier 32-bit processor. It is in the same series as i486, i586, etc. This series is also called x86. And it maintains the backward compatibility feature of 486 being compatible with 386. Specifying i386 can achieve the widest compatibility with 32-bit processors

    But Intel lost to AMD in 64-bit processors. AMD took the lead in launching a 32-bit compatible 64-bit processor based on x86, and it gained market recognition and was called amd64. Since this 64-bit processor can also run in 32-bit mode, it is also called x86-64.

    has actually only developed into two commonly used standards so far, one is Intel's 32-bit standard x86, and the other is AMD's 64-bit standard amd64 (although amd64 is also developed from x86 ).

    Of course Intel also has its own 64-bit standard called IA-64, which is the Itanium processor.

    Based on my understanding, to answer your question:
    i386The target CPU platform of the compiled program can only be 32-bit compatible
    x86-64The target CPU platform of the compiled program can only be 64-bit compatible

    The above analysis is only my personal understanding, please correct me if there is anything wrong.

    reply
    0
  • Cancelreply