New gcc/binutils available for testing

Dale Goudey
Thu Jun 15 20:00:00 GMT 2000

I have used the new binutils/gcc, testing not complete by any means but it
looks good so far (after some fixes are applied).  Builds are still ongoing.

fixes required:

1.  default library search path is broken, it still seems to be
     looking in /usr/i686-pc-cygwin/lib
     The workaround is to define the LIBRARY_PATH environment variable to
2.  For true mingw support (is there such a thing?), you will need to
install the complete
     mingw header/library set and modify the specs file (see below).

>>Chris Faylor wrote:
>>> Oops.  It looks like I had an environment variable set from an ancient
>>> version of CYGWIN -- LIBRARY_PATH.  If you set that to /usr/lib it
>>> seems to find things correctly.
>>OK, I gave this a try and trivial programs compile correctly.

Works for me too

>Yup.  Sorry.  I see why this is happening.  I'll fix it.
>>However, when "-mno-cygwin" is used, it doesn't find any of the standard
>>header files (stdio.h, windows.h, etc.).  I have attached output from "gcc
>>-v" .
>>Also, it i linking with both crtdll.dll and msvcrt.dll.  Programs should
>>linked against one or the other, but not both.  msvcrt.dll is preferred
>>because it is more stable and better tested.
>I just blindly followed the specs file that was in the URL that I quoted.
>I thought I saw positive comments about this.

The specs file requires that the mingw headers are used when the mingw
libraries are used.  If they are not installed, you will get an error
message.  This is by design.  To do otherwise is INCORRECT, since the
headers must remain consistent with the libraries.  Hope this is clear.

But this means that the complete libraries/headers must be installed in the
proper locations.  Since these files were never part of the regular cygwin
package (though I thing they should be), they must be obtained separately.

retrieve from
retrieve  from

I really don't know if these files are "officially" the latest, but they do
work well for me.

Install as described below (repeating my previous note with modifications
for the new gcc), and use the specs file attached here (rather than the
previous one posted).  To see where the specs file belongs, do a gcc -v

Note that with this configuration we can use the cygwin toolset with
optionally the cygwin or the mingw libraries.  The above mingw complications
are not necessary for cygwin builds only.  For those who need to build for
both (such as myself), this seems to be the best setup.

>Anyway, I'll remove the crtdll entry, though.  It looks like I should
>have been more discerning with a few other entries, too.


A note for Chris:  the enclosed specs file has some VERY MINOR mods so that
it works correctly with the latest mingw libraries (I think).  Thanks for
your update.  This cygwin package is really quite good, but "early adopters"
must understand that this is a work-in-progress.  Well, maybe they need
reminding on occasion.

Further notes on installing the mingw headers/libraries

      (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 created)
    This gives you /usr/mingw/include/g++-3
       and use the files i386-mingw32msvc/include/*.h therein by moving or
       copying them into /usr/mingw/include

   unpack into an empty directory
   move or copy the resulting i386-mingw32msvc directory into /usr
     this gives you /usr/i386-mingw32msvc
   move or copy the resulting bin/mingwm10.dll file into /bin
   copy the files
   from the i386-mingw32msvc/lib directory
   into /usr/lib (or into  /usr/i686-pc-cygwin/lib if you are using
gcc-2.95.2-1 rather than -2)

As usual, no warranties
Hope this helps
Dale Goudey

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


-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE}   %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ -Dunix}   %{!mno-win32:-D_WIN32 -DWINNT}   %{mno-cygwin:-DWIN32 -D__WIN32__ -D__MSVCRT__ -D__MINGW32__=0.2}   %{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}   %{static:-Bstatic} %{!static:-Bdynamic}   %{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_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