[PATCH] Fix Ada on Cygwin

Dave Korn the.davek@gmail.com
Sat Aug 1 15:28:00 GMT 2009


    Hi all,

  Ada is currently in need of a bit of TLC on the Cygwin platform(*) and has a
number of regressions(**).  The attached patch goes most of the way toward
remedying that.  The bit-rot began when the cygwin target triple changed from
the old 'i686-pc-cygwin32' to the current form (drops the '32' suffix).  That
knocked out-of-play the entire set of LIBGNAT_TARGET_PAIRS overrides for the
platform; restoring them brings to light a couple of knock-on side-effects that
this patch has also to address.

  This patch ends the use of the native winsock library for Cygwin GNAT, in
favour of Cygwin's implementation of the POSIX/Berkeley socket interface.  There
may well be other target-specific overrides for which the same could be done,
but I just wanted to do the minimal changes to get it working, and had to do at
least something about the sockets anyway since it would cause a build failure
otherwise(***).

  These patches are derived from patches that have been in the Cygwin distro
compiler for some time now, and I haven't heard any complaints arising, although
I don't actually know how many people use GNAT on Cygwin.  But I tested them all
while doing the development and they all fixed FAILs without creating new ones.

gcc/ada/ChangeLog:

	* sysdep.c (__gnat_is_windows_xp): Move out from MinGW #ifdef
	block inside WINNT block to where it can be shared with Cygwin,
	and do so.
	(_msize): Implement for Cygwin.
	(getc_immediate_common): Don't test old deprecated __CYGWIN32__
	predefined macro any more, use __CYGWIN__.
	* initialize.c (__gnat_initialize): Add Cygwin version.
	* gsocket.h (HAVE_THREAD_SAFE_GETxxxBYyyy): Define on Cygwin also.
	* gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS): Check target
	triple for just 'cygwin', not deprecated 'cygwin32', when setting
	overrides for windows platform, but don't use MinGW sockets nor
	link against ws2_32.

  Bootstrap completed, tests running now (chapter a already complete with 12
FAILs fixed).  Assuming no regressions (and many improvements), OK for HEAD?

    cheers,
      DaveK
-- 
(*)   - http://gcc.gnu.org/ml/gcc/2009-03/threads.html#00780
(**)  - http://gcc.gnu.org/ml/gcc-testresults/2009-08/msg00115.html
(***) - http://gcc.gnu.org/ml/gcc/2009-03/msg00790.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygwin-ada-fixes.diff
Type: text/x-c
Size: 6810 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090801/0424c0e0/attachment.bin>


More information about the Gcc-patches mailing list