regex.c not found, but it clearly exists

Dave Korn
Wed Jan 2 20:59:00 GMT 2008

On 02 January 2008 12:42, Andrew STUBBS wrote:

> NightStrike wrote:
>>> Or you could try "gcc -mno-cygwin" where gcc is the standard Cygwin gcc.
>>> That's a Cygwin program so it understands the POSIX paths, but it
>>> produced MinGW programs (which don't).
>> Are programs compiled in this fashion identical to programs that are
>> compiled with the actual i686-pc-mingw-gcc program?
> Since nobody more qualified has responded ...
> I don't know if they are perfectly identical, but they certainly have
> the same general properties. That is, in order to build a UNIX program
> you have to apply the exact same patches as you would for the MinGW
> compiler.

  This is basically it, but there are some problems.  The -mno-cygwin flag and
the cross-compile mode of the cygming-targeted compiler are somewhat kludgey.
The major purpose for which they are packaged is so that you can rebuild the
cygwin dll itself from within the cygwin environment.  It's not really
intended for general cross-development, and although it'll just about do,
there is a problem: it doesn't correctly switch over /all/ the default search
paths; if you compare the output of "gcc -v -E -xc - < /dev/null" and "gcc
-mno-cygwin -v -E -xc - < /dev/null", you'll see that gcc -mno-cygwin still
searches the cygwin compiler-specific include dir


when it should be looking in:


  I don't know - and couldn't say for sure without doing a thorough audit -
how serious this could be, but from running a very quick diff over it, I can
see that it might in particular affect C++.  (It could easily break passing
std::strings across DLL boundaries, which cygwin has some custom mods to the
c++ stl header files relating to).

> Note that you must have installed the right Cygwin package for it to
> work - it uses a different set of libraries in -mno-cygwin mode.

  Yes, the packages required for -mno-cygwin are w32api and mingw-runtime

Can't think of a witty .sigline today....

More information about the Binutils mailing list