tags:

views:

115

answers:

3

Since "gcc -mno-cygwin" does not work anymore, I was looking for a way to get a MinGW-targeted GCC running within my Cygwin environment. (Running a MSYS environment is not an option at this point.)

The Cygwin installer offers a package "gcc-mingw", which installs, among others:

lib/gcc/i686-pc-mingw32/3.4.4/cc1.exe
lib/gcc/i686-pc-mingw32/3.4.4/collect2.exe
lib/gcc/i686-pc-mingw32/3.4.4/crtbegin.o
lib/gcc/i686-pc-mingw32/3.4.4/crtend.o

What is absent is the "gcc" frontend. So, how do I actually invoke this compiler? I hopefully don't have to go through "cc1" manually, have I?

I googled, but couldn't find anything relevant on the subject...

+1  A: 

Cygwin homepage says that "Individual packages like bash, gcc, less, etc. are released independently of the DLL.".

Here you can find how to install gcc under cygwin, so you should also select gcc package during install not only gcc-mingw.

rics
I have installed (among others) gcc, gcc4, and gcc-mingw. My question is how to actually *reach* the MinGW-targeting GCC. "gcc" obviously doesn't do it, "gcc -mno-cygwin" neither, and there is no such thing as a "gcc-mingw".
DevSolar
I see it is not so simple as I first thought. Here (http://cygwin.com/ml/cygwin/2009-10/msg00061.html) I found a possible solution.
rics
I also found this do-it-yourself solution: http://sourceforge.net/apps/trac/mingw-w64/wiki/Cross%20Win32%20and%20Win64%20compiler
rics
A: 

Further searches revealed that the MinGW-targeted cross-compiler is not ready yet, and that one has to either use GCC v3 with -mno-cygwin, or install a cross-compiler manually (see link above)...

DevSolar
+1  A: 

As you already found, you can use gcc-3 with -mno-cygwin. The other possibility is to install the 32-bit and/or 64-bit toolchains from the MinGW-w64 project, which have been packaged for Cygwin very recently and hence are available through setup.exe now. Don't be put off by the rather confusing executable names: i686-w64-mingw32-gcc is the 32-bit compiler and x86_64-w64-mingw32-gcc is the 64-bit one.

ak2
This actually works. Any idea why they keep an apparently non-functional package "gcc-mingw" in there and hide the working stuff as "i686-w64-mingw32-gcc"?
DevSolar
I think the gcc-mingw packages are part of the `gcc-3 -mno-cygwin` functionality. They don't actually contain anything except postinstall scripts that create links which I guess are needed for that. Those funny names follow the usual target triplet pattern for cross-compilers: cpu-vendor-os, with vendor==w64 (for MinGW-w64) and os==mingw32 (for hystorical reasons).
ak2