This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

error building linux --> mingw32 C++ cross-compiler



For several months I've been tying to build a
linux-->mingw32 C++ cross-compiler.  

My build/host machine is gcc-2.96 (RH 7.1).  I am
trying to build cross-versions of binutils-2.11 and
gcc-3.0.2 (binutils appears to have worked).

I've gotten the same errors building gcc-2.96,
gcc-3.0.1, and now for gcc-3.0.2.

The errors come when building libstdc++.

The first error has to do with ctype_base.h trying to
use unknown symbols.  It defines upper = _U, 
lower = _L, etc where _U and _L are undefined.
Looking at my mingw ctype.h, I see definitions for
_UPPER, _LOWER, not _U and _L.

Attempting to hack a fix, I change all _U to _UPPER,
all _L to _LOWER, all _S to _SPACE, etc in
ctype_base.h, and include my mingw32 file
(this may be dumb).

The compilation proceeds a little further, but stops
again with errors from ctype_nonlinline.h.  Some time
ago I hacked past this point, but just got more errors
afterward.

As is apparently necessary, I copied the latest
mingw32 headers and runtime libs to the appropriate
location.

Here is my build script:

#!/bin/sh

mkdir -p /usr/local/cross-tools/i686-mingw32/ && \
cp -r ./mingw32/include
/usr/local/cross-tools/i686-mingw32 && \
cp -r ./mingw32/lib
/usr/local/cross-tools/i686-mingw32 && \
export PATH=/usr/local/cross-tools/bin:${PATH} && \
rm -rf ./build-binutils ./build-gcc && \
mkdir ./build-binutils ./build-gcc && \
cd ./build-binutils && \
../src-binutils/configure
--prefix=/usr/local/cross-tools
--with-mingw32 --build=i686-linux-gnu
--host=i686-linux-gnu
--target=i686-mingw32 && \
make installdirs && \
make -j2 all && \
make install && \
cd .. && \
cd ./build-gcc && \
../src-gcc/configure --prefix=/usr/local/cross-tools
--with-mingw32
--build=i686-linux-gnu --host=i686-linux-gnu
--target=i686-mingw32
--enable-languages=c,c++,f77 && \
make installdirs && \
make -j2 all && \
make install && \
echo "finished successfully."

The first error occurs during compilation with xgcc
(which I assume is some sort of bootstrapping):

Making all in src
make[3]: Entering directory
`/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/src'
/bin/sh ../libtool --tag CXX --mode=compile
/home/sykes/work/cross/build-gcc/gcc/xgcc
-B/home/sykes/work/cross/build-gcc/gcc/ -nostdinc++ 
-L/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/src
-L/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/src/.libs
-B/usr/local/cross-tools/i686-mingw32/bin/
-B/usr/local/cross-tools/i686-mingw32/lib/ -isystem
/usr/local/cross-tools/i686-mingw32/include
-nostdinc++      
-I/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32
-I/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include

-I../../../../src-gcc/libstdc++-v3/libsupc++ 
-I../../../../src-gcc/libstdc++-v3/libmath       
-I/usr/local/cross-tools/include                 -g
-O2
-fno-implicit-templates                 -Wall
-Wno-format -W
-Wwrite-strings -Winline 
-fdiagnostics-show-location=once            
    -g    -c basic_file.cc
/home/sykes/work/cross/build-gcc/gcc/xgcc
-B/home/sykes/work/cross/build-gcc/gcc/ -nostdinc++
-L/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/src
-L/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/src/.libs
-B/usr/local/cross-tools/i686-mingw32/bin/
-B/usr/local/cross-tools/i686-mingw32/lib/ -isystem
/usr/local/cross-tools/i686-mingw32/include
-nostdinc++
-I/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32
-I/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include
-I../../../../src-gcc/libstdc++-v3/libsupc++
-I../../../../src-gcc/libstdc++-v3/libmath
-I/usr/local/cross-tools/include -g -O2
-fno-implicit-templates -Wall
-Wno-format -W -Wwrite-strings -Winline
-fdiagnostics-show-location=once -g -c basic_file.cc
-o basic_file.o
In file included from
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/bits/locale_facets.h:53,
                 from
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/bits/basic_ios.h:36,
                 from
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/bits/std_ios.h:46,
                 from
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/bits/basic_file.h:40,
                 from basic_file.cc:34:
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:46:
`_U'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:47:
`_L'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:48:
`_U'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:48:
`_L'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:49:
`_N'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:50:
`_X'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:50:
`_N'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:51:
`_S'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:52:
`_P'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:52:
`_U'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:52:
`_L'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:52:
`_N'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:52:
`_B'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:53:
`_P'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:53:
`_U'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:53:
`_L'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:53:
`_N'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:54:
`_C'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:55:
`_P'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:56:
`_U'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:56:
`_L'
   was not declared in this scope
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_base.h:56:
`_N'
   was not declared in this scope
make[3]: *** [basic_file.lo] Error 1
make[3]: Leaving directory
`/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory
`/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3'
make: *** [all-target-libstdc++-v3] Error 2

After hacking a "fix" as described above, my next
error is:

/home/sykes/work/cross/build-gcc/gcc/xgcc
-B/home/sykes/work/cross/build-gcc/gcc/ -nostdinc++
-L/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/src
-L/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/src/.libs
-B/usr/local/cross-tools/i686-mingw32/bin/
-B/usr/local/cross-tools/i686-mingw32/lib/ -isystem
/usr/local/cross-tools/i686-mingw32/include
-nostdinc++
-I/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32
-I/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include
-I../../../../src-gcc/libstdc++-v3/libsupc++
-I../../../../src-gcc/libstdc++-v3/libmath
-I/usr/local/cross-tools/include -g -O2
-fno-implicit-templates -Wall
-Wno-format -W -Wwrite-strings -Winline
-fdiagnostics-show-location=once -g -c
../../../../src-gcc/libstdc++-v3/src/locale.cc -o
locale.o
In file included from
../../../../src-gcc/libstdc++-v3/src/locale.cc:557:
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_noninline.h:
In
   constructor `std::ctype<char>::ctype(const char*,
bool, unsigned
int)':
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_noninline.h:39:
`_ctype_'
   undeclared (first use this function)
/home/sykes/work/cross/build-gcc/i686-mingw32/libstdc++-v3/include/i686-mingw32/bits/ctype_noninline.h:39:
(Each
   undeclared identifier is reported only once for
each function it
appears
   in.)

I would LOVE to get this C++ cross-compiler working.

Any help is greatly appreciated.

--Matt


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]