Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <2407239113CD914CBA855A47698F01B0F53E@SUGAH2.triscend.com> From: John Andrews To: cygwin AT cygwin DOT com Subject: RE: cross compiler for Cygwin Date: Fri, 9 Mar 2001 19:41:11 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Hi All, Well now that you've offered Mumit... 8-) All jest aside, I'd like to start by saying Thank You Very Much! to all of the people who put their time and effort into this and many other open source support mailing lists. Hopefully your efforts can bring up a new crowd of experts with the knowledge and the inclination to help you carry the load. So, now for the unpleasant part. I actually do realize that gcc must be cross built to support targets other than its native pc-cygwin. But knowing this and accomplishing it are two VERY different things. I've spent quite a bit of time reading archives of this and other lists as well as various web sites and ftp archives. It seems one of the biggest issues to stumble the uninitiated is including the correct headers for the run-time support libraries or OS. This and the CRLF issue unique to cygwin seem to produce some really cryptic cross gcc build failures. Here's a detailed description of my environment with the error and a couple of questions at the end. Thanks Again for helping out! I'm trying to cross build gcc on a cygwin host to support uClinux on an ARM7TDMI. I was able to build it to support eCos by following the very explicit instructions and using the exact versions and patches specified on the RedHat eCos site. However once venturing away from that script I've had very little luck in getting gcc to compile in the wily world of straight downloaded and installed tarballs. The number of combinations of versions, patches, various different bits of advice on sym links to library include files and config options is astronomical. Given all this, this is my latest attempt: binutils-2.10.1 gcc-2.95.2 uClinux-2.0.x from cvs.uclinux.org #1) extract all tarballs with tar not WinZip in /usr/src which is mounted in textmode. #2) build dirs are /tmp/builduClinux/binutils and /tmp/builduClinux/gcc with /tmp mounted in binary mode #3) export MAKE_MODE=UNIX #4) config binutils from /tmp/builduClinux/binutils with: /usr/src/binutils-2.10.1/configure --target=arm-elf-linux \ --prefix=/usr/arm-uClinux \ --exec-prefix=/usr/arm-uClinux/H-i686-pc-cygwin \ -v 2>&1 | tee configure.out #5) make binutils with: make -w all 2>&1 | tee make.out #6) install binutils with: make -w install 2>&1 | tee install.out #7) put the new cross binutils at the head of the path with: export PATH=/usr/arm-uClinux/H-i686-pc-cygwin/bin:$PATH #8) cd to /usr/src/uClinux-2.0.x and edit top level makefile with: ARCH = armnommu CROSS_COMPILE = arm-elf-linux- #9) make menuconfig setting system to AT91 #10) cd to /usr/arm-uClinux/include and set symlinks to uClinux headers with: ln -s /usr/src/uClinux-2.0.x/include/linux linux ln -s /usr/src/uClinux-2.0.x/include/asm asm #11) cd to /tmp/builduClinux/gcc and configure gcc with: /usr/src/gcc-2.95.2/configure --target=arm-elf-linux \ --prefix=/usr/arm-uClinux \ --exec-prefix=/usr/arm-uClinux/H-i686-pc-cygwin \ --with-gnu-as --with-gnu-ld --with-newlib \ --enable-languages=c,c++ -v 2>&1 | tee configure.out #12) make gcc with: make -w all-gcc LANGUAGES="c" 2>&1 | tee make.out And that brings us full circle to where I was when I posted my first message a couple of days ago. The make dies with the following error message: ---tail of gcc make.out--- gcc -DCROSS_COMPILE -DIN_GCC -g -O2 -DHAVE_CONFIG_H -I. -I/usr/src/gcc-2 .95.2/gcc -I/usr/src/gcc-2.95.2/gcc/config -I/usr/src/gcc-2.95.2/gcc/../include \ -DPREFIX=\"/usr/arm-uClinux\" \ -c `echo /usr/src/gcc-2.95.2/gcc/prefix.c | sed 's,^\./,,'` In file included from /usr/include/w32api/windef.h:143, from /usr/include/w32api/windows.h:96, from /usr/src/gcc-2.95.2/gcc/prefix.c:69: /usr/include/w32api/winnt.h:2266: two or more data types in declaration of `type name' make[1]: *** [prefix.o] Error 1 make[1]: Leaving directory `/tmp/builduClinux/gcc/gcc' make: *** [all-gcc] Error 2 make: Leaving directory `/tmp/builduClinux/gcc' ---end of make.out--- Are there specific patches I should run on gcc? I tried running the eCos gcc patches once before and that did allow me to get farther but I'm not really sure if those are specifically intended for the eCos environment or if they're applicable to a more general cross gcc build. Any advice anyone could offer would be Very Much Appreciated! Thanks, John E. A. -----Original Message----- From: Mumit Khan [mailto:khan AT NanoTech DOT Wisc DOT EDU] Sent: Friday, March 09, 2001 1:36 PM To: cygwin AT cygwin DOT com Subject: Re: cross compiler for Cygwin On Fri, 9 Mar 2001, Christopher Faylor wrote: > I wonder where people are getting the idea that Cygwin naturally handles > cross compilation. This is a rather odd idea and I don't see any hint > of this in any of our documentation. One possible reason may be due to the fact that various embedded tools companies, such as RedHat/Cygnus and Wind River, use Cygwin extensively as the x-development platform of choice for embedded systems (one of my colleagues is still using cygwin b17 based embedded tools). The other reason you see all these messages is because most users who are starting out in the cross-dev area using Cygwin are usually not the "old hats" who've been there and done that, and running into the usual sea of misinformation regarding cross builds. IMO it's to Cygwin's credit that developers want to use it as the development platform for embedded tools, and we should certainly provide a helping hand (for the host-specific parts of course, not the target bits which has nothing to do with Cygwin). Regards, Mumit -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple