This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
compiling gcj 4.0.2 for windows on unbuntu
- From: Andi Vajda <andi at osafoundation dot org>
- To: java at gcc dot gnu dot org
- Cc: Sandro Tolaini <tolaini at libero dot it>
- Date: Fri, 16 Jun 2006 16:38:22 -0700 (PDT)
- Subject: compiling gcj 4.0.2 for windows on unbuntu
- Reply-to: Andi Vajda <andi at osafoundation dot org>
I'm carefully following Ranjit's steps at [1] to build gcj 4.0.2 for Windows
on Ubuntu Dapper Drake (6.06). When compiling the cross-compiler for windows,
I get the error (1) included below.
I installed the 3.9 mingw runtime and the 3.7 w32api archives and I'm using
gcc 3.4.6 to do the build on Ubuntu.
If I create a usr/include directory under ~/gcc/xgcc/sys-root and leave it
empty or copy the /usr/include header files into it (even though Ranjit's
steps don't mention that) I then get conflicts between winsock2.h and time.h
and other such conflicts between windows and linux header files. See error (2)
included below.
What am I missing or doing wrong here ?
Andi..
[1] http://rmathew.com/articles/bldgcj.html
error (1)
-----------------------------------------
echo | /home/vajda/gcc/xbuild/gcc/gcc/xgcc -B/home/vajda/gcc/xbuild/gcc/gcc/ -B/home/vajda/gcc/xgcc/i686-pc-mingw32/bin/ -B/home/vajda/gcc/xgcc/i686-pc-mingw32/lib/ -isystem /home/vajda/gcc/xgcc/i686-pc-mingw32/include -isystem /home/vajda/gcc/xgcc/i686-pc-mingw32/sys-include -E -dM - | \
sed -n 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p ; \
s/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
sort -u > tmp-macro_list
sed: -e expression #1, char 88: unterminated address regex
/bin/sh /home/vajda/gcc/gcc-4.0.2/gcc/../move-if-change tmp-macro_list macro_list
echo timestamp > s-macro_list
The directory that should contain system headers does not exist:
/home/vajda/gcc/xgcc/sys-root/usr/include
make[1]: *** [stmp-fixinc] Error 1
error (2)
-----------------------------------------
/home/vajda/gcc/xbuild/gcc/gcc/xgcc -shared-libgcc -B/home/vajda/gcc/xbuild/gcc/gcc/ -nostdinc++ -L/home/vajda/gcc/xbuild/gcc/i686-pc-mingw32/libstdc++-v3/src -L/home/vajda/gcc/xbuild/gcc/i686-pc-mingw32/libstdc++-v3/src/.libs -B/home/vajda/gcc/xgcc/i686-pc-mingw32/bin/ -B/home/vajda/gcc/xgcc/i686-pc-mingw32/lib/ -isystem /home/vajda/gcc/xgcc/i686-pc-mingw32/include -isystem /home/vajda/gcc/xgcc/i686-pc-mingw32/sys-include -DHAVE_CONFIG_H -I. -I/home/vajda/gcc/gcc-4.0.2/libjava -I./include -I./gcj -I/home/vajda/gcc/gcc-4.0.2/libjava -Iinclude -I/home/vajda/gcc/gcc-4.0.2/libjava/include -I/home/vajda/gcc/gcc-4.0.2/libjava/../boehm-gc/include -I../boehm-gc/include -I/home/vajda/gcc/gcc-4.0.2/libjava/libltdl -I/home/vajda/gcc/gcc-4.0.2/libjava/libltdl -I/home/vajda/gcc/gcc-4.0.2/libjava/.././libjava/../gcc -I/home/vajda/gcc/gcc-4.0.2/libjava/../zlib -I/home/vajda/gcc/gcc-4.0.2/libjava/../libffi/include -I../libffi/include -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -ffloat-store -fno-omit-frame-pointer -I/usr/include -Wextra -Wall -D_GNU_SOURCE -DPREFIX=\"/home/vajda/gcc/xgcc\" -DLIBDIR=\"/home/vajda/gcc/xgcc/lib\" -DJAVA_HOME=\"/home/vajda/gcc/xgcc\" -DBOOT_CLASS_PATH=\"/home/vajda/gcc/xgcc/share/java/libgcj-4.0.2.jar\" -DJAVA_EXT_DIRS=\"/home/vajda/gcc/xgcc/share/java/ext\" -DGCJ_ENDORSED_DIRS=\"/home/vajda/gcc/xgcc/share/java/gcj-endorsed\" -DLIBGCJ_DEFAULT_DATABASE=\"/home/vajda/gcc/xgcc/lib/gcj-4.0.2/classmap.db\" -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.0.2/classmap.db\" -DTOOLEXECLIBDIR=\"/home/vajda/gcc/xgcc/i686-pc-mingw32/lib\" -g -O2 -MT prims.lo -MD -MP -MF .deps/prims.Tpo -c /home/vajda/gcc/gcc-4.0.2/libjava/prims.cc -o prims.o
/usr/include/bits/time.h:69: error: redefinition of 'struct timeval'
/home/vajda/gcc/xgcc/sys-root/mingw/include/winsock2.h:109: error: previous definition of 'struct timeval'
/usr/include/sys/select.h:78: error: conflicting declaration 'typedef struct fd_set fd_set'
/home/vajda/gcc/xgcc/sys-root/mingw/include/winsock2.h:64: error: 'fd_set' has a previous declaration as 'typedef struct fd_set fd_set'
/usr/include/sys/select.h:112: error: declaration of C function 'int select(int, fd_set*, fd_set*, fd_set*, timeval*)' conflicts with
/home/vajda/gcc/xgcc/sys-root/mingw/include/winsock2.h:632: error: previous declaration 'int select(int, fd_set*, fd_set*, fd_set*, const timeval*)' here
/home/vajda/gcc/xgcc/sys-root/mingw/include/io.h:76: error: '__time64_t' does not name a type
/home/vajda/gcc/xgcc/sys-root/mingw/include/io.h:77: error: '__time64_t' does not name a type
/home/vajda/gcc/xgcc/sys-root/mingw/include/io.h:78: error: '__time64_t' does not name a type
/home/vajda/gcc/xgcc/sys-root/mingw/include/io.h:104: error: '__time64_t' does not name a type
/home/vajda/gcc/xgcc/sys-root/mingw/include/io.h:105: error: '__time64_t' does not name a type
/home/vajda/gcc/xgcc/sys-root/mingw/include/io.h:106: error: '__time64_t' does not name a type
/usr/include/unistd.h:243: error: conflicting declaration 'typedef __socklen_t socklen_t'
/home/vajda/gcc/xgcc/sys-root/mingw/include/ws2tcpip.h:272: error: 'socklen_t' has a previous declaration as 'typedef int socklen_t'
/usr/include/unistd.h:290: error: declaration of C function '__off64_t lseek(int, __off64_t, int)' conflicts with
/home/vajda/gcc/xgcc/sys-root/mingw/include/io.h:279: error: previous declaration 'long int lseek(int, long int, int)' here
/usr/include/unistd.h:448: error: declaration of C function 'char* getcwd(char*, size_t)' conflicts with
/home/vajda/gcc/xgcc/sys-root/mingw/include/io.h:161: error: previous declaration 'char* getcwd(char*, int)' here
/usr/include/unistd.h:791: error: declaration of C function 'int gethostname(char*, size_t)' conflicts with
/home/vajda/gcc/xgcc/sys-root/mingw/include/winsock2.h:635: error: previous declaration 'int gethostname(char*, int)' here
make[2]: *** [prims.lo] Error 1
make[2]: Leaving directory `/home/vajda/gcc/xbuild/gcc/i686-pc-mingw32/libjava'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vajda/gcc/xbuild/gcc/i686-pc-mingw32/libjava'
make: *** [all-target-libjava] Error 2