在 2021-01-11 22:43, LRN 写道:
On 11.01.2021 17:07, Liu Hao wrote:

You invoked `i686-w64-mingw32-gcc` on your machine (the 'host'), which produced 
a.exe suitable for
Windows on i686 (the 'target'). `x86_64-w64-mingw32-gcc` is similar.

Actually, if you want to be pedantic, his machine is 'build', and 'a.exe' is produced to be run on 'host'. The 'target' is only used for compilers (if 'a.exe' is a compiler, then it would produce code for 'target', which might not be the same as 'build' and 'host').



If you build 'a.exe' with the GNU build system, then:

  'build' is this macOS, and can usually be guessed, and
  'host' is where 'a.exe' will run, and is typically specified by `--host=`, and
  'target' is meaningless for something not a compiler.


For the 'i686-w64-mingw32-gcc' program:

  'build' is unknown, and
  'host' is this macOS, and
  'target' is where 'a.exe' will run.


The rule of thumb is that `--host=` is usually the only option required to cross-compile something (cross-compiling a compiler would require an addition `--target=`). The compiler is not different from this point of view.


--
Best regards,
LH_Mouse

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to