Linux Build/Host Cross-Compiler For Cygwin Target

Lee, Preston Preston.Lee@specastro.com
Wed Dec 3 19:27:00 GMT 2003


I was missing the libraries from the target system. (Thanks Ram) I've copied the include and lib directories on the cygwin machine (/usr/include, /usr/lib, and /lib) into /usr/local/i686-pc-cygwin on my Linux machine per the instructions, and recompiled and installed binutils (using the '--target=i686-pc-cygwin' option during the ./configure ). On to the next problem...

I now get a different error during the GCC make,

--BEGIN ERROR--
cp ada/xgnatug.adb ada/doctools
cd ada/doctools && gnatmake -q xgnatug
gnatbind: Cannot find: s-stalib.ali
gnatmake: *** bind failed.
make[1]: *** [ada/doctools/xgnatug] Error 4
make[1]: Leaving directory `/home/preston/bin/cross-compiler-cygwin/gcc-3.3.1/gcc'
make: *** [all-gcc] Error 2
--END ERROR--

I tried issuing the gnatmake command manually in that directory, and it fails every time with the same message. All I've been able to gather is to make sure the gnatbind and gnatmake programs are accessable, which they are.

I don't use ada so I can live without it if necessary. (I took a wild guess at disabling ada support with '--disable-ada', but it still bombed with the same error.)

Thanks for your help,

Preston





-----Original Message-----
From:	Lee, Preston
Sent:	Tue 12/2/2003 1:01 PM
To:	gcc-help@gcc.gnu.org
Cc:	
Subject:	Linux Build/Host Cross-Compiler For Cygwin Target
I'm trying to build a cross-compiler on i686-pc-linux-gnu, that will run on i686-pc-linux-gnu, and generate code for i686-pc-cygwin. I haven't successfully done this before so bare with me.

I have tried to build three different verisions of GCC: 3.1, 3.3.1, and 3.3.2. The version I really *need* is 3.3.1, so I'll focus on that one. As I understand it, the only additional option I want to give the configure script is '--target=i686-pc-cygwin', so I configure it with...


----BEGIN----
./configure --enable-threads=posix --target=i686-pc-cygwin
----END----


...and then 'make'. It churns for a while and then barfs with the following,


----BEGIN BARF----
make[2]: Entering directory `/home/preston/bin/cross-compiler-cygwin/gcc-3.3.1/gcc'
for d in libgcc; do \
  if [ -d $d ]; then true; else /bin/sh ./mkinstalldirs $d; fi; \
done
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
/home/preston/bin/cross-compiler-cygwin/gcc-3.3.1/gcc/xgcc -B/home/preston/bin/cross-compiler-cygwin/gcc-3.3.1/gcc/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ -isystem /usr/local/i686-pc-cygwin/include -O2 -I./../winsup/include -I./../winsup/cygwin/include -I./../winsup/w32api/include -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I. -I./. -I./config -I./../include  -DL_muldi3 -c ./libgcc2.c -o libgcc/./_muldi3.o
In file included from tconfig.h:17,
                 from libgcc2.c:36:
config/i386/cygwin.h:30:19: stdio.h: No such file or directory
In file included from tconfig.h:17,
                 from libgcc2.c:36:
config/i386/cygwin.h:415: error: parse error before '*' token
config/i386/cygwin.h:415: warning: function declaration isn't a prototype
config/i386/cygwin.h:417: error: parse error before '*' token
config/i386/cygwin.h:417: warning: function declaration isn't a prototype
make[2]: *** [libgcc/./_muldi3.o] Error 1
make[2]: Leaving directory `/home/preston/bin/cross-compiler-cygwin/gcc-3.3.1/gcc'
make[1]: *** [libgcc.a] Error 2
make[1]: Leaving directory `/home/preston/bin/cross-compiler-cygwin/gcc-3.3.1/gcc'
make: *** [all-gcc] Error 2
----END BARF----

Am I doing something wrong here? Looking at the error, it seems that it just can't find stdio.h, which doesn't make sense to me because it's a standard library in /usr/include. But then maybe it needs it's own version or whatnot..I don't know. It's hard to know what's going on because I'm not familiar with it's internal build process.

I found a document (http://sources.redhat.com/ml/crossgcc/2001-06/msg00039/cross-compiler-HOWTO.pdf) that details building a cross-compiler for a few other systems on Linux, but it is over 3 years old so maybe something has changed. I haven't been able to find a solution to this on the web, usenet or GCC documentation. I don't really want to delve into the GCC source code. TIA,

Preston






More information about the Gcc-help mailing list