3

I'm trying to set up a build server on Linux which I will use to build C/C++ apps for Windows and Mac. I know that GCC supports a body of different architectures but I can't figure out how to determine targets against which I need to build GCC cross compiler.

Could someone please explain this to me?

Thanks in advance.

P.S. I know that precompiled solutions already exist, but I just want to understand this in detail by making a deep dive.

senx
  • 630
  • 9
  • 18
  • Why don't you just use a few virtual machines to build natively on your target platforms? So much easier than getting cross-compilation working properly (not worth the hassle IMHO). – Jesper Juhl Sep 09 '16 at 17:05
  • @JesperJuhl That is true and I already utilize this approach. However I also want to understand C++ in more detail. – senx Sep 09 '16 at 17:29

1 Answers1

6

On the target machine, run:

gcc -dumpmachine

Then use the result in the --target option when building your cross toolchain.