This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


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

GCC 3.2.2 linux to cygwin,mingw32 cross compiler?


Hi,

Is there a receipe for building a linux-hosted cygwin/mingw32 GCC 3.2.2
(or any 3.2+) cross compiler for C and C++?  For linux-x-mingw32 I did
<http://jrfonseca.dyndns.org/projects/gnu-win32/documentation/cross>
and for linux-x-cygwin <http://www.wxwindows.org/technote/crosscmp.htm>.

Building GCC 3.2.2 linux-x-cygwin took a few tweaks in libiberty and
choosing the right top-level include contents, but otherwise it went
fine.  I can post the exact receipe in case it matters.

I noticed that with -mno-cygwin it prefers i686-pc-cygwin/include over
i686-pc-cygwin/include/mingw (e.g. io.h, but there are others, and it
finds unistd.h etc.).  I got around some of those by changing specs in
gcc/config/i386/cygwin.h to -isystem instead of -idirafter the mingw
include dir.  (BTW, it didn't find crt.o with the -L option either, I
added the full path in the specs file.)

With those changes C++ is not happy however.  libstdc++ assumes cygwin's
newlib ctype.h but gets mingw/ctype.h, with lots of messages of type:
  .../include/c++/3.2.2/i686-pc-cygwin/bits/ctype_base.h:46:
     `_U' was not declared in this scope

Is this currently known to be broken or did I screw it up with the above
changes to specs?  Is there an easy fix?  Would this require multilib
magic for libstdc++ for -mno-cygwin?

In short, is it possible to have one cross chain to compile both cygwin
and mingw32 programs (latter with -mno-cygwin), or should I keep the two
separate chains?  I realise -mno-cygwin is a cygwin cross environment
already.  If someone says this "cross of a cross" won't work, that's ok
with me, I just want to know I am not responsible for cockpit errors :-)

//lat
-- 
Ambition, n.: An overmastering desire to be vilified by
enemies while living and ridiculed by friends when dead.
	--Ambrose Bierce


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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