简体   繁体   English

我可以从 32 位 GCC 编译器生成 64 位应用程序二进制文件吗?

[英]Can I generate 64-Bit application binary from a 32-Bit GCC compiler?

I want to understand how a 32-Bit compiler generates 64-Bit binary.我想了解 32 位编译器如何生成 64 位二进制文​​件。 I understand that we pass -m64 flag but should we use 64-Bit GCC compiler to generate 64-Bit binary code?我知道我们通过了 -m64 标志,但是我们应该使用 64 位 GCC 编译器来生成 64 位二进制代码吗?

Two compilers can do precisely the same thing, producing precisely the same output from the same input, so long as they both execute the same algorithms.两个编译器可以做完全相同的事情,从相同的输入产生完全相同的输出,只要它们都执行相同的算法。 Whether they are compiled as 32-bit or 64-bit executables makes no difference to the logic of their execution so long as the limits of 32-bit executables aren't exceeded.只要不超过 32 位可执行文件的限制,它们是否被编译为 32 位或 64 位可执行文件对其执行逻辑没有区别。 Similarly, you can run a compiler on one platform to produce output for a totally different platform because the platform a program runs on has no effect on its internal logic.同样,您可以在一个平台上运行编译器来为完全不同的平台生成输出,因为程序运行的平台对其内部逻辑没有影响。 The output produced depends only on the logic the compiler follows.产生的输出仅取决于编译器遵循的逻辑。

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

相关问题 如何生成64位.dll哪个gcc编译器或其他。无法在AMD 64位平台上加载IA 32位.dll - How to generate 64 bit .dll which gcc compiler or other. Can't load IA 32-bit .dll on a AMD 64-bit platform 从32位和64位二进制文​​件中读取 - Reading from a binary file on 32-bit and 64-bit 无法从 Windows 10 中的 64 位 gcc 兼容 32 位 EXE - Unable to complie for 32-bit EXE from 64-bit gcc in Windows 10 64位和32位整数 - 64-bit and 32-bit integers 使用AssocQueryString从32位应用程序获取64位应用程序命令,但不起作用 - Using AssocQueryString to get 64-bit application command from 32-bit application, but not working "如何从 32 位 C++ 应用程序启动 64 位 Java 应用程序?" - How to start 64-bit Java application from 32-bit C++ application? 是否可以在intel / 64-bit win7上的32位应用程序中使用64位指令 - Is it possible to use 64-bit instruction in a 32-bit application on intel/64-bit win7 从 64 位应用程序加载 32 位共享库? - Load 32-bit shared library from 64-bit application? 从c / c ++应用程序确定32位操作系统还是64位操作系统 - determine 32-bit OS or 64-bit OS from c/c++ application 给定 64 位进程的 PID,如何从 32 位进程获取其可执行路径? - How can I get the executable path of a 64-bit process given its PID from a 32-bit process?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM