Is -mno-cygwin support being removed????

Dale Goudey
Tue Jun 13 21:11:00 GMT 2000

-mno-cygwin works just fine (for me) with cygwin 1.1.2, but additional
headers and run-time libraries are needed.  Its best to custom craft a specs
file for the compiler to do this.  Its not as simple as adding a -I
directive and a -L directive.  Something like the attached specs file would
work, but only if the headers and libraries from the mingw distribution
(latest, 27 March version) are installed where the specs file expects them.
Note that in the specs file I disable searching through the "standard system
include directories", as is needed to avoid mixing mingw and cygwin headers.
I know of no such protection from the library search paths other than making
sure that the mingw libraries are found first, and then checking that the
resulting executable does not refer to the undesired DLL's.

With the right specs file, 1.1.2 seems to work find for what I have tried
(C, C++, fortran).  No warranties.  The enclosed specs file is a bit of a
hack, and some of the hacks may break for future releases of gcc/cygwin.
There is no good definition/specification for the specs file that I am aware
of other than the source code, so I assume that the specs file is fair game
for reformatting with each revision of the compiler.

I use the following mingw packages
      (use the lib/gcc-lib/i386-mingw32msvc therein by moving or copying
       it into /usr/lib/gcc-lib to make it parallel to
                  (this gives you /usr/lib/gcc-lib/i386-mingw32msvc)

       use the include/g++-3 therein by moving or copying it
       into /usr/mingw/include                 (this directory must be

       and use the files i386-mingw32msvc/include/*.h therein by moving or
       copying them into /usr/mingw/include
      (unpacking under /usr, and then
           from a true MSDOS shell (using or, go into
           If you see a single file called mingwm10.dll move it to /bin
       You must then also undo some damage to the file structure caused by
       unpack by going into the /usr directory and remove the undesired bin
               rd bin
       You may now exit the MSDOS shell.
       from a cygwin shell (like an rxvt window)
             cp -a /usr/i386-mingw32msvc/lib/*.o /usr/i686-pc-cygwin/lib

It works for me.  100k lines of C/C++/fortran do just fine.

I expect that the above hacks will be unnecessary and probably broken when
Mumit Khan  returns to the scene.

Hope this helps.
Dale Goudey

-------------- next part --------------


-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE}   %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__}   %{mthreads: %{mno-cygwin:-D_MT}} %{mno-cygwin:-nostdinc -nostdinc++}  %{mno-cygwin:-iwithprefixbefore     ../../../../mingw/include/g++-3 } %{mno-cygwin:-iwithprefixbefore     ../../../../i386-mingw32msvc/include/mingw32 }  %{mno-cygwin:-iwithprefixbefore     ../../../../mingw/include }  %{mno-cygwin:-iwithprefixbefore     ../../../../i386-mingw32msvc/include }  %{mno-cygwin:-iwithprefixbefore    ../../i386-mingw32msvc/2.95.2/include } 




%{mwindows:--subsystem windows} 		   %{mconsole:--subsystem console} 		   %{shared: %{mdll: %eshared and mdll are not compatible}} 		   %{shared: --shared} %{mdll:--dll} 		   %{shared|mdll: -e 		     %{mno-cygwin:_DllMainCRTStartup@12} 		     %{!mno-cygwin:__cygwin_dll_entry@12}}

%{pg:-lgmon} 		  %{!mno-cygwin:-lcygwin} 		  %{mthreads:%{mno-cygwin:-lmingwthrd}} 		  %{mno-cygwin:-lmingw32 -lmoldname -lcrtdll} 		  %{mwindows:-lgdi32 -lcomdlg32} 		  -luser32 -lkernel32 -ladvapi32 -lshell32

%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} -lgcc %{mno-cygwin: -lmoldname -lmsvcrt}

%{shared|mdll: %{mno-cygwin:dllcrt2%O%s}}   %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} %{mno-cygwin:crt2%O%s}   %{pg:gcrt2%O%s}}}



-Di386 -D_WIN32 %{mno-cygwin:-DWIN32 -D__WIN32__ -D__MSVCRT__ -D__MINGW32__=0.2} -DWINNT  -D_X86_=1 -D__STDC__=1  -D__stdcall=__attribute__((__stdcall__))   -D__cdecl=__attribute__((__cdecl__))   -D__declspec(x)=__attribute__((x))   -Asystem(winnt) -Acpu(i386) -Amachine(i386)



. ;




collect2 %{mno-cygwin:-L/usr/lib/gcc-lib/i386-mingw32msvc/2.95.2 -L/usr/i386-mingw32msvc/lib}

%{!ansi:-Di486} -D__i486 -D__i486__

%{!ansi:-Di586 -Dpentium} 	-D__i586 -D__i586__ -D__pentium -D__pentium__

%{!ansi:-Di586 -Dk6} 	-D__i586 -D__i586__ -D__k6 -D__k6__

%{!ansi:-Di686 -Dpentiumpro} 	-D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__


-Acpu(i386) -Amachine(i386) %{!ansi:-Di386} -D__i386 -D__i386__ %{mcpu=i486:%(cpp_486)} %{m486:%(cpp_486)} %{mpentium:%(cpp_586)} %{mcpu=pentium:%(cpp_586)} %{mpentiumpro:%(cpp_686)} %{mcpu=pentiumpro:%(cpp_686)} %{mcpu=k6:%(cpp_k6)} %{!mcpu*:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}

%{!mcpu*: %{m386:-mcpu=i386 -march=i386} %{m486:-mcpu=i486 -march=i486} %{mpentium:-mcpu=pentium} %{mpentiumpro:-mcpu=pentiumpro}}


%{!fsyntax-only:  %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} 			%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}			%{!A:%{!nostdlib:%{!nostartfiles:%S}}}			%{static:} %{L*} %D %o			%{!nostdlib:%{!nodefaultlibs:%G %L %G}}			%{!A:%{!nostdlib:%{!nostartfiles:%E}}}			%{T*}			

More information about the Cygwin mailing list