GCC 4.2.2 with -mno-cygwin

Brian Dessent brian@dessent.net
Sat Nov 3 16:17:00 GMT 2007

n.torrey.pines@gmail.com wrote:

> I compiled and installed GCC 4.2.2 in /usr/local seemingly
> successfully. However, using -mno-cygwin, I get an error:
> $ gcc -mno-cygwin hello_world.c
> gcc: error trying to exec 'cc1': execvp: No such file or directory
> Indeed, /usr/local/lib/gcc/i686-pc-mingw32 is missing altogether, and
> /usr/local/lib/gcc/i686-pc-cygwin/4.2.2/ does not contain cc1.
> Should I have taken some special steps during the configuration to
> enable -mno-cygwin? I couldn't find any information about this.

Yes, you need to do a fair amount of extra work in order to get
-mno-cygwin to work.

- You'll need the various target libraries (libgcc, libstdc++,
libsupc++, libgfortran, libgomp, libada, libgcj, etc.) of the same
version of gcc (and same configure options) built for MinGW and put in
the $libexecdir/gcc/$target/$version (assuming you used
--enable-version-specific-runtime-libraries, otherwise without

- You'll need symlinks for $tooldir/include, $tooldir/lib, and
$tooldir/bin (where $tooldir defaults to $prefix/$target) as well as for
the compiler subexecutables in $libexecdir/gcc/$target/$version pointing
to the Cygwin ones.

The best way to go is look at the packaged version of gcc and see how
it's done.

All in all I think it would be a lot simpler just to build a straight
MinGW cross compiler.  Then you'd just use "i686-pc-mingw32-gcc" instead
of "gcc -mno-cygwin".  And in fact this is the eventual plan as this
-mno-cygwin "fake/pseudo cross-compiler" thing is really the wrong way.


Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

More information about the Cygwin mailing list