This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Build errors - target i386-pc-mingw32
- To: gcc at gcc dot gnu dot org
- Subject: Build errors - target i386-pc-mingw32
- From: Casper Hornstrup <chorns at users dot sourceforge dot net>
- Date: Tue, 25 Sep 2001 23:04:02 +0200
Hi all.
I've been trying to compile a cross compiler (mingw) on linux and run into
problems.
Please tell me if I doing this wrong.
I configure binutils (current cvs version) with:
configure --prefix=/usr/local/cross-tools --target=i386-pc-mingw32 -v
I put the cross compiler in the path with:
export PATH="$PATH:/usr/local/cross-tools/bin"
I copy mingw runtime include files:
cp -R mingw-runtime/include /usr/local/cross-tools/i386-mingw32/include
I configure gcc (current cvs version) with:
configure --prefix=/usr/local/cross-tools --target=i386-pc-mingw32 -v
NOTE: I use optabs.c revision 1.110 due to a bug in revision 1.111 as
previously noted on this list.
The error I get when doing "make", is the following:
...
make GCC_FOR_TARGET="/home/cvs/gcc/build/gcc/xgcc -B/home/cvs/gcc/build/gcc/
-B/usr/local/cross-tools/i386-pc-mingw32/bin/
-B/usr/local/cross-tools/i386-pc-mingw32/lib/ -isystem
/usr/local/cross-tools/i386-pc-mingw32/include" \
HOST_PREFIX="" HOST_PREFIX_1="loser-" \
AR_FOR_TARGET="i386-pc-mingw32-ar" \
AR_CREATE_FOR_TARGET="i386-pc-mingw32-ar rc" \
AR_FLAGS_FOR_TARGET="" \
CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long" \
RANLIB_FOR_TARGET="i386-pc-mingw32-ranlib" \
RANLIB_TEST_FOR_TARGET="[ -f i386-pc-mingw32-ranlib ] || ( [
"i686-pc-linux-gnu" = "i386-pc-mingw32" ] && [ -f /usr/bin/ranlib -o -f
/bin/ranlib ] )" \
NM_FOR_TARGET="/usr/local/cross-tools/i386-pc-mingw32/bin/nm" AWK="gawk" \
LIBGCC2_CFLAGS="-O2 -I../../gcc/../winsup/include
-I../../gcc/../winsup/cygwin/include -I../../gcc/../winsup/w32api/include
-DCROSS_COMPILE -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -isystem ./include -g1 -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc" \
INCLUDES="-I. -I. -I../../gcc -I../../gcc/. -I../../gcc/config
-I../../gcc/../include" \
CONFIG_H="tconfig.h " MACHMODE_H="machmode.h machmode.def" \
LIB1ASMSRC='i386/cygwin.asm' \
MAKEOVERRIDES= \
-f libgcc.mk all
make[2]: Entering directory `/home/cvs/gcc/build/gcc'
for d in libgcc; do \
if [ -d $d ]; then true; else /bin/sh ../../gcc/mkinstalldirs $d; fi \
done
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
/home/cvs/gcc/build/gcc/xgcc -B/home/cvs/gcc/build/gcc/
-B/usr/local/cross-tools/i386-pc-mingw32/bin/
-B/usr/local/cross-tools/i386-pc-mingw32/lib/ -isystem
/usr/local/cross-tools/i386-pc-mingw32/include
-O2 -I../../gcc/../winsup/include -I../../gcc/../winsup/cygwin/include
-I../../gcc/../winsup/w32api/include -DCROSS_COMPILE -DIN_GCC -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include
-g1 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc
-I../../gcc/. -I../../gcc/config -I../../gcc/../include -DL_muldi3 -c
../../gcc/libgcc2.c -o libgcc/./_muldi3.o
In file included from ../../gcc/config/i386/cygwin.h:31,
from ../../gcc/config/i386/mingw32.h:25,
from tconfig.h:4,
from ../../gcc/libgcc2.c:36:
/usr/local/cross-tools/i386-pc-mingw32/include/stdio.h:172: wrong number of
arguments specified for `dllimport' attribute
make[2]: *** [libgcc/./_muldi3.o] Error 1
make[2]: Leaving directory `/home/cvs/gcc/build/gcc'
make[1]: *** [libgcc.a] Error 2
make[1]: Leaving directory `/home/cvs/gcc/build/gcc'
make: *** [all-gcc] Error 2
Line 172 is like this:
__MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */
And __MINGW_IMPORT is defined:
...
# ifdef __declspec
/* note the extern at the end. This is needed to work around GCC's
limitations in handling dllimport attribute. */
# define __MINGW_IMPORT __attribute__((dllimport)) extern
# define __DECLSPEC_SUPPORTED
...
Now, just to see what would happen, I changed
# ifdef __declspec
to
# ifndef __declspec
and the build process would go further, but then I got another error:
checking whether the C compiler (/home/cvs/gcc/build/gcc/xgcc
-B/home/cvs/gcc/build/gcc/ -B/usr/local/cross-tools/i386-pc-mingw32/bin/
-B/usr/local/cross-tools/i386-pc-mingw32/lib/ -isystem
/usr/local/cross-tools/i386-pc-mingw32/include -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot
create executables.
make: *** [configure-target-libiberty] Error 1
- Casper