bgroenks
bgroenks

Reputation: 1889

Cross Compiling On Windows?

I have the GNU GCC compiler for Windows. I read that it is able to function as a cross compiler.

How do I do this? What command option(s) will produce an shared library that can be used by MacOS/Linux platforms?

Upvotes: 2

Views: 451

Answers (1)

Kerrek SB
Kerrek SB

Reputation: 477640

You need to build your own cross-compiler, i.e. you need to get the GCC sources and compile them with a desired target-architecture. Then you have to cross-compile all the libraries.

The process is fairly involved and lengthy. The usual GNU makefiles are pretty good at supporting this (through HOST, BUILD and ARCH variables), but if possible you should leave this to a higher-level abstraction. crosstool is one such tool that comes to mind, but I don't know if it's available for Windows.

It's possible that you'll be able to find pre-build Windows binaries of GCC on the internet that target a particular architecture.

Upvotes: 2

Related Questions