trying to build a mingw compiler on cygwin

Stephen Smith
Tue Sep 17 09:29:00 GMT 2002

I found the mingw files that I needed to go with the 2.95.2-6 compiler 
source that I have: 

To make sure that I am in compliance with the License (when I 
distribute) I wanted to make sure
that I could duplicate the compiling of the libraries.  Having emailed 
Danny Smith (several times)
I tried building with this script and then am getting the error  shown 
below that. 
Would you have a clue as to the solution to this problem

I have checked the gcc directory and a ./specs file is being built.  I 
am building on a cygwin platform
with all of the packages up to date except for the gcc package which is 
being held constant at version

The script , error trace and spects file are all included in this message.

Stephen Smith

-------------------------- Start of script ------------------------------
#! /bin/sh

set -e

export GCC=`which gcc`
export LD=`which ld`
export AS=`which as`

export CC="${GCC} -mno-cygwin"
export GCC_SRC_LOCATION=../gcc-2.95.2-6

${GCC_SRC_LOCATION}/configure  --with-gcc=${GCC} --with-gnu-ld=${LD} 
--with-gnu-as=${AS} --host=mingw32 --target=mingw32 
--prefix=/htc/mingw32 --enable-threads --disable-nls 
--enable-languages=c,f77,c++,objc --disable-win32-registry --disable-shared

make bootstrap
make -k check

---------------------------  Error log --------------------------------
for name in _chkstk; \
do \
echo ${name}; \
./xgcc -B/htc/mingw32/mingw32/bin/ -B./ -I/htc/mingw32/mingw32/include 
-O2 -I../../gcc-2.95.2-6/gcc/../winsup/include
-DIN_GCC     -g -I./include   -g1 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 
-D__GCC_FLOAT_NOT_NEEDED   -I. -I../../gcc-2.95.2-6/
gcc -I../../gcc-2.95.2-6/gcc/config -I../../gcc-2.95.2-6/gcc/../include 
-c -DL${name} libgcc1.S; \
if [ $? -eq 0 ] ; then true; else exit 1; fi; \
mv libgcc1.o ${name}.o; \
` if [ -f /htc/temp/builddir/gcc/../binutils/ar ] ; then echo 
/htc/temp/builddir/gcc/../binutils/ar ; else if [ "i386-
unknown-mingw32" = "i386-unknown-mingw32" ] ; then echo ar; else 
t='s,x,x,'; echo ar | sed -e $t ; fi; fi` rc tmplibgcc1
.a ${name}.o; \
rm -f ${name}.o; \
xgcc.exe: specs file malformed after 2 characters
make[2]: *** [libgcc1-asm.a] Error 1
make[2]: Leaving directory `/htc/temp/builddir/gcc'
make[1]: *** [bootstrap] Error 2
make[1]: Leaving directory `/htc/temp/builddir/gcc'
make: *** [bootstrap] Error 2

---------------------------  Specs file --------------------------------


-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}




%{mwindows:--subsystem windows}                    
%{mconsole:--subsystem console}                    %{shared: %{mdll: 
%eshared and mdll are not compatible}}                    %{shared: 
--shared} %{mdll:--dll}                    %{shared|mdll: -e 

%{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32}                   -luser32 
-lkernel32 -ladvapi32 -lshell32

%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lcrtdll

%{shared|mdll:dllcrt1%O%s} %{!shared: %{!mdll:crt1%O%s}} %{pg:gcrt1%O%s}



-Di386 -D_WIN32 -DWIN32 -D__WIN32__   -D__MINGW32__=0.2 -DWINNT  
-D_X86_=1 -D__STDC__=1  -D__stdcall=__attribute__((__stdcall__))   
-D__declspec(x)=__attribute__((x))   -Asystem(winnt) -Acpu(i386) 



. ;





%{!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 


-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*: %{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*}           

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list