summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2015-06-19 00:42:10 -0500
committerYaakov Selkowitz <yselkowi@redhat.com>2015-06-19 00:42:10 -0500
commit6f91efa3e6e85685bbf7a4e07e7cf2324d2388cb (patch)
treed5cf1b3104dfc411c45a8c1a4a4251a0fbd6818b
parent40a0a60a27a65867bc1a97def6fe946ac10b091c (diff)
downloadcygwin-gcc-6f91efa3e6e85685bbf7a4e07e7cf2324d2388cb.tar.gz
cygwin-gcc-6f91efa3e6e85685bbf7a4e07e7cf2324d2388cb.tar.xz
cygwin-gcc-6f91efa3e6e85685bbf7a4e07e7cf2324d2388cb.zip
cygwin-gcc 4.9.2-1
-rw-r--r--0001-share-mingw-fset-stack-executable-with-cygwin.patch (renamed from gcc47-execstack.patch)45
-rw-r--r--0002-boehm-gc-for-cygwin.patch (renamed from gcc47-boehm-gc-cygwin.patch)18
-rw-r--r--0003-AWT-Font-fix-for-Cygwin.patch99
-rw-r--r--0004-Cygwin-ioctl-may-emit-EINVAL.patch27
-rw-r--r--0005-use-avoid-version-if-not-tracking-SO-version.patch39
-rw-r--r--0006-cygwin-uses-cyg-library-prefix.patch51
-rw-r--r--0007-bump-libgcj-version.patch22
-rw-r--r--0008-libatomic-libtool-fixes-for-Cygwin.patch (renamed from gcc48-libatomic-cygwin.patch)133
-rw-r--r--0009-support-64bit-cygwin-too.patch25
-rw-r--r--0010-Avoid-installing-libffi.patch (renamed from gcc47-libffi-noinst.patch)29
-rw-r--r--0011-libitm-libtool-fixes-for-Cygwin.patch115
-rw-r--r--0012-Cygwin-uses-sysv-ABI-on-x86_64.patch115
-rw-r--r--0013-Do-not-version-lto-plugin-on-cygwin-mingw.patch (renamed from gcc48-lto-plugin-soname.patch)48
-rw-r--r--0014-add-dummy-pthread-tsaware-and-large-address-aware-fo.patch115
-rw-r--r--0015-handle-dllimport-properly-in-medium-model.patch35
-rw-r--r--0016-skip-test-for-cygwin-mingw.patch23
-rw-r--r--0017-64bit-Cygwin-uses-SEH.patch301
-rw-r--r--0018-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch31
-rw-r--r--0019-fix-some-implicit-declaration-warnings.patch (renamed from gcc48-Wimplicit-decls.patch)31
-rw-r--r--0020-fix-gnat-DLL-prefix-for-Cygwin.patch234
-rw-r--r--0021-__cxa-atexit-for-Cygwin.patch (renamed from gcc48-__cxa_atexit.patch)116
-rw-r--r--0022-prevent-modules-from-being-unloaded-before-their-dto.patch (renamed from gcc48-libstdc-atexit_thread.patch)53
-rw-r--r--0023-Attempt-to-fix-dw2-unwinder-for-Cygwin.patch (renamed from gcc48-libgcc-deregister.patch)49
-rw-r--r--0024-Restore-compile-mode-pthread.patch27
-rw-r--r--0025-fix-cygwin-stdint.patch86
-rw-r--r--1000-cross-exe-suffix.patch (renamed from gcc45-cross-exe-suffix.diff)0
-rw-r--r--1001-textdomain.patch (renamed from gcc46-textdomain.patch)22
-rw-r--r--1002-isl-r218392.patch334
-rw-r--r--cygwin-gcc.spec422
-rw-r--r--gcc45-java-FIONREAD.diff13
-rw-r--r--gcc47-ada.patch3285
-rw-r--r--gcc47-cross-ecjx.patch52
-rw-r--r--gcc47-cross-jardir.patch22
-rw-r--r--gcc47-java-jni.patch56
-rw-r--r--gcc47-libstdc-cygwin.patch34
-rw-r--r--gcc48-java-soname.patch7
-rw-r--r--gcc48-specs-cygwin.patch317
-rw-r--r--gcc49-default-manifest.patch31
-rw-r--r--sources2
39 files changed, 2416 insertions, 4048 deletions
diff --git a/gcc47-execstack.patch b/0001-share-mingw-fset-stack-executable-with-cygwin.patch
index 8a2b36e..2607f5b 100644
--- a/gcc47-execstack.patch
+++ b/0001-share-mingw-fset-stack-executable-with-cygwin.patch
@@ -1,5 +1,19 @@
---- origsrc/gcc-4.7.2/gcc/config/i386//cygming.opt 2011-04-01 15:43:22.000000000 +0100
-+++ src/gcc-4.7.2/gcc/config/i386//cygming.opt 2012-11-01 20:56:56.406250000 +0000
+From 6435fa425aaed23dc46a50a66772b6b19a6e478a Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Wed, 28 May 2014 22:05:17 +0800
+Subject: [PATCH 01/24] share mingw fset-stack-executable with cygwin
+
+---
+ gcc/config/i386/cygming.opt | 4 ++++
+ gcc/config/i386/cygwin.h | 4 ++++
+ gcc/config/i386/mingw.opt | 4 ----
+ libgcc/config.host | 3 +++
+ 4 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/config/i386/cygming.opt b/gcc/config/i386/cygming.opt
+index 3437123..833fccc 100644
+--- a/gcc/config/i386/cygming.opt
++++ b/gcc/config/i386/cygming.opt
@@ -50,6 +50,10 @@ muse-libstdc-wrappers
Target Condition({defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS)})
Compile code that relies on Cygwin DLL wrappers to support C++ operator new/delete replacement
@@ -11,18 +25,22 @@
posix
Driver
---- origsrc/gcc-4.7.2/gcc/config/i386//cygwin.h 2012-11-01 20:55:58.250000000 +0000
-+++ src/gcc-4.7.2/gcc/config/i386//cygwin.h 2012-11-01 20:11:22.000000000 +0000
-@@ -140,3 +140,7 @@ along with GCC; see the file COPYING3.
+diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
+index 165d3aa..145e3cc 100644
+--- a/gcc/config/i386/cygwin.h
++++ b/gcc/config/i386/cygwin.h
+@@ -145,3 +145,7 @@ along with GCC; see the file COPYING3. If not see
/* We should find a way to not have to update this manually. */
- #define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-13.dll"
+ #define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-15.dll"
+/* Make stack executable to avoid DEP problems with trampolines. */
+#define HAVE_ENABLE_EXECUTE_STACK
+#undef CHECK_EXECUTE_STACK_ENABLED
+#define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable
---- origsrc/gcc-4.7.2/gcc/config/i386//mingw.opt 2011-04-01 15:43:22.000000000 +0100
-+++ src/gcc-4.7.2/gcc/config/i386//mingw.opt 2012-11-01 20:57:00.296875000 +0000
+diff --git a/gcc/config/i386/mingw.opt b/gcc/config/i386/mingw.opt
+index 44fecb0..dc0f53d 100644
+--- a/gcc/config/i386/mingw.opt
++++ b/gcc/config/i386/mingw.opt
@@ -28,8 +28,4 @@ Wpedantic-ms-format
C ObjC C++ ObjC++ Var(warn_pedantic_ms_format) Init(1) Warning
Warn about none ISO msvcrt scanf/printf width extensions
@@ -32,9 +50,11 @@
-For nested functions on stack executable permission is set.
-
; Need to retain blank line above.
---- origsrc/gcc-4.7.2/libgcc//config.host 2012-11-01 20:55:58.234375000 +0000
-+++ src/gcc-4.7.2/libgcc//config.host 2012-11-01 20:11:20.000000000 +0000
-@@ -273,6 +273,9 @@ case ${host} in
+diff --git a/libgcc/config.host b/libgcc/config.host
+index f4a7428..f196680 100644
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -308,6 +308,9 @@ case ${host} in
i[34567]86-*-mingw* | x86_64-*-mingw*)
enable_execute_stack=config/i386/enable-execute-stack-mingw32.c
;;
@@ -44,3 +64,6 @@
*)
enable_execute_stack=enable-execute-stack-empty.c;
;;
+--
+2.1.1
+
diff --git a/gcc47-boehm-gc-cygwin.patch b/0002-boehm-gc-for-cygwin.patch
index 49f9ee0..002d410 100644
--- a/gcc47-boehm-gc-cygwin.patch
+++ b/0002-boehm-gc-for-cygwin.patch
@@ -1,5 +1,16 @@
---- origsrc/gcc-4.7.2/boehm-gc/win32_threads.c 2009-05-17 21:07:18.000000000 +0100
-+++ src/gcc-4.7.2/boehm-gc/win32_threads.c 2013-03-31 19:34:57.203125000 +0100
+From 28e07034d97f5f8eb38f78d8e45e2d47de5c0040 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Wed, 28 May 2014 22:11:01 +0800
+Subject: [PATCH 02/24] boehm-gc for cygwin
+
+---
+ boehm-gc/win32_threads.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
+
+diff --git a/boehm-gc/win32_threads.c b/boehm-gc/win32_threads.c
+index ffb34e0..186bc39 100644
+--- a/boehm-gc/win32_threads.c
++++ b/boehm-gc/win32_threads.c
@@ -707,6 +707,54 @@ void * GC_start_routine(void * arg)
return(result);
}
@@ -55,3 +66,6 @@
void GC_thread_exit_proc(void *arg)
{
GC_thread me = (GC_thread)arg;
+--
+2.1.1
+
diff --git a/0003-AWT-Font-fix-for-Cygwin.patch b/0003-AWT-Font-fix-for-Cygwin.patch
new file mode 100644
index 0000000..842fc09
--- /dev/null
+++ b/0003-AWT-Font-fix-for-Cygwin.patch
@@ -0,0 +1,99 @@
+From f4176d1e246a755de7a181169d94cd9676ebb86a Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Thu, 29 May 2014 18:06:00 +0800
+Subject: [PATCH 03/24] AWT Font fix for Cygwin
+
+---
+ .../gnu/classpath/examples/awt/HintingDemo.java | 2 +-
+ .../gnu/java/awt/peer/ClasspathDesktopPeer.java | 2 +-
+ .../gnu/java/awt/peer/ClasspathFontPeer.java | 3 +++
+ .../resource/gnu/java/awt/font/fonts.properties | 24 +++++++++++-----------
+ 4 files changed, 17 insertions(+), 14 deletions(-)
+
+diff --git a/libjava/classpath/examples/gnu/classpath/examples/awt/HintingDemo.java b/libjava/classpath/examples/gnu/classpath/examples/awt/HintingDemo.java
+index 5ba44f6..068b596 100644
+--- a/libjava/classpath/examples/gnu/classpath/examples/awt/HintingDemo.java
++++ b/libjava/classpath/examples/gnu/classpath/examples/awt/HintingDemo.java
+@@ -211,7 +211,7 @@ public class HintingDemo extends JFrame {
+
+ HintingDemo()
+ {
+- File file = new File("/usr/share/fonts/truetype/freefont/FreeSans.ttf");
++ File file = new File("/usr/share/fonts/TTF/Vera.ttf");
+ loadFont(file);
+ setLayout(new BorderLayout());
+ chooser = new Chooser();
+diff --git a/libjava/classpath/gnu/java/awt/peer/ClasspathDesktopPeer.java b/libjava/classpath/gnu/java/awt/peer/ClasspathDesktopPeer.java
+index fd4f498..2935a5a 100644
+--- a/libjava/classpath/gnu/java/awt/peer/ClasspathDesktopPeer.java
++++ b/libjava/classpath/gnu/java/awt/peer/ClasspathDesktopPeer.java
+@@ -58,7 +58,7 @@ public class ClasspathDesktopPeer
+ implements DesktopPeer
+ {
+ /** This is the fallback browser, if no desktop was detected. */
+- protected static final String _DEFAULT_BROWSER = "firefox";
++ protected static final String _DEFAULT_BROWSER = "xdg-open";
+
+ /** gnu.java.awt.peer.Desktop.html.command */
+ protected static final String _BROWSE = "html";
+diff --git a/libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java b/libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java
+index 96677a4..101a85f 100644
+--- a/libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java
++++ b/libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java
+@@ -158,6 +158,8 @@ public abstract class ClasspathFontPeer
+
+ protected static boolean isLogicalFontName(String name)
+ {
++ return false;
++/*
+ String uname = name.toUpperCase ();
+ return (uname.equals ("SANSSERIF") ||
+ uname.equals ("SERIF") ||
+@@ -165,6 +167,7 @@ public abstract class ClasspathFontPeer
+ uname.equals ("DIALOG") ||
+ uname.equals ("DIALOGINPUT") ||
+ uname.equals ("DEFAULT"));
++*/
+ }
+
+ protected static String logicalFontNameToFaceName (String name)
+diff --git a/libjava/classpath/resource/gnu/java/awt/font/fonts.properties b/libjava/classpath/resource/gnu/java/awt/font/fonts.properties
+index 4fc0b10..1370469 100644
+--- a/libjava/classpath/resource/gnu/java/awt/font/fonts.properties
++++ b/libjava/classpath/resource/gnu/java/awt/font/fonts.properties
+@@ -36,20 +36,20 @@
+ # exception statement from your version.
+
+ # List of available fonts.
+-FreeMono/p=/usr/share/fonts/truetype/freefont/FreeMono.ttf
+-FreeMono/b=/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf
+-FreeMono/bi=/usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf
+-FreeMono/i=/usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf
++FreeMono/p=/usr/share/fonts/TTF/VeraMono.ttf
++FreeMono/b=/usr/share/fonts/TTF/VeraMoBd.ttf
++FreeMono/bi=/usr/share/fonts/TTF/VeraMoBI.ttf
++FreeMono/i=/usr/share/fonts/TTF/VeraMoIt.ttf
+
+-FreeSans/p=/usr/share/fonts/truetype/freefont/FreeSans.ttf
+-FreeSans/b=/usr/share/fonts/truetype/freefont/FreeSansBold.ttf
+-FreeSans/bi=/usr/share/fonts/truetype/freefont/FreeSansBoldOblique.ttf
+-FreeSans/i=/usr/share/fonts/truetype/freefont/FreeSansOblique.ttf
++FreeSans/p=/usr/share/fonts/TTF/Vera.ttf
++FreeSans/b=/usr/share/fonts/TTF/VeraBd.ttf
++FreeSans/bi=/usr/share/fonts/TTF/VeraBI.ttf
++FreeSans/i=/usr/share/fonts/TTF/VeraIt.ttf
+
+-FreeSerif/p=/usr/share/fonts/truetype/freefont/FreeSerif.ttf
+-FreeSerif/b=/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf
+-FreeSerif/bi=/usr/share/fonts/truetype/freefont/FreeSerifBoldOblique.ttf
+-FreeSerif/i=/usr/share/fonts/truetype/freefont/FreeSerifOblique.ttf
++FreeSerif/p=/usr/share/fonts/TTF/VeraSe.ttf
++FreeSerif/b=/usr/share/fonts/TTF/VeraSeBd.ttf
++FreeSerif/bi=/usr/share/fonts/TTF/VeraSeBd.ttf
++FreeSerif/i=/usr/share/fonts/TTF/VeraSe.ttf
+
+ # List of aliases.
+ Dialog/a=FreeSans
+--
+2.1.1
+
diff --git a/0004-Cygwin-ioctl-may-emit-EINVAL.patch b/0004-Cygwin-ioctl-may-emit-EINVAL.patch
new file mode 100644
index 0000000..ff14e3f
--- /dev/null
+++ b/0004-Cygwin-ioctl-may-emit-EINVAL.patch
@@ -0,0 +1,27 @@
+From 4c3499c1009f7051d76ba8b603fdeaa510e5c650 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 08:37:16 +0800
+Subject: [PATCH 04/24] Cygwin ioctl may emit EINVAL
+
+On Cygwin (on X86) ioctl on FIONREAD returns EINVAL on the errno variable instead of ENOTTY
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35536
+---
+ libjava/gnu/java/nio/channels/natFileChannelPosix.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libjava/gnu/java/nio/channels/natFileChannelPosix.cc b/libjava/gnu/java/nio/channels/natFileChannelPosix.cc
+index e05904c..0a2569c 100644
+--- a/libjava/gnu/java/nio/channels/natFileChannelPosix.cc
++++ b/libjava/gnu/java/nio/channels/natFileChannelPosix.cc
+@@ -386,7 +386,7 @@ FileChannelImpl::available (void)
+
+ #if defined (FIONREAD)
+ r = ::ioctl (fd, FIONREAD, &num);
+- if (r == -1 && errno == ENOTTY)
++ if (r == -1 && (errno == ENOTTY || errno == EINVAL))
+ {
+ // If the ioctl doesn't work, we don't care.
+ r = 0;
+--
+2.1.1
+
diff --git a/0005-use-avoid-version-if-not-tracking-SO-version.patch b/0005-use-avoid-version-if-not-tracking-SO-version.patch
new file mode 100644
index 0000000..3dcd84d
--- /dev/null
+++ b/0005-use-avoid-version-if-not-tracking-SO-version.patch
@@ -0,0 +1,39 @@
+From 3dc7b3621f887de9ed4993af86f512f028c71975 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 08:45:53 +0800
+Subject: [PATCH 05/24] use -avoid-version if not tracking SO version
+
+---
+ libjava/classpath/configure | 2 +-
+ libjava/classpath/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libjava/classpath/configure b/libjava/classpath/configure
+index bcb5bff..ac49367 100755
+--- a/libjava/classpath/configure
++++ b/libjava/classpath/configure
+@@ -3180,7 +3180,7 @@ case "$host_os" in
+ cp_module=""
+ ;;
+ *)
+- cp_module="-module"
++ cp_module="-module -avoid-version"
+ ;;
+ esac
+
+diff --git a/libjava/classpath/configure.ac b/libjava/classpath/configure.ac
+index d120b5b..f59e599 100644
+--- a/libjava/classpath/configure.ac
++++ b/libjava/classpath/configure.ac
+@@ -64,7 +64,7 @@ case "$host_os" in
+ cp_module=""
+ ;;
+ *)
+- cp_module="-module"
++ cp_module="-module -avoid-version"
+ ;;
+ esac
+
+--
+2.1.1
+
diff --git a/0006-cygwin-uses-cyg-library-prefix.patch b/0006-cygwin-uses-cyg-library-prefix.patch
new file mode 100644
index 0000000..5d5e92a
--- /dev/null
+++ b/0006-cygwin-uses-cyg-library-prefix.patch
@@ -0,0 +1,51 @@
+From 3a9e0759c78e3ce788c446b1fc68efa9e84c900a Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 08:48:56 +0800
+Subject: [PATCH 06/24] cygwin uses cyg library prefix
+
+---
+ libjava/include/posix.h | 6 ++++++
+ libjava/java/net/natVMURLConnection.cc | 4 ++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/libjava/include/posix.h b/libjava/include/posix.h
+index 6bd560c..cbda784 100644
+--- a/libjava/include/posix.h
++++ b/libjava/include/posix.h
+@@ -42,11 +42,17 @@ details. */
+ #include <java/util/Properties.h>
+
+ // Prefix and suffix for shared libraries.
++#ifdef __CYGWIN__
++#define _Jv_platform_solib_prefix "cyg"
++#else
+ #define _Jv_platform_solib_prefix "lib"
++#endif
+ #if defined(__APPLE__) && defined(__MACH__)
+ #define _Jv_platform_solib_suffix ".dylib"
+ #elif defined(HPUX) && defined(HP_PA)
+ #define _Jv_platform_solib_suffix ".sl"
++#elif defined(__CYGWIN__)
++#define _Jv_platform_solib_suffix ".dll"
+ #else
+ #define _Jv_platform_solib_suffix ".so"
+ #endif
+diff --git a/libjava/java/net/natVMURLConnection.cc b/libjava/java/net/natVMURLConnection.cc
+index 0a30a21..810e045 100644
+--- a/libjava/java/net/natVMURLConnection.cc
++++ b/libjava/java/net/natVMURLConnection.cc
+@@ -32,7 +32,11 @@ void
+ java::net::VMURLConnection::init ()
+ {
+ #if defined (HAVE_MAGIC_T) && defined (HAVE_MAGIC_H) && defined (USE_LTDL)
++#ifdef __CYGWIN__
++ lt_dlhandle handle = lt_dlopenext ("cygmagic-1.dll");
++#else
+ lt_dlhandle handle = lt_dlopenext ("libmagic.so");
++#endif
+ if (!handle)
+ return;
+
+--
+2.1.1
+
diff --git a/0007-bump-libgcj-version.patch b/0007-bump-libgcj-version.patch
new file mode 100644
index 0000000..5b1bbe6
--- /dev/null
+++ b/0007-bump-libgcj-version.patch
@@ -0,0 +1,22 @@
+From 35fe0f717d2e2c4c95eb65ce6e1e7373bf798afc Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 08:59:12 +0800
+Subject: [PATCH 07/24] bump libgcj version
+
+---
+ gcc/config/i386/mingw32.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
+index 4cfd5f0..820cf50 100644
+--- a/gcc/config/i386/mingw32.h
++++ b/gcc/config/i386/mingw32.h
+@@ -246,4 +246,4 @@ do { \
+ #define LIBGCC_SONAME "libgcc_s" LIBGCC_EH_EXTN "-1.dll"
+
+ /* We should find a way to not have to update this manually. */
+-#define LIBGCJ_SONAME "libgcj" /*LIBGCC_EH_EXTN*/ "-13.dll"
++#define LIBGCJ_SONAME "libgcj" /*LIBGCC_EH_EXTN*/ "-15.dll"
+--
+2.1.1
+
diff --git a/gcc48-libatomic-cygwin.patch b/0008-libatomic-libtool-fixes-for-Cygwin.patch
index af28245..2300af3 100644
--- a/gcc48-libatomic-cygwin.patch
+++ b/0008-libatomic-libtool-fixes-for-Cygwin.patch
@@ -1,17 +1,35 @@
---- origsrc/gcc-4.8-20130310/libatomic/Makefile.am 2013-01-14 12:16:23.000000000 -0600
-+++ src/gcc-4.8-20130310/libatomic/Makefile.am 2013-03-17 05:10:55.958313400 -0500
-@@ -66,7 +66,7 @@
+From ea6218eb8afa21b0b4dcf90a2f0eab7c024242e9 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:08:37 +0800
+Subject: [PATCH 08/24] libatomic libtool fixes for Cygwin
+
+---
+ libatomic/Makefile.am | 2 +-
+ libatomic/Makefile.in | 3 ++-
+ libatomic/aclocal.m4 | 1 +
+ libatomic/configure | 27 +++++++++++++++++++++++++--
+ libatomic/configure.ac | 1 +
+ libatomic/configure.tgt | 2 +-
+ 6 files changed, 31 insertions(+), 5 deletions(-)
+
+diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
+index 47f25df..56e1c34 100644
+--- a/libatomic/Makefile.am
++++ b/libatomic/Makefile.am
+@@ -66,7 +66,7 @@ libatomic_version_dep =
endif
libatomic_version_info = -version-info $(libtool_VERSION)
-libatomic_la_LDFLAGS = $(libatomic_version_info) $(libatomic_version_script)
+libatomic_la_LDFLAGS = $(libatomic_version_info) $(libatomic_version_script) $(lt_host_flags)
- libatomic_la_SOURCES = gload.c gstore.c gcas.c gexch.c glfree.c lock.c init.c
+ libatomic_la_SOURCES = gload.c gstore.c gcas.c gexch.c glfree.c lock.c init.c \
+ fenv.c
- SIZEOBJS = load store cas exch fadd fsub fand fior fxor fnand tas
---- origsrc/gcc-4.8-20130310/libatomic/Makefile.in 2013-03-10 17:37:36.000000000 -0500
-+++ src/gcc-4.8-20130310/libatomic/Makefile.in 2013-03-17 05:13:32.732280300 -0500
-@@ -244,6 +244,7 @@
+diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
+index 22c384b..9c510db 100644
+--- a/libatomic/Makefile.in
++++ b/libatomic/Makefile.in
+@@ -244,6 +244,7 @@ libexecdir = @libexecdir@
libtool_VERSION = @libtool_VERSION@
localedir = @localedir@
localstatedir = @localstatedir@
@@ -19,49 +37,32 @@
mandir = @mandir@
mkdir_p = @mkdir_p@
multi_basedir = @multi_basedir@
-@@ -285,7 +286,7 @@
+@@ -285,7 +286,7 @@ noinst_LTLIBRARIES = libatomic_convenience.la
@LIBAT_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@libatomic_version_dep = $(top_srcdir)/libatomic.map
@LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@libatomic_version_dep = libatomic.map-sun
libatomic_version_info = -version-info $(libtool_VERSION)
-libatomic_la_LDFLAGS = $(libatomic_version_info) $(libatomic_version_script)
+libatomic_la_LDFLAGS = $(libatomic_version_info) $(libatomic_version_script) $(lt_host_flags)
- libatomic_la_SOURCES = gload.c gstore.c gcas.c gexch.c glfree.c lock.c init.c
- SIZEOBJS = load store cas exch fadd fsub fand fior fxor fnand tas
- EXTRA_libatomic_la_SOURCES = $(addsuffix _n.c,$(SIZEOBJS))
---- origsrc/gcc-4.8-20130310/libatomic/aclocal.m4 2013-03-10 17:37:36.000000000 -0500
-+++ src/gcc-4.8-20130310/libatomic/aclocal.m4 2013-03-17 05:09:13.598458700 -0500
-@@ -993,6 +993,7 @@
- m4_include([../config/acx.m4])
+ libatomic_la_SOURCES = gload.c gstore.c gcas.c gexch.c glfree.c lock.c init.c \
+ fenv.c
+
+diff --git a/libatomic/aclocal.m4 b/libatomic/aclocal.m4
+index 48f5ef5..26dd3f4 100644
+--- a/libatomic/aclocal.m4
++++ b/libatomic/aclocal.m4
+@@ -994,6 +994,7 @@ m4_include([../config/acx.m4])
m4_include([../config/depstand.m4])
m4_include([../config/lead-dot.m4])
-+m4_include([../config/lthostflags.m4])
m4_include([../config/multi.m4])
++m4_include([../config/lthostflags.m4])
m4_include([../config/override.m4])
m4_include([../config/stdint.m4])
---- origsrc/gcc-4.8-20130310/libatomic/configure.ac 2013-01-14 12:16:23.000000000 -0600
-+++ src/gcc-4.8-20130310/libatomic/configure.ac 2013-03-17 05:29:30.655070400 -0500
-@@ -143,6 +143,7 @@
-
- # Configure libtool
- AM_PROG_LIBTOOL
-+ACX_LT_HOST_FLAGS
- AC_SUBST(enable_shared)
- AC_SUBST(enable_static)
- AM_MAINTAINER_MODE
---- origsrc/gcc-4.8-20130310/libatomic/configure.tgt 2013-01-14 12:16:23.000000000 -0600
-+++ src/gcc-4.8-20130310/libatomic/configure.tgt 2013-03-17 04:50:09.727033000 -0500
-@@ -108,7 +108,7 @@
- *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \
- | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
- | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
-- | *-*-darwin* | *-*-aix*)
-+ | *-*-darwin* | *-*-aix* | *-*-cygwin*)
- # POSIX system. The OS is supported.
- config_path="${config_path} posix"
- ;;
---- origsrc/gcc-4.8-20130310/libatomic/configure 2014-05-22 17:13:49.000000000 +0800
-+++ src/gcc-4.8-20130310/libatomic/configure 2014-05-24 12:40:30.720760000 +0800
-@@ -627,6 +627,7 @@
+ m4_include([../ltoptions.m4])
+diff --git a/libatomic/configure b/libatomic/configure
+index d707b09..58e1338 100755
+--- a/libatomic/configure
++++ b/libatomic/configure
+@@ -627,6 +627,7 @@ MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
enable_static
enable_shared
@@ -69,30 +70,28 @@
CPP
OTOOL64
OTOOL
-@@ -11019,7 +11020,7 @@
+@@ -11106,7 +11107,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
--#line 11022 "configure"
-+#line 11023 "configure"
+-#line 11109 "configure"
++#line 11110 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-@@ -11125,7 +11126,7 @@
+@@ -11212,7 +11213,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
--#line 11128 "configure"
-+#line 11129 "configure"
+-#line 11215 "configure"
++#line 11216 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-@@ -11363,6 +11364,28 @@
+@@ -11452,6 +11453,28 @@ CC="$lt_save_CC"
-+
-+
+case $host in
+ *-cygwin* | *-mingw*)
+ # 'host' will be top-level target in the case of a target lib,
@@ -113,6 +112,36 @@
+
+
+
-
-
++
++
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+diff --git a/libatomic/configure.ac b/libatomic/configure.ac
+index 9e8678d..f5db090 100644
+--- a/libatomic/configure.ac
++++ b/libatomic/configure.ac
+@@ -143,6 +143,7 @@ AC_PROG_INSTALL
+
+ # Configure libtool
+ AM_PROG_LIBTOOL
++ACX_LT_HOST_FLAGS
+ AC_SUBST(enable_shared)
+ AC_SUBST(enable_static)
+ AM_MAINTAINER_MODE
+diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
+index a3757ef..63db8ca 100644
+--- a/libatomic/configure.tgt
++++ b/libatomic/configure.tgt
+@@ -103,7 +103,7 @@ case "${target}" in
+ *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \
+ | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
+ | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
+- | *-*-darwin* | *-*-aix*)
++ | *-*-darwin* | *-*-aix* | *-*-cygwin* )
+ # POSIX system. The OS is supported.
+ config_path="${config_path} posix"
+ ;;
+--
+2.1.1
+
diff --git a/0009-support-64bit-cygwin-too.patch b/0009-support-64bit-cygwin-too.patch
new file mode 100644
index 0000000..6f0aa29
--- /dev/null
+++ b/0009-support-64bit-cygwin-too.patch
@@ -0,0 +1,25 @@
+From 93c59a2316a00efed4a10554774a37105d1e8fd1 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:11:25 +0800
+Subject: [PATCH 09/24] support 64bit cygwin too
+
+---
+ libffi/src/x86/ffi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libffi/src/x86/ffi.c b/libffi/src/x86/ffi.c
+index 611e221..6338de2 100644
+--- a/libffi/src/x86/ffi.c
++++ b/libffi/src/x86/ffi.c
+@@ -28,7 +28,7 @@
+ DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+-#if !defined(__x86_64__) || defined(_WIN64)
++#if !defined(__x86_64__) || defined(_WIN64) || defined(__CYGWIN__)
+
+ #ifdef _WIN64
+ #include <windows.h>
+--
+2.1.1
+
diff --git a/gcc47-libffi-noinst.patch b/0010-Avoid-installing-libffi.patch
index 3ac66ea..91c3d65 100644
--- a/gcc47-libffi-noinst.patch
+++ b/0010-Avoid-installing-libffi.patch
@@ -1,9 +1,19 @@
+From 2531e7511954dda8b211be38e37919a4cc0a9dd4 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:16:44 +0800
+Subject: [PATCH 10/24] Avoid installing libffi
+
Only the convenience library is used in libjava, and the bundled version
is usually a few releases behind the standalone version.
+---
+ Makefile.in | 6 ------
+ 1 file changed, 6 deletions(-)
---- origsrc/gcc-4.7.2/Makefile.in 2012-08-06 09:34:27.000000000 -0500
-+++ src/gcc-4.7.2/Makefile.in 2013-03-10 21:27:05.825568600 -0500
-@@ -1573,7 +1573,6 @@ install-info-target: maybe-install-info-
+diff --git a/Makefile.in b/Makefile.in
+index 6dd5802..920f5ac 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1606,7 +1606,6 @@ install-info-target: maybe-install-info-target-libgo
install-info-target: maybe-install-info-target-libtermcap
install-info-target: maybe-install-info-target-winsup
install-info-target: maybe-install-info-target-libgloss
@@ -11,7 +21,7 @@ is usually a few releases behind the standalone version.
install-info-target: maybe-install-info-target-libjava
install-info-target: maybe-install-info-target-zlib
install-info-target: maybe-install-info-target-boehm-gc
-@@ -1651,7 +1650,6 @@ install-pdf-target: maybe-install-pdf-ta
+@@ -1689,7 +1688,6 @@ install-pdf-target: maybe-install-pdf-target-libgo
install-pdf-target: maybe-install-pdf-target-libtermcap
install-pdf-target: maybe-install-pdf-target-winsup
install-pdf-target: maybe-install-pdf-target-libgloss
@@ -19,7 +29,7 @@ is usually a few releases behind the standalone version.
install-pdf-target: maybe-install-pdf-target-libjava
install-pdf-target: maybe-install-pdf-target-zlib
install-pdf-target: maybe-install-pdf-target-boehm-gc
-@@ -1729,7 +1727,6 @@ install-html-target: maybe-install-html-
+@@ -1772,7 +1770,6 @@ install-html-target: maybe-install-html-target-libgo
install-html-target: maybe-install-html-target-libtermcap
install-html-target: maybe-install-html-target-winsup
install-html-target: maybe-install-html-target-libgloss
@@ -27,7 +37,7 @@ is usually a few releases behind the standalone version.
install-html-target: maybe-install-html-target-libjava
install-html-target: maybe-install-html-target-zlib
install-html-target: maybe-install-html-target-boehm-gc
-@@ -1807,7 +1804,6 @@ installcheck-target: maybe-installcheck-
+@@ -1855,7 +1852,6 @@ installcheck-target: maybe-installcheck-target-libgo
installcheck-target: maybe-installcheck-target-libtermcap
installcheck-target: maybe-installcheck-target-winsup
installcheck-target: maybe-installcheck-target-libgloss
@@ -35,7 +45,7 @@ is usually a few releases behind the standalone version.
installcheck-target: maybe-installcheck-target-libjava
installcheck-target: maybe-installcheck-target-zlib
installcheck-target: maybe-installcheck-target-boehm-gc
-@@ -2402,7 +2398,6 @@ install-target: \
+@@ -2481,7 +2477,6 @@ install-target: \
maybe-install-target-libtermcap \
maybe-install-target-winsup \
maybe-install-target-libgloss \
@@ -43,7 +53,7 @@ is usually a few releases behind the standalone version.
maybe-install-target-libjava \
maybe-install-target-zlib \
maybe-install-target-boehm-gc \
-@@ -2500,7 +2495,6 @@ install-strip-target: \
+@@ -2584,7 +2579,6 @@ install-strip-target: \
maybe-install-strip-target-libtermcap \
maybe-install-strip-target-winsup \
maybe-install-strip-target-libgloss \
@@ -51,3 +61,6 @@ is usually a few releases behind the standalone version.
maybe-install-strip-target-libjava \
maybe-install-strip-target-zlib \
maybe-install-strip-target-boehm-gc \
+--
+2.1.1
+
diff --git a/0011-libitm-libtool-fixes-for-Cygwin.patch b/0011-libitm-libtool-fixes-for-Cygwin.patch
new file mode 100644
index 0000000..aa8a6e3
--- /dev/null
+++ b/0011-libitm-libtool-fixes-for-Cygwin.patch
@@ -0,0 +1,115 @@
+From d20aa5cbede139c08faa87f1942dfcd5348b62df Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:22:03 +0800
+Subject: [PATCH 11/24] libitm libtool fixes for Cygwin
+
+---
+ libitm/Makefile.am | 2 +-
+ libitm/Makefile.in | 3 ++-
+ libitm/aclocal.m4 | 1 +
+ libitm/configure | 23 +++++++++++++++++++++++
+ libitm/configure.ac | 1 +
+ 5 files changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/libitm/Makefile.am b/libitm/Makefile.am
+index 1dce82d..0ea39f2 100644
+--- a/libitm/Makefile.am
++++ b/libitm/Makefile.am
+@@ -54,7 +54,7 @@ libitm_version_info = -version-info $(libtool_VERSION)
+ # want or need libstdc++.
+ libitm_la_DEPENDENCIES = $(libitm_version_dep)
+ libitm_la_LINK = $(LINK) $(libitm_la_LDFLAGS)
+-libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script)
++libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) $(lt_host_flags)
+
+ libitm_la_SOURCES = \
+ aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc barrier.cc beginend.cc \
+diff --git a/libitm/Makefile.in b/libitm/Makefile.in
+index 6c4d253..5898bd8 100644
+--- a/libitm/Makefile.in
++++ b/libitm/Makefile.in
+@@ -279,6 +279,7 @@ libtool_VERSION = @libtool_VERSION@
+ link_itm = @link_itm@
+ localedir = @localedir@
+ localstatedir = @localstatedir@
++lt_host_flags = @lt_host_flags@
+ mandir = @mandir@
+ mkdir_p = @mkdir_p@
+ multi_basedir = @multi_basedir@
+@@ -329,7 +330,7 @@ libitm_version_info = -version-info $(libtool_VERSION)
+ # want or need libstdc++.
+ libitm_la_DEPENDENCIES = $(libitm_version_dep)
+ libitm_la_LINK = $(LINK) $(libitm_la_LDFLAGS)
+-libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script)
++libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) $(lt_host_flags)
+ libitm_la_SOURCES = aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc \
+ barrier.cc beginend.cc clone.cc eh_cpp.cc local.cc query.cc \
+ retry.cc rwlock.cc useraction.cc util.cc sjlj.S tls.cc \
+diff --git a/libitm/aclocal.m4 b/libitm/aclocal.m4
+index 625404e..4be0d43 100644
+--- a/libitm/aclocal.m4
++++ b/libitm/aclocal.m4
+@@ -996,6 +996,7 @@ m4_include([../config/depstand.m4])
+ m4_include([../config/enable.m4])
+ m4_include([../config/futex.m4])
+ m4_include([../config/lead-dot.m4])
++m4_include([../config/lthostflags.m4])
+ m4_include([../config/mmap.m4])
+ m4_include([../config/multi.m4])
+ m4_include([../config/override.m4])
+diff --git a/libitm/configure b/libitm/configure
+index ce6d50a..fe5c8ae 100644
+--- a/libitm/configure
++++ b/libitm/configure
+@@ -630,6 +630,7 @@ MAINTAINER_MODE_FALSE
+ MAINTAINER_MODE_TRUE
+ enable_static
+ enable_shared
++lt_host_flags
+ CXXCPP
+ CPP
+ OTOOL64
+@@ -15147,6 +15148,28 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
++case $host in
++ *-cygwin* | *-mingw*)
++ # 'host' will be top-level target in the case of a target lib,
++ # we must compare to with_cross_host to decide if this is a native
++ # or cross-compiler and select where to install dlls appropriately.
++ if test -n "$with_cross_host" &&
++ test x"$with_cross_host" != x"no"; then
++ lt_host_flags='-no-undefined -bindir "$(toolexeclibdir)"';
++ else
++ lt_host_flags='-no-undefined -bindir "$(bindir)"';
++ fi
++ ;;
++ *)
++ lt_host_flags=
++ ;;
++esac
++
++
++
++
++
++
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+diff --git a/libitm/configure.ac b/libitm/configure.ac
+index 70feff2..17a13ba 100644
+--- a/libitm/configure.ac
++++ b/libitm/configure.ac
+@@ -147,6 +147,7 @@ AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes")
+
+ # Configure libtool
+ AM_PROG_LIBTOOL
++ACX_LT_HOST_FLAGS
+ AC_SUBST(enable_shared)
+ AC_SUBST(enable_static)
+
+--
+2.1.1
+
diff --git a/0012-Cygwin-uses-sysv-ABI-on-x86_64.patch b/0012-Cygwin-uses-sysv-ABI-on-x86_64.patch
new file mode 100644
index 0000000..7bb9928
--- /dev/null
+++ b/0012-Cygwin-uses-sysv-ABI-on-x86_64.patch
@@ -0,0 +1,115 @@
+From 45d9322ca504239a11f49b3a9d58916cc3fb1d6d Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:31:06 +0800
+Subject: [PATCH 12/24] Cygwin uses sysv ABI on x86_64
+
+---
+ gcc/builtin-attrs.def | 3 +++
+ gcc/gtm-builtins.def | 2 +-
+ libitm/configure.tgt | 2 +-
+ libitm/libitm.h | 3 ++-
+ libitm/libitm_i.h | 6 ++++--
+ 5 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def
+index 593df2d..a707d0a 100644
+--- a/gcc/builtin-attrs.def
++++ b/gcc/builtin-attrs.def
+@@ -108,6 +108,7 @@ DEF_ATTR_IDENT (ATTR_TYPEGENERIC, "type generic")
+ DEF_ATTR_IDENT (ATTR_TM_REGPARM, "*tm regparm")
+ DEF_ATTR_IDENT (ATTR_TM_TMPURE, "transaction_pure")
+ DEF_ATTR_IDENT (ATTR_RETURNS_TWICE, "returns_twice")
++DEF_ATTR_IDENT (ATTR_SYSV_ABI, "sysv_abi")
+
+ DEF_ATTR_TREE_LIST (ATTR_NOVOPS_LIST, ATTR_NOVOPS, ATTR_NULL, ATTR_NULL)
+
+@@ -259,6 +260,8 @@ DEF_ATTR_TREE_LIST (ATTR_TM_CONST_NOTHROW_LIST,
+ ATTR_TM_REGPARM, ATTR_NULL, ATTR_CONST_NOTHROW_LIST)
+ DEF_ATTR_TREE_LIST (ATTR_TM_NOTHROW_RT_LIST,
+ ATTR_RETURNS_TWICE, ATTR_NULL, ATTR_TM_NOTHROW_LIST)
++DEF_ATTR_TREE_LIST (ATTR_TM_NOTHROW_RT_SYSV_LIST,
++ ATTR_SYSV_ABI, ATTR_NULL, ATTR_TM_NOTHROW_RT_LIST)
+
+ /* Same attributes used for BUILT_IN_MALLOC except with TM_PURE thrown in. */
+ DEF_ATTR_TREE_LIST (ATTR_TMPURE_MALLOC_NOTHROW_LIST,
+diff --git a/gcc/gtm-builtins.def b/gcc/gtm-builtins.def
+index e2bc081..08cf597 100644
+--- a/gcc/gtm-builtins.def
++++ b/gcc/gtm-builtins.def
+@@ -1,5 +1,5 @@
+ DEF_TM_BUILTIN (BUILT_IN_TM_START, "_ITM_beginTransaction",
+- BT_FN_UINT32_UINT32_VAR, ATTR_TM_NOTHROW_RT_LIST)
++ BT_FN_UINT32_UINT32_VAR, ATTR_TM_NOTHROW_RT_SYSV_LIST)
+
+ DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT, "_ITM_commitTransaction",
+ BT_FN_VOID, ATTR_TM_NOTHROW_LIST)
+diff --git a/libitm/configure.tgt b/libitm/configure.tgt
+index bd95509..8bb9bdc 100644
+--- a/libitm/configure.tgt
++++ b/libitm/configure.tgt
+@@ -141,7 +141,7 @@ case "${target}" in
+ *-*-gnu* | *-*-k*bsd*-gnu \
+ | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
+ | *-*-solaris2* | *-*-sysv4* | *-*-hpux11* \
+- | *-*-darwin* | *-*-aix*)
++ | *-*-darwin* | *-*-aix* | *-*-cygwin*)
+ # POSIX system. The OS is supported.
+ ;;
+
+diff --git a/libitm/libitm.h b/libitm/libitm.h
+index b15b68c..0ee9db5 100644
+--- a/libitm/libitm.h
++++ b/libitm/libitm.h
+@@ -45,6 +45,7 @@ extern "C" {
+
+ #define ITM_NORETURN __attribute__((noreturn))
+ #define ITM_PURE __attribute__((transaction_pure))
++#define ITM_SYSV __attribute__((sysv_abi))
+
+ /* The following are externally visible definitions and functions, though
+ only very few of these should be called by user code. */
+@@ -145,7 +146,7 @@ typedef uint64_t _ITM_transactionId_t; /* Transaction identifier */
+
+ extern _ITM_transactionId_t _ITM_getTransactionId(void) ITM_REGPARM;
+
+-extern uint32_t _ITM_beginTransaction(uint32_t, ...) ITM_REGPARM;
++extern uint32_t _ITM_beginTransaction(uint32_t, ...) ITM_REGPARM ITM_SYSV;
+
+ extern void _ITM_abortTransaction(_ITM_abortReason) ITM_REGPARM ITM_NORETURN;
+
+diff --git a/libitm/libitm_i.h b/libitm/libitm_i.h
+index 7c24493..81f30e9 100644
+--- a/libitm/libitm_i.h
++++ b/libitm/libitm_i.h
+@@ -39,8 +39,10 @@
+ #include "local_type_traits"
+ #include "local_atomic"
+
++#ifndef __CYGWIN__
+ /* Don't require libgcc_s.so for exceptions. */
+ extern void _Unwind_DeleteException (_Unwind_Exception*) __attribute__((weak));
++#endif
+
+
+ #include "common.h"
+@@ -289,7 +291,7 @@ struct gtm_thread
+ // Invoked from assembly language, thus the "asm" specifier on
+ // the name, avoiding complex name mangling.
+ static uint32_t begin_transaction(uint32_t, const gtm_jmpbuf *)
+- __asm__(UPFX "GTM_begin_transaction") ITM_REGPARM;
++ __asm__(UPFX "GTM_begin_transaction") ITM_REGPARM ITM_SYSV;
+ // In eh_cpp.cc
+ void revert_cpp_exceptions (gtm_transaction_cp *cp = 0);
+
+@@ -322,7 +324,7 @@ namespace GTM HIDDEN {
+ extern uint64_t gtm_spin_count_var;
+
+ extern "C" uint32_t GTM_longjmp (uint32_t, const gtm_jmpbuf *, uint32_t)
+- ITM_NORETURN ITM_REGPARM;
++ ITM_NORETURN ITM_REGPARM ITM_SYSV;
+
+ extern "C" void GTM_LB (const void *, size_t) ITM_REGPARM;
+
+--
+2.1.1
+
diff --git a/gcc48-lto-plugin-soname.patch b/0013-Do-not-version-lto-plugin-on-cygwin-mingw.patch
index 2ca18db..32672d6 100644
--- a/gcc48-lto-plugin-soname.patch
+++ b/0013-Do-not-version-lto-plugin-on-cygwin-mingw.patch
@@ -1,5 +1,18 @@
---- origsrc/gcc-4.8-20130310/gcc/config.host 2013-03-17 02:15:46.575313400 -0500
-+++ src/gcc-4.8-20130310/gcc/config.host 2013-03-17 03:10:31.035640300 -0500
+From 260400b3f81d536910460b3e4f7d96bbe23c6040 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:35:02 +0800
+Subject: [PATCH 13/24] Do not version lto plugin on cygwin/mingw
+
+---
+ gcc/config.host | 6 +++---
+ lto-plugin/Makefile.am | 2 +-
+ lto-plugin/Makefile.in | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config.host b/gcc/config.host
+index bea17bc..a85d8b2 100644
+--- a/gcc/config.host
++++ b/gcc/config.host
@@ -219,14 +219,14 @@ case ${host} in
out_host_hook_obj=host-cygwin.o
host_xmake_file="${host_xmake_file} i386/x-cygwin"
@@ -26,25 +39,32 @@
;;
i[34567]86-*-uwin*)
echo "*** UWIN may not be used as a host platform because"
---- origsrc/gcc-4.8-20130310/lto-plugin/Makefile.am 2011-08-10 03:48:37.000000000 -0500
-+++ src/gcc-4.8-20130310/lto-plugin/Makefile.am 2013-03-17 03:11:08.995692600 -0500
-@@ -22,7 +22,7 @@ liblto_plugin_la_SOURCES = lto-plugin.c
- liblto_plugin_la_LIBADD = \
+diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
+index e3391bc..2c5c738 100644
+--- a/lto-plugin/Makefile.am
++++ b/lto-plugin/Makefile.am
+@@ -24,7 +24,7 @@ liblto_plugin_la_LIBADD = \
$(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,)
# Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
--liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -bindir $(libexecsubdir) \
-+liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \
+ liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
+- $(lt_host_flags) -module -bindir $(libexecsubdir) \
++ $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a)
liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)
---- origsrc/gcc-4.8-20130310/lto-plugin/Makefile.in 2011-08-10 03:48:37.000000000 -0500
-+++ src/gcc-4.8-20130310/lto-plugin/Makefile.in 2013-03-17 03:12:11.625779100 -0500
-@@ -242,7 +242,7 @@ liblto_plugin_la_LIBADD = \
- $(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,)
+diff --git a/lto-plugin/Makefile.in b/lto-plugin/Makefile.in
+index a70de62..a571877 100644
+--- a/lto-plugin/Makefile.in
++++ b/lto-plugin/Makefile.in
+@@ -245,7 +245,7 @@ liblto_plugin_la_LIBADD = \
# Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
--liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -bindir $(libexecsubdir) \
-+liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \
+ liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
+- $(lt_host_flags) -module -bindir $(libexecsubdir) \
++ $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a)
liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
+--
+2.1.1
+
diff --git a/0014-add-dummy-pthread-tsaware-and-large-address-aware-fo.patch b/0014-add-dummy-pthread-tsaware-and-large-address-aware-fo.patch
new file mode 100644
index 0000000..3cdeefc
--- /dev/null
+++ b/0014-add-dummy-pthread-tsaware-and-large-address-aware-fo.patch
@@ -0,0 +1,115 @@
+From dc7a7ec03f889efe7fc10a3071c20527272f7564 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:44:48 +0800
+Subject: [PATCH 14/24] add dummy -pthread, -tsaware and --large-address-aware
+ for executables only
+
+---
+ gcc/config.gcc | 4 ++--
+ gcc/config/i386/cygwin.h | 6 +++++-
+ gcc/config/i386/cygwin-w64.h | 4 +++-
+ gcc/config/i386/cygwin.opt | 28 ++++++++++++++++++++++++++++
+ 4 files changed, 38 insertions(+), 4 deletions(-)
+ create mode 100644 gcc/config/i386/cygwin.opt
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+--- a/gcc/config.gcc 2015-02-16 15:56:43.460029500 -0600
++++ b/gcc/config.gcc 2015-02-16 15:57:04.754233500 -0600
+@@ -1586,7 +1586,7 @@
+ xm_file=i386/xm-cygwin.h
+ tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
+ target_gtfiles="\$(srcdir)/config/i386/winnt.c"
+- extra_options="${extra_options} i386/cygming.opt"
++ extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
+ extra_objs="winnt.o winnt-stubs.o"
+ c_target_objs="${c_target_objs} msformat-c.o"
+ cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
+@@ -1602,7 +1602,7 @@
+ xm_file=i386/xm-cygwin.h
+ tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64"
+ target_gtfiles="\$(srcdir)/config/i386/winnt.c"
+- extra_options="${extra_options} i386/cygming.opt"
++ extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
+ extra_objs="winnt.o winnt-stubs.o"
+ c_target_objs="${c_target_objs} msformat-c.o"
+ cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
+diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
+index 145e3cc..4e15ab0 100644
+--- a/gcc/config/i386/cygwin.h
++++ b/gcc/config/i386/cygwin.h
+@@ -77,12 +77,14 @@ along with GCC; see the file COPYING3. If not see
+ #undef LIB_SPEC
+ #define LIB_SPEC "\
+ %{pg:-lgmon} \
++ %{pthread: } \
+ -lcygwin \
+ %{mwindows:-lgdi32 -lcomdlg32} \
+ -ladvapi32 -lshell32 -luser32 -lkernel32"
+
+ /* To implement C++ function replacement we always wrap the cxx
+ malloc-like operators. See N2800 #17.6.4.6 [replacement.functions] */
++#undef CXX_WRAP_SPEC_LIST
+ #define CXX_WRAP_SPEC_LIST " \
+ --wrap _Znwj \
+ --wrap _Znaj \
+@@ -120,7 +122,9 @@ along with GCC; see the file COPYING3. If not see
+ %{shared: --shared} %{mdll:--dll} \
+ %{static:-Bstatic} %{!static:-Bdynamic} \
+ %{shared|mdll: --enable-auto-image-base -e __cygwin_dll_entry@12} \
+- --dll-search-prefix=cyg -tsaware"
++ --dll-search-prefix=cyg \
++ %{rdynamic: --export-all-symbols} \
++ %{!shared: %{!mdll: --large-address-aware --tsaware}}"
+
+ /* Binutils does not handle weak symbols from dlls correctly. For now,
+ do not use them unnecessarily in gthr-posix.h. */
+diff --git a/gcc/config/i386/cygwin-w64.h b/gcc/config/i386/cygwin-w64.h
+--- a/gcc/config/i386/cygwin-w64.h 2014-01-02 16:23:26.000000000 -0600
++++ b/gcc/config/i386/cygwin-w64.h 2015-02-22 11:46:46.871384100 -0600
+@@ -66,7 +66,9 @@ along with GCC; see the file COPYING3.
+ %{static:-Bstatic} %{!static:-Bdynamic} \
+ %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
+ %(shared_libgcc_undefs) \
+- --dll-search-prefix=cyg -tsaware"
++ --dll-search-prefix=cyg \
++ %{rdynamic: --export-all-symbols} \
++ %{!shared: %{!mdll: %{" SPEC_32 ":--large-address-aware} --tsaware}}"
+
+ /* Cygwin64 will have a 64-bit long type. */
+ #undef LONG_TYPE_SIZE
+diff --git a/gcc/config/i386/cygwin.opt b/gcc/config/i386/cygwin.opt
+new file mode 100644
+index 0000000..93458f0
+--- /dev/null
++++ b/gcc/config/i386/cygwin.opt
+@@ -0,0 +1,28 @@
++; Cygwin-specific options.
++
++; Copyright (C) 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
++;
++; This file is part of GCC.
++;
++; GCC is free software; you can redistribute it and/or modify it under
++; the terms of the GNU General Public License as published by the Free
++; Software Foundation; either version 3, or (at your option) any later
++; version.
++;
++; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
++; WARRANTY; without even the implied warranty of MERCHANTABILITY or
++; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++; for more details.
++;
++; You should have received a copy of the GNU General Public License
++; along with GCC; see the file COPYING3. If not see
++; <http://www.gnu.org/licenses/>.
++
++pthread
++Driver
++
++rdynamic
++Driver
++
++; Retain blank line above
++
+--
+2.1.1
diff --git a/0015-handle-dllimport-properly-in-medium-model.patch b/0015-handle-dllimport-properly-in-medium-model.patch
new file mode 100644
index 0000000..4de830e
--- /dev/null
+++ b/0015-handle-dllimport-properly-in-medium-model.patch
@@ -0,0 +1,35 @@
+From 508940bebe9d116a1452c1c0b515201929d0738f Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:52:21 +0800
+Subject: [PATCH 15/24] handle dllimport properly in medium model
+
+---
+ gcc/config/i386/predicates.md | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
+index 2ef1384..3fc6104 100644
+--- a/gcc/config/i386/predicates.md
++++ b/gcc/config/i386/predicates.md
+@@ -164,6 +164,7 @@
+ switch (XINT (XEXP (op, 0), 1))
+ {
+ case UNSPEC_GOTPCREL:
++ if (TARGET_PECOFF) break;
+ case UNSPEC_DTPOFF:
+ case UNSPEC_GOTNTPOFF:
+ case UNSPEC_NTPOFF:
+@@ -268,6 +269,10 @@
+ /* TLS symbols are not constant. */
+ if (SYMBOL_REF_TLS_MODEL (op))
+ return false;
++ /* Dll-imported symbols are always external. */
++ if (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op))
++ return false;
++
+ return (ix86_cmodel == CM_SMALL
+ || (ix86_cmodel == CM_MEDIUM
+ && !SYMBOL_REF_FAR_ADDR_P (op)));
+--
+2.1.1
+
diff --git a/0016-skip-test-for-cygwin-mingw.patch b/0016-skip-test-for-cygwin-mingw.patch
new file mode 100644
index 0000000..309283c
--- /dev/null
+++ b/0016-skip-test-for-cygwin-mingw.patch
@@ -0,0 +1,23 @@
+From 50ab7461ea28b3958a805965374d43f5c945d2c5 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 09:54:57 +0800
+Subject: [PATCH 16/24] skip test for cygwin/mingw
+
+---
+ gcc/testsuite/gcc.target/i386/pr25993.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/testsuite/gcc.target/i386/pr25993.c b/gcc/testsuite/gcc.target/i386/pr25993.c
+index b079e25..c30eaf5 100644
+--- a/gcc/testsuite/gcc.target/i386/pr25993.c
++++ b/gcc/testsuite/gcc.target/i386/pr25993.c
+@@ -1,5 +1,5 @@
+ /* { dg-do assemble } */
+-/* { dg-skip-if "" { "*-*-darwin*" "*-*-mingw*" } { "*" } { "" } } */
++/* { dg-skip-if "" { "*-*-darwin*" "*-*-mingw*" "*-*-cygwin*" } { "*" } { "" } } */
+ /* { dg-options "-std=c99 -x assembler-with-cpp" } */
+
+ #ifndef __ASSEMBLER__
+--
+2.1.1
+
diff --git a/0017-64bit-Cygwin-uses-SEH.patch b/0017-64bit-Cygwin-uses-SEH.patch
new file mode 100644
index 0000000..1f36fae
--- /dev/null
+++ b/0017-64bit-Cygwin-uses-SEH.patch
@@ -0,0 +1,301 @@
+From 99bbc5fbd35295bcf8f7f2d316b2b084fd24f691 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 10:01:33 +0800
+Subject: [PATCH 17/24] 64bit Cygwin uses SEH
+
+---
+ gcc/ada/seh_init.c | 15 +--
+ gcc/ada/system-cygwin-x86_64.ads | 198 +++++++++++++++++++++++++++++++++++++++
+ gcc/ada/tracebak.c | 2 +-
+ 3 files changed, 207 insertions(+), 8 deletions(-)
+ create mode 100644 gcc/ada/system-cygwin-x86_64.ads
+
+diff --git a/gcc/ada/seh_init.c b/gcc/ada/seh_init.c
+index 0d04b50..3c3d4a2 100644
+--- a/gcc/ada/seh_init.c
++++ b/gcc/ada/seh_init.c
+@@ -40,6 +40,7 @@
+ #define xmalloc(S) malloc (S)
+
+ #else
++#define FLEX_SCANNER /* do not poison malloc */
+ #include "config.h"
+ #include "system.h"
+ #endif
+@@ -64,7 +65,7 @@ extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *)
+ ATTRIBUTE_NORETURN;
+
+
+-#if defined (_WIN32)
++#if defined (_WIN32) || defined(__CYGWIN__)
+
+ #include <windows.h>
+ #include <excpt.h>
+@@ -170,7 +171,7 @@ __gnat_map_SEH (EXCEPTION_RECORD* ExceptionRecord, const char **msg)
+ }
+ }
+
+-#if !(defined (_WIN64) && defined (__SEH__))
++#if !(defined (__x86_64__) && defined (__SEH__))
+
+ EXCEPTION_DISPOSITION
+ __gnat_SEH_error_handler (struct _EXCEPTION_RECORD* ExceptionRecord,
+@@ -189,7 +190,7 @@ __gnat_SEH_error_handler (struct _EXCEPTION_RECORD* ExceptionRecord,
+ msg = "unhandled signal";
+ }
+
+-#if ! defined (_WIN64)
++#if !defined(_WIN64) && !defined(__CYGWIN__)
+ /* This call is important as it avoids locking the second time we catch a
+ signal. Note that this routine is documented as internal to Windows and
+ should not be used. */
+@@ -200,9 +201,9 @@ __gnat_SEH_error_handler (struct _EXCEPTION_RECORD* ExceptionRecord,
+
+ Raise_From_Signal_Handler (exception, msg);
+ }
+-#endif /* !(defined (_WIN64) && defined (__SEH__)) */
++#endif /* !(defined (__x86_64__) && defined (__SEH__)) */
+
+-#if defined (_WIN64)
++#if defined (__x86_64__)
+ /* On x86_64 windows exception mechanism is no more based on a chained list
+ of handlers addresses on the stack. Instead unwinding information is used
+ to retrieve the exception handler (similar to ZCX GCC mechanism). So in
+@@ -255,7 +256,7 @@ void __gnat_install_SEH_handler (void *eh ATTRIBUTE_UNUSED)
+ just above. */
+ }
+
+-#else /* defined (_WIN64) */
++#else /* defined (__x86_64__) */
+ /* Install the Win32 SEH exception handler. Note that the caller must have
+ allocated 8 bytes on the stack and pass the pointer to this stack
+ space. This is needed as the SEH exception handler must be on the stack of
+@@ -288,7 +289,7 @@ __gnat_install_SEH_handler (void *ER)
+ }
+ #endif
+
+-#else /* defined (_WIN32) */
++#else /* defined (_WIN32) || defined(__CYGWIN__) */
+ /* For all non Windows targets we provide a dummy SEH install handler. */
+ void __gnat_install_SEH_handler (void *eh ATTRIBUTE_UNUSED)
+ {
+diff --git a/gcc/ada/system-cygwin-x86_64.ads b/gcc/ada/system-cygwin-x86_64.ads
+new file mode 100644
+index 0000000..9305ec1
+--- /dev/null
++++ b/gcc/ada/system-cygwin-x86_64.ads
+@@ -0,0 +1,198 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME COMPONENTS --
++-- --
++-- S Y S T E M --
++-- --
++-- S p e c --
++-- (Cygwin Version) --
++-- --
++-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
++-- --
++-- This specification is derived from the Ada Reference Manual for use with --
++-- GNAT. The copyright notice above, and the license provisions that follow --
++-- apply solely to the contents of the part following the private keyword. --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
++-- for more details. You should have received a copy of the GNU General --
++-- Public License distributed with GNAT; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++------------------------------------------------------------------------------
++
++package System is
++ pragma Pure;
++ -- Note that we take advantage of the implementation permission to make
++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
++ -- 2005, this is Pure in any case (AI-362).
++
++ type Name is (SYSTEM_NAME_GNAT);
++ System_Name : constant Name := SYSTEM_NAME_GNAT;
++
++ -- System-Dependent Named Numbers
++
++ Min_Int : constant := Long_Long_Integer'First;
++ Max_Int : constant := Long_Long_Integer'Last;
++
++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
++
++ Max_Base_Digits : constant := Long_Long_Float'Digits;
++ Max_Digits : constant := Long_Long_Float'Digits;
++
++ Max_Mantissa : constant := 63;
++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
++
++ Tick : constant := 0.01;
++
++ -- Storage-related Declarations
++
++ type Address is private;
++ pragma Preelaborable_Initialization (Address);
++ Null_Address : constant Address;
++
++ Storage_Unit : constant := 8;
++ Word_Size : constant := 64;
++ Memory_Size : constant := 2 ** 64;
++
++ -- Address comparison
++
++ function "<" (Left, Right : Address) return Boolean;
++ function "<=" (Left, Right : Address) return Boolean;
++ function ">" (Left, Right : Address) return Boolean;
++ function ">=" (Left, Right : Address) return Boolean;
++ function "=" (Left, Right : Address) return Boolean;
++
++ pragma Import (Intrinsic, "<");
++ pragma Import (Intrinsic, "<=");
++ pragma Import (Intrinsic, ">");
++ pragma Import (Intrinsic, ">=");
++ pragma Import (Intrinsic, "=");
++
++ -- Other System-Dependent Declarations
++
++ type Bit_Order is (High_Order_First, Low_Order_First);
++ Default_Bit_Order : constant Bit_Order := Low_Order_First;
++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
++
++ -- Priority-related Declarations (RM D.1)
++
++ Max_Priority : constant Positive := 30;
++ Max_Interrupt_Priority : constant Positive := 31;
++
++ subtype Any_Priority is Integer range 0 .. 31;
++ subtype Priority is Any_Priority range 0 .. 30;
++ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
++
++ Default_Priority : constant Priority := 15;
++
++private
++
++ type Address is mod Memory_Size;
++ Null_Address : constant Address := 0;
++
++ --------------------------------------
++ -- System Implementation Parameters --
++ --------------------------------------
++
++ -- These parameters provide information about the target that is used
++ -- by the compiler. They are in the private part of System, where they
++ -- can be accessed using the special circuitry in the Targparm unit
++ -- whose source should be consulted for more detailed descriptions
++ -- of the individual switch values.
++
++ Backend_Divide_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := False;
++ Command_Line_Args : constant Boolean := True;
++ Configurable_Run_Time : constant Boolean := False;
++ Denorm : constant Boolean := True;
++ Duration_32_Bits : constant Boolean := False;
++ Exit_Status_Supported : constant Boolean := True;
++ Fractional_Fixed_Ops : constant Boolean := False;
++ Frontend_Layout : constant Boolean := False;
++ Machine_Overflows : constant Boolean := False;
++ Machine_Rounds : constant Boolean := True;
++ Preallocated_Stacks : constant Boolean := False;
++ Signed_Zeros : constant Boolean := True;
++ Stack_Check_Default : constant Boolean := False;
++ Stack_Check_Probes : constant Boolean := True;
++ Stack_Check_Limits : constant Boolean := False;
++ Support_64_Bit_Divides : constant Boolean := True;
++ Support_Aggregates : constant Boolean := True;
++ Support_Composite_Assign : constant Boolean := True;
++ Support_Composite_Compare : constant Boolean := True;
++ Support_Long_Shifts : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := True;
++ Suppress_Standard_Library : constant Boolean := False;
++ Use_Ada_Main_Program_Name : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := True;
++
++ ---------------------------
++ -- Underlying Priorities --
++ ---------------------------
++
++ -- Important note: this section of the file must come AFTER the
++ -- definition of the system implementation parameters to ensure
++ -- that the value of these parameters is available for analysis
++ -- of the declarations here (using Rtsfind at compile time).
++
++ -- The underlying priorities table provides a generalized mechanism
++ -- for mapping from Ada priorities to system priorities. In some
++ -- cases a 1-1 mapping is not the convenient or optimal choice.
++
++ type Priorities_Mapping is array (Any_Priority) of Integer;
++ pragma Suppress_Initialization (Priorities_Mapping);
++ -- Suppress initialization in case gnat.adc specifies Normalize_Scalars
++
++ Underlying_Priorities : constant Priorities_Mapping :=
++ (Priority'First ..
++ Default_Priority - 8 => -15,
++ Default_Priority - 7 => -7,
++ Default_Priority - 6 => -6,
++ Default_Priority - 5 => -5,
++ Default_Priority - 4 => -4,
++ Default_Priority - 3 => -3,
++ Default_Priority - 2 => -2,
++ Default_Priority - 1 => -1,
++ Default_Priority => 0,
++ Default_Priority + 1 => 1,
++ Default_Priority + 2 => 2,
++ Default_Priority + 3 => 3,
++ Default_Priority + 4 => 4,
++ Default_Priority + 5 => 5,
++ Default_Priority + 6 ..
++ Priority'Last => 6,
++ Interrupt_Priority => 15);
++ -- The default mapping preserves the standard 31 priorities of the Ada
++ -- model, but maps them using compression onto the 7 priority levels
++ -- available in NT and on the 16 priority levels available in 2000/XP.
++
++ -- To replace the default values of the Underlying_Priorities mapping,
++ -- copy this source file into your build directory, edit the file to
++ -- reflect your desired behavior, and recompile using Makefile.adalib
++ -- which can be found under the adalib directory of your gnat installation
++
++ pragma Linker_Options ("-Wl,--stack=0x2000000");
++ -- This is used to change the default stack (32 MB) size for non tasking
++ -- programs. We change this value for GNAT on Windows here because the
++ -- binutils on this platform have switched to a too low value for Ada
++ -- programs. Note that we also set the stack size for tasking programs in
++ -- System.Task_Primitives.Operations.
++
++end System;
+diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c
+index 4efb75e..1964c4f 100644
+--- a/gcc/ada/tracebak.c
++++ b/gcc/ada/tracebak.c
+@@ -107,7 +107,7 @@ extern void (*Unlock_Task) (void);
+
+ #include "tb-ivms.c"
+
+-#elif defined (_WIN64) && defined (__SEH__)
++#elif (defined (_WIN64) || defined(__CYGWIN__)) && defined (__SEH__)
+
+ #include <windows.h>
+
+--
+2.1.1
+
diff --git a/0018-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch b/0018-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch
new file mode 100644
index 0000000..65445ac
--- /dev/null
+++ b/0018-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch
@@ -0,0 +1,31 @@
+From 1c62a1c941ba6c700d8a01f3797946e629cdc340 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 10:05:50 +0800
+Subject: [PATCH 18/24] define RTS_CONTROL_ENABLE and DTR_CONTROL_ENABLE for
+ Cygwin
+
+---
+ gcc/ada/s-oscons-tmplt.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
+index 5a034d5..6f678bd 100644
+--- a/gcc/ada/s-oscons-tmplt.c
++++ b/gcc/ada/s-oscons-tmplt.c
+@@ -986,7 +986,12 @@ CND(VEOL2, "Alternative EOL")
+
+ #endif /* HAVE_TERMIOS */
+
+-#ifdef __MINGW32__
++#ifdef __CYGWIN__
++#define RTS_CONTROL_ENABLE 0x1
++#define DTR_CONTROL_ENABLE 0x1
++#endif
++
++#if defined (__CYGWIN__) || defined (__MINGW32__)
+ CNU(DTR_CONTROL_ENABLE, "Enable DTR flow ctrl")
+ CNU(RTS_CONTROL_ENABLE, "Enable RTS flow ctrl")
+ #endif
+--
+2.1.1
+
diff --git a/gcc48-Wimplicit-decls.patch b/0019-fix-some-implicit-declaration-warnings.patch
index f21c360..678fdc6 100644
--- a/gcc48-Wimplicit-decls.patch
+++ b/0019-fix-some-implicit-declaration-warnings.patch
@@ -1,6 +1,18 @@
---- origsrc/gcc-4.8.2/libiberty/aclocal.m4 2013-11-17 03:48:36.190725600 -0600
-+++ src/gcc-4.8.2/libiberty/aclocal.m4 2013-11-16 23:57:59.000000000 -0600
-@@ -15,6 +15,8 @@ AC_CACHE_CHECK([for working strncmp], ac
+From 9d2689cee7e62d9f996d4cfdbb1dcb728455702a Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 10:08:25 +0800
+Subject: [PATCH 19/24] fix some implicit declaration warnings
+
+---
+ libiberty/aclocal.m4 | 6 +++++-
+ libiberty/configure | 3 +++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
+index bf8a907..6b5e66c 100644
+--- a/libiberty/aclocal.m4
++++ b/libiberty/aclocal.m4
+@@ -15,6 +15,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works,
/* Test by Jim Wilson and Kaveh Ghazi.
Check whether strncmp reads past the end of its string parameters. */
#include <sys/types.h>
@@ -20,9 +32,11 @@
{
static char *addr = 0;
auto char dummy;
---- origsrc/gcc-4.8.2/libiberty/configure 2013-11-17 03:48:36.197726000 -0600
-+++ src/gcc-4.8.2/libiberty/configure 2013-11-16 23:57:59.000000000 -0600
-@@ -6069,6 +6069,7 @@ else
+diff --git a/libiberty/configure b/libiberty/configure
+index 7bde9b3..1b9f1ec 100755
+--- a/libiberty/configure
++++ b/libiberty/configure
+@@ -6077,6 +6077,7 @@ else
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -30,7 +44,7 @@
find_stack_direction ()
{
static char *addr = 0;
-@@ -6838,6 +6839,8 @@ else
+@@ -6846,6 +6847,8 @@ else
/* Test by Jim Wilson and Kaveh Ghazi.
Check whether strncmp reads past the end of its string parameters. */
#include <sys/types.h>
@@ -39,3 +53,6 @@
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+--
+2.1.1
+
diff --git a/0020-fix-gnat-DLL-prefix-for-Cygwin.patch b/0020-fix-gnat-DLL-prefix-for-Cygwin.patch
new file mode 100644
index 0000000..3545efb
--- /dev/null
+++ b/0020-fix-gnat-DLL-prefix-for-Cygwin.patch
@@ -0,0 +1,234 @@
+From 0b06ec18e73dff59d5c5f84b27aa5a09e8b0914b Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 28 Jun 2014 10:16:07 +0800
+Subject: [PATCH 20/24] fix gnat DLL prefix for Cygwin
+
+---
+ gcc/ada/gcc-interface/Makefile.in | 100 ++++++++++++++++++++------------------
+ 1 file changed, 52 insertions(+), 48 deletions(-)
+
+diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
+index e2cc4a9..6deebdf 100644
+--- a/gcc/ada/gcc-interface/Makefile.in
++++ b/gcc/ada/gcc-interface/Makefile.in
+@@ -124,12 +124,13 @@ GMEM_LIB =
+ MISCLIB =
+ OUTPUT_OPTION = -o $@
+
+-objext = .o
+-exeext =
+-arext = .a
+-soext = .so
+-shext =
+-hyphen = -
++objext = .o
++exeext =
++arext = .a
++soext = .so
++shext =
++hyphen = -
++soprefix = lib
+
+ # Define this as & to perform parallel make on a Sequent.
+ # Note that this has some bugs, and it seems currently necessary
+@@ -1771,6 +1772,9 @@ ifeq ($(strip $(filter-out cygwin% mingw32% pe,$(target_os))),)
+ EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
+ soext = .dll
+ LIBRARY_VERSION := $(LIB_VERSION)
++ ifeq ($(strip $(filter-out cygwin%,$(target_os))),)
++ soprefix = cyg
++ endif
+ endif
+
+ # Mips Linux
+@@ -2675,16 +2679,16 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
+ # Also install the .dSYM directories if they exist (these directories
+ # contain the debug information for the shared libraries on darwin)
+ for file in gnat gnarl; do \
+- if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
+- $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ if [ -f $(RTSDIR)/cyg$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
++ $(INSTALL) $(RTSDIR)/${soprefix}$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ fi; \
+- if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
+- $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+- $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
++ if [ -f $(RTSDIR)/${soprefix}$${file}$(soext) ]; then \
++ $(LN_S) ${soprefix}$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ $(DESTDIR)$(ADA_RTL_OBJ_DIR)/${soprefix}$${file}$(soext); \
+ fi; \
+- if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
+- $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
++ if [ -d $(RTSDIR)/${soprefix}$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
++ $(CP) -r $(RTSDIR)/${soprefix}$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
+ $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ fi; \
+ done
+@@ -2816,25 +2820,25 @@ gnatlib-shared-default:
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+- $(RM) $(RTSDIR)/libgna*$(soext)
++ $(RM) $(RTSDIR)/${soprefix}gna*$(soext)
+ cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
+ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
+ $(PICFLAG_FOR_TARGET) \
+- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ -o ${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
+- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ $(SO_OPTS)${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(MISCLIB) -lm
+ cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
+ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
+ $(PICFLAG_FOR_TARGET) \
+- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ -o ${soprefix}gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_TASKING_OBJS) \
+- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ $(SO_OPTS)cyggnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(THREADSLIB)
+- cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+- libgnat$(soext)
+- cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+- libgnarl$(soext)
++ cd $(RTSDIR); $(LN_S) ${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ ${soprefix}gnat$(soext)
++ cd $(RTSDIR); $(LN_S) cyggnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ ${soprefix}gnarl$(soext)
+
+ gnatlib-shared-dual:
+ $(MAKE) $(FLAGS_TO_PASS) \
+@@ -2844,7 +2848,7 @@ gnatlib-shared-dual:
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib-shared-default
+- $(MV) $(RTSDIR)/libgna*$(soext) .
++ $(MV) $(RTSDIR)/${soprefix}gna*$(soext) .
+ $(RM) ../stamp-gnatlib2-$(RTSDIR)
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+@@ -2853,7 +2857,7 @@ gnatlib-shared-dual:
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+- $(MV) libgna*$(soext) $(RTSDIR)
++ $(MV) ${soprefix}gna*$(soext) $(RTSDIR)
+
+ gnatlib-shared-dual-win32:
+ $(MAKE) $(FLAGS_TO_PASS) \
+@@ -2864,7 +2868,7 @@ gnatlib-shared-dual-win32:
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib-shared-win32
+- $(MV) $(RTSDIR)/libgna*$(soext) .
++ $(MV) $(RTSDIR)/${soprefix}gna*$(soext) .
+ $(RM) ../stamp-gnatlib2-$(RTSDIR)
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+@@ -2873,7 +2877,7 @@ gnatlib-shared-dual-win32:
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+- $(MV) libgna*$(soext) $(RTSDIR)
++ $(MV) ${soprefix}gna*$(soext) $(RTSDIR)
+
+ # ??? we need to add the option to support auto-import of arrays/records to
+ # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
+@@ -2887,20 +2891,20 @@ gnatlib-shared-win32:
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+- $(RM) $(RTSDIR)/libgna*$(soext)
++ $(RM) $(RTSDIR)/${soprefix}gna*$(soext)
+ cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
+ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
+ $(PICFLAG_FOR_TARGET) \
+- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ -o ${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
+- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
++ $(SO_OPTS)${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
+ cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
+ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
+ $(PICFLAG_FOR_TARGET) \
+- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ -o ${soprefix}gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_TASKING_OBJS) \
+- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
++ $(SO_OPTS)${soprefix}gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ $(THREADSLIB) -Wl,${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+
+ gnatlib-shared-darwin:
+ $(MAKE) $(FLAGS_TO_PASS) \
+@@ -2910,27 +2914,27 @@ gnatlib-shared-darwin:
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+- $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
++ $(RM) $(RTSDIR)/${soprefix}gnat$(soext) $(RTSDIR)/${soprefix}gnarl$(soext)
+ cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
+ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
+- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ -o ${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
+ $(SO_OPTS) \
+- -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ -Wl,-install_name,@rpath/${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(MISCLIB)
+ cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
+ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
+- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ -o ${soprefix}gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_TASKING_OBJS) \
+ $(SO_OPTS) \
+- -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+- cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+- libgnat$(soext)
+- cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+- libgnarl$(soext)
+- cd $(RTSDIR); dsymutil libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+- cd $(RTSDIR); dsymutil libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext)
++ -Wl,-install_name,@rpath/${soprefix}gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ $(THREADSLIB) -Wl,${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext)
++ cd $(RTSDIR); $(LN_S) ${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ ${soprefix}gnat$(soext)
++ cd $(RTSDIR); $(LN_S) ${soprefix}gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ ${soprefix}gnarl$(soext)
++ cd $(RTSDIR); dsymutil ${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext)
++ cd $(RTSDIR); dsymutil ${soprefix}gnarl$(hyphen)$(LIBRARY_VERSION)$(soext)
+
+ gnatlib-shared-vms:
+ $(MAKE) $(FLAGS_TO_PASS) \
+@@ -2940,12 +2944,12 @@ gnatlib-shared-vms:
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+- $(RM) $(RTSDIR)/libgna*$(soext)
++ $(RM) $(RTSDIR)/${soprefix}gna*$(soext)
+ cd $(RTSDIR) && \
+ ../../gnatsym -s SYMVEC_$$$$.opt \
+ $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
+ ../../xgcc -g -B../../ -shared -shared-libgcc \
+- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
++ -o ${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
+ sys\$$library:trace.exe \
+ --for-linker=/noinform \
+ --for-linker=SYMVEC_$$$$.opt \
+@@ -2954,8 +2958,8 @@ gnatlib-shared-vms:
+ ../../gnatsym -s SYMVEC_$$$$.opt \
+ $(GNATRTL_TASKING_OBJS) && \
+ ../../xgcc -g -B../../ -shared -shared-libgcc \
+- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+- libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ -o ${soprefix}gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
++ libgnarl.a ${soprefix}gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ sys\$$library:trace.exe \
+ --for-linker=/noinform \
+ --for-linker=SYMVEC_$$$$.opt \
+--
+2.1.1
+
diff --git a/gcc48-__cxa_atexit.patch b/0021-__cxa-atexit-for-Cygwin.patch
index bcff00a..58a58f8 100644
--- a/gcc48-__cxa_atexit.patch
+++ b/0021-__cxa-atexit-for-Cygwin.patch
@@ -1,17 +1,25 @@
---- origsrc/gcc-4.8.3/gcc/config/i386/cygwin.h 2014-08-01 15:20:08.936969300 -0500
-+++ src/gcc-4.8.3/gcc/config/i386/cygwin.h 2014-08-04 17:17:31.265803800 -0500
-@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3.
- #define STARTFILE_SPEC "\
- %{!shared: %{!mdll: crt0%O%s \
- %{pg:gcrt0%O%s}}}\
-- crtbegin.o%s"
-+ %{shared:crtbeginS.o%s;:crtbegin.o%s}"
-
- #undef ENDFILE_SPEC
- #define ENDFILE_SPEC \
---- origsrc/gcc-4.8.3/gcc/config.gcc 2014-08-01 15:20:08.402401400 -0500
-+++ src/gcc-4.8.3/gcc/config.gcc 2014-08-06 17:58:38.240552900 -0500
-@@ -1452,6 +1452,7 @@ i[34567]86-*-cygwin*)
+From 4250ae25a96ddf8c48b978e1c4427d19c7279908 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Thu, 30 Oct 2014 17:15:02 +0800
+Subject: [PATCH 21/24] __cxa-atexit for Cygwin
+
+Using __cxa_atexit(__gcc_deregister_frame, NULL, __dso_handle)
+instead of atexit(__gcc_deregister_frame) directly to prevent an
+optimization bug.
+---
+ gcc/config.gcc | 2 ++
+ gcc/config/i386/cygwin.h | 2 +-
+ libgcc/config.host | 4 ++--
+ libgcc/config/i386/cygming-crtbegin.c | 28 ++++++++++++++++++++++++++++
+ libgcc/config/i386/cygming-crtend.c | 6 ------
+ libgcc/config/i386/t-cygming | 3 +++
+ 6 files changed, 36 insertions(+), 9 deletions(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 90d4f71..2a432e6 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -1594,6 +1594,7 @@ i[34567]86-*-cygwin*)
thread_file='posix'
fi
use_gcc_stdint=wrap
@@ -19,17 +27,54 @@
;;
x86_64-*-cygwin*)
need_64bit_isa=yes
-@@ -1467,6 +1468,7 @@ x86_64-*-cygwin*)
- thread_file='posix'
+@@ -1902,6 +1903,7 @@ mep-*-*)
+ with_headers=yes
fi
use_gcc_stdint=wrap
+ default_use_cxa_atexit=yes
;;
- i[34567]86-*-mingw* | x86_64-*-mingw*)
- tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h"
---- origsrc/gcc-4.8.3/libgcc/config/i386/cygming-crtbegin.c 2014-08-01 15:20:08.998477100 -0500
-+++ src/gcc-4.8.3/libgcc/config/i386/cygming-crtbegin.c 2014-08-06 23:54:59.133581500 -0500
-@@ -81,6 +81,24 @@ static void *__JCR_LIST__[]
+ microblaze*-linux*)
+ case $target in
+diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
+index 4e15ab0..19e6b7e 100644
+--- a/gcc/config/i386/cygwin.h
++++ b/gcc/config/i386/cygwin.h
+@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3. If not see
+ #define STARTFILE_SPEC "\
+ %{!shared: %{!mdll: crt0%O%s \
+ %{pg:gcrt0%O%s}}}\
+- crtbegin.o%s"
++ %{shared:crtbeginS.o%s;:crtbegin.o%s}"
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+diff --git a/libgcc/config.host b/libgcc/config.host
+index f196680..08cac3f 100644
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -603,7 +603,7 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
+ i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
+ ;;
+ i[34567]86-*-cygwin*)
+- extra_parts="crtbegin.o crtend.o crtfastmath.o"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
+ # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_eh_file="i386/t-sjlj-eh"
+@@ -619,7 +619,7 @@ i[34567]86-*-cygwin*)
+ tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin i386/t-crtfm i386/t-chkstk t-dfprules"
+ ;;
+ x86_64-*-cygwin*)
+- extra_parts="crtbegin.o crtend.o crtfastmath.o"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
+ # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
+ if test x$enable_sjlj_exceptions = xyes; then
+ tmake_eh_file="i386/t-sjlj-eh"
+diff --git a/libgcc/config/i386/cygming-crtbegin.c b/libgcc/config/i386/cygming-crtbegin.c
+index 195b463..aece23c 100644
+--- a/libgcc/config/i386/cygming-crtbegin.c
++++ b/libgcc/config/i386/cygming-crtbegin.c
+@@ -110,6 +110,23 @@ static void *__JCR_LIST__[]
= { };
#endif
@@ -47,14 +92,13 @@
+void *__dso_handle = 0;
+#endif
+
-+extern int __cxa_atexit (void (*)(void *), void *, void *);
+#endif /* __CYGWIN__ */
+
+
/* Pull in references from libgcc.a(unwind-dw2-fde.o) in the
startfile. These are referenced by a ctor and dtor in crtend.o. */
extern void __gcc_register_frame (void);
-@@ -131,6 +148,17 @@ __gcc_register_frame (void)
+@@ -155,6 +172,17 @@ __gcc_register_frame (void)
register_class_fn (__JCR_LIST__);
}
#endif
@@ -72,8 +116,10 @@
}
void
---- origsrc/gcc-4.8.3/libgcc/config/i386/cygming-crtend.c 2013-02-04 13:06:20.000000000 -0600
-+++ src/gcc-4.8.3/libgcc/config/i386/cygming-crtend.c 2014-08-06 01:27:35.568214600 -0500
+diff --git a/libgcc/config/i386/cygming-crtend.c b/libgcc/config/i386/cygming-crtend.c
+index de0d61f..d3beaf9 100644
+--- a/libgcc/config/i386/cygming-crtend.c
++++ b/libgcc/config/i386/cygming-crtend.c
@@ -70,12 +70,6 @@ static void
register_frame_ctor (void)
{
@@ -87,8 +133,10 @@
}
#if !DEFAULT_USE_CXA_ATEXIT
---- origsrc/gcc-4.8.3/libgcc/config/i386/t-cygming 2011-11-02 10:23:48.000000000 -0500
-+++ src/gcc-4.8.3/libgcc/config/i386/t-cygming 2014-08-04 17:15:30.836011200 -0500
+diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming
+index d76004c..4713b7f 100644
+--- a/libgcc/config/i386/t-cygming
++++ b/libgcc/config/i386/t-cygming
@@ -8,6 +8,9 @@ CUSTOM_CRTSTUFF = yes
crtbegin.o: $(srcdir)/config/i386/cygming-crtbegin.c
$(crt_compile) -fno-omit-frame-pointer -c $<
@@ -99,14 +147,6 @@
# We intentionally use a implementation-reserved init priority of 0,
# so allow the warning.
crtend.o: $(srcdir)/config/i386/cygming-crtend.c
---- origsrc/gcc-4.8.3/libgcc/config.host 2014-08-01 15:20:05.717560400 -0500
-+++ src/gcc-4.8.3/libgcc/config.host 2014-08-04 17:19:11.955589800 -0500
-@@ -559,7 +559,7 @@ i[34567]86-*-solaris2* | x86_64-*-solari
- i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
- ;;
- i[34567]86-*-cygwin*)
-- extra_parts="crtbegin.o crtend.o crtfastmath.o"
-+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
- # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
- tmake_eh_file="i386/t-sjlj-eh"
+--
+2.1.1
+
diff --git a/gcc48-libstdc-atexit_thread.patch b/0022-prevent-modules-from-being-unloaded-before-their-dto.patch
index 1ae7e09..950a26c 100644
--- a/gcc48-libstdc-atexit_thread.patch
+++ b/0022-prevent-modules-from-being-unloaded-before-their-dto.patch
@@ -1,10 +1,22 @@
-Index: libstdc++-v3/config/os/mingw32-w64/os_defines.h
-===================================================================
---- libstdc++-v3/config/os/mingw32-w64/os_defines.h (revision 213759)
-+++ libstdc++-v3/config/os/mingw32-w64/os_defines.h (working copy)
-@@ -78,4 +78,9 @@
- #define _GLIBCXX_LLP64 1
- #endif
+From 4f45f5abe77525389e0a4d9885c5bf63e2f54bc8 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Fri, 31 Oct 2014 06:46:02 +0800
+Subject: [PATCH 22/24] prevent modules from being unloaded before their dtors
+ are called
+
+---
+ libstdc++-v3/config/os/mingw32-w64/os_defines.h | 5 +++++
+ libstdc++-v3/config/os/newlib/os_defines.h | 6 ++++++
+ libstdc++-v3/libsupc++/atexit_thread.cc | 20 ++++++++++++++++++++
+ 3 files changed, 31 insertions(+)
+
+diff --git a/libstdc++-v3/config/os/mingw32-w64/os_defines.h b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
+index fd5ad9e..41d59be 100644
+--- a/libstdc++-v3/config/os/mingw32-w64/os_defines.h
++++ b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
+@@ -81,4 +81,9 @@
+ // See libstdc++/59807
+ #define _GTHREAD_USE_MUTEX_INIT_FUNC 1
+// Enable use of GetModuleHandleEx (requires Windows XP/2003) in
+// __cxa_thread_atexit to prevent modules from being unloaded before
@@ -12,10 +24,10 @@ Index: libstdc++-v3/config/os/mingw32-w64/os_defines.h
+#define _GLIBCXX_THREAD_ATEXIT_WIN32 1
+
#endif
-Index: libstdc++-v3/config/os/newlib/os_defines.h
-===================================================================
---- libstdc++-v3/config/os/newlib/os_defines.h (revision 213759)
-+++ libstdc++-v3/config/os/newlib/os_defines.h (working copy)
+diff --git a/libstdc++-v3/config/os/newlib/os_defines.h b/libstdc++-v3/config/os/newlib/os_defines.h
+index 92748da..2e01d3b 100644
+--- a/libstdc++-v3/config/os/newlib/os_defines.h
++++ b/libstdc++-v3/config/os/newlib/os_defines.h
@@ -47,6 +47,12 @@
// See libstdc++/20806.
@@ -29,10 +41,10 @@ Index: libstdc++-v3/config/os/newlib/os_defines.h
#endif
#endif
-Index: libstdc++-v3/libsupc++/atexit_thread.cc
-===================================================================
---- libstdc++-v3/libsupc++/atexit_thread.cc (revision 213759)
-+++ libstdc++-v3/libsupc++/atexit_thread.cc (working copy)
+diff --git a/libstdc++-v3/libsupc++/atexit_thread.cc b/libstdc++-v3/libsupc++/atexit_thread.cc
+index dff08e9..d7d84d2 100644
+--- a/libstdc++-v3/libsupc++/atexit_thread.cc
++++ b/libstdc++-v3/libsupc++/atexit_thread.cc
@@ -25,6 +25,10 @@
#include <cstdlib>
#include <new>
@@ -42,9 +54,9 @@ Index: libstdc++-v3/libsupc++/atexit_thread.cc
+#include <windows.h>
+#endif
- #if HAVE___CXA_THREAD_ATEXIT_IMPL
+ #if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
-@@ -47,6 +51,9 @@
+@@ -47,6 +51,9 @@ namespace {
void (*destructor)(void *);
void *object;
elt *next;
@@ -54,7 +66,7 @@ Index: libstdc++-v3/libsupc++/atexit_thread.cc
};
// Keep a per-thread list of cleanups in gthread_key storage.
-@@ -62,6 +69,11 @@
+@@ -62,6 +69,11 @@ namespace {
{
elt *old_e = e;
e->destructor (e->object);
@@ -66,7 +78,7 @@ Index: libstdc++-v3/libsupc++/atexit_thread.cc
e = e->next;
delete (old_e);
}
-@@ -133,6 +145,14 @@
+@@ -133,6 +145,14 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *), void *obj, void */*dso_ha
new_elt->destructor = dtor;
new_elt->object = obj;
new_elt->next = first;
@@ -81,3 +93,6 @@ Index: libstdc++-v3/libsupc++/atexit_thread.cc
if (__gthread_active_p ())
__gthread_setspecific (key, new_elt);
+--
+2.1.1
+
diff --git a/gcc48-libgcc-deregister.patch b/0023-Attempt-to-fix-dw2-unwinder-for-Cygwin.patch
index 23b2958..2c1952b 100644
--- a/gcc48-libgcc-deregister.patch
+++ b/0023-Attempt-to-fix-dw2-unwinder-for-Cygwin.patch
@@ -1,26 +1,32 @@
-Index: libgcc/config/i386/cygming-crtbegin.c
-===================================================================
---- libgcc/config/i386/cygming-crtbegin.c (revision 212546)
-+++ libgcc/config/i386/cygming-crtbegin.c (working copy)
-@@ -99,12 +99,13 @@ static EH_FRAME_SECTION_CONST char __EH_
- = { };
+From 3d30fe549f54d5399a41ead2fd2c8c5d5ed56b85 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sat, 8 Nov 2014 14:29:45 +0800
+Subject: [PATCH 23/24] Attempt to fix dw2 unwinder for Cygwin
+
+---
+ libgcc/config/i386/cygming-crtbegin.c | 23 ++++++++---------------
+ 1 file changed, 8 insertions(+), 15 deletions(-)
+
+diff --git a/libgcc/config/i386/cygming-crtbegin.c b/libgcc/config/i386/cygming-crtbegin.c
+index aece23c..3651afa 100644
+--- a/libgcc/config/i386/cygming-crtbegin.c
++++ b/libgcc/config/i386/cygming-crtbegin.c
+@@ -100,8 +100,7 @@ static EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[]
static struct object obj;
- /* Handle of libgcc's DLL reference. */
- HANDLE hmod_libgcc;
+-/* Handle of libgcc's DLL reference. */
+-HANDLE hmod_libgcc;
+static void * (*deregister_frame_fn) (const void *) = NULL;
#endif
#if TARGET_USE_JCR_SECTION
- static void *__JCR_LIST__[]
- __attribute__ ((used, section(JCR_SECTION_NAME), aligned(4)))
- = { };
-@@ -130,15 +131,20 @@ __gcc_register_frame (void)
+@@ -146,13 +145,16 @@ __gcc_register_frame (void)
+
if (h)
{
- /* Increasing the load-count of LIBGCC_SONAME DLL. */
- hmod_libgcc = LoadLibrary (LIBGCC_SONAME);
+- /* Increasing the load-count of LIBGCC_SONAME DLL. */
+- hmod_libgcc = LoadLibrary (LIBGCC_SONAME);
register_frame_fn = (void (*) (const void *, struct object *))
GetProcAddress (h, "__register_frame_info");
+ deregister_frame_fn = (void* (*) (const void *))
@@ -36,13 +42,7 @@ Index: libgcc/config/i386/cygming-crtbegin.c
if (register_frame_fn)
register_frame_fn (__EH_FRAME_BEGIN__, &obj);
#endif
-
- #if TARGET_USE_JCR_SECTION
- if (__JCR_LIST__[0])
-@@ -158,19 +164,12 @@ __gcc_register_frame (void)
- }
-
- void
+@@ -189,16 +191,7 @@ void
__gcc_deregister_frame (void)
{
#if DWARF2_UNWIND_INFO
@@ -55,7 +55,10 @@ Index: libgcc/config/i386/cygming-crtbegin.c
- deregister_frame_fn = __deregister_frame_info;
if (deregister_frame_fn)
deregister_frame_fn (__EH_FRAME_BEGIN__);
- if (hmod_libgcc)
- FreeLibrary (hmod_libgcc);
+- if (hmod_libgcc)
+- FreeLibrary (hmod_libgcc);
#endif
}
+--
+2.1.1
+
diff --git a/0024-Restore-compile-mode-pthread.patch b/0024-Restore-compile-mode-pthread.patch
new file mode 100644
index 0000000..9a65b64
--- /dev/null
+++ b/0024-Restore-compile-mode-pthread.patch
@@ -0,0 +1,27 @@
+From 21a2eef50ded41f94e82004c7da113c3b1314fb0 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Wed, 28 Jan 2015 06:30:37 +0800
+Subject: [PATCH 24/24] Restore compile mode -pthread
+
+This feature was accidentally dropped from 4.8, currently does
+not do anything.
+---
+ gcc/config/i386/cygwin.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
+index 19e6b7e..f8cbe4c 100644
+--- a/gcc/config/i386/cygwin.h
++++ b/gcc/config/i386/cygwin.h
+@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef CPP_SPEC
+ #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
+- %{!ansi:-Dunix} \
++ %{!ansi:-Dunix} %{pthread: } \
+ %{mwin32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}} \
+ %{!nostdinc:%{!mno-win32:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}\
+ "
+--
+2.1.1
+
diff --git a/0025-fix-cygwin-stdint.patch b/0025-fix-cygwin-stdint.patch
new file mode 100644
index 0000000..a47664d
--- /dev/null
+++ b/0025-fix-cygwin-stdint.patch
@@ -0,0 +1,86 @@
+--- a/gcc/config/i386/cygwin-stdint.h 2014-01-02 16:23:26.000000000 -0600
++++ b/gcc/config/i386/cygwin-stdint.h 2015-02-22 11:44:04.261159700 -0600
+@@ -24,71 +24,38 @@ along with GCC; see the file COPYING3.
+ #define INT8_TYPE "signed char"
+ #define INT16_TYPE "short int"
+ #define INT32_TYPE "int"
+-#ifdef __x86_64__
+-#define INT64_TYPE "long int"
+-#else
+-#define INT64_TYPE "long long int"
+-#endif
++#define INT64_TYPE (TARGET_64BIT ? "long int" : "long long int")
+
+ #define UINT8_TYPE "unsigned char"
+ #define UINT16_TYPE "short unsigned int"
+ #define UINT32_TYPE "unsigned int"
+-#ifdef __x86_64__
+-#define UINT64_TYPE "long unsigned int"
+-#else
+-#define UINT64_TYPE "long long unsigned int"
+-#endif
++#define UINT64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
+
+ /* Minimum-width integer types */
+
+ #define INT_LEAST8_TYPE "signed char"
+ #define INT_LEAST16_TYPE "short int"
+ #define INT_LEAST32_TYPE "int"
+-#ifdef __x86_64__
+-#define INT_LEAST64_TYPE "long int"
+-#else
+-#define INT_LEAST64_TYPE "long long int"
+-#endif
++#define INT_LEAST64_TYPE (TARGET_64BIT ? "long int" : "long long int")
+
+ #define UINT_LEAST8_TYPE "unsigned char"
+ #define UINT_LEAST16_TYPE "short unsigned int"
+ #define UINT_LEAST32_TYPE "unsigned int"
+-#ifdef __x86_64__
+-#define UINT_LEAST64_TYPE "long unsigned int"
+-#else
+-#define UINT_LEAST64_TYPE "long long unsigned int"
+-#endif
++#define UINT_LEAST64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
+
+ /* Fastest minimum-width integer types */
+
+ #define INT_FAST8_TYPE "signed char"
+-#ifdef __x86_64__
+-#define INT_FAST16_TYPE "long int"
+-#define INT_FAST32_TYPE "long int"
+-#define INT_FAST64_TYPE "long int"
+-#else
+-#define INT_FAST16_TYPE "int"
+-#define INT_FAST32_TYPE "int"
+-#define INT_FAST64_TYPE "long long int"
+-#endif
++#define INT_FAST16_TYPE (TARGET_64BIT ? "long int" : "int")
++#define INT_FAST32_TYPE (TARGET_64BIT ? "long int" : "int")
++#define INT_FAST64_TYPE (TARGET_64BIT ? "long int" : "long long int")
+
+ #define UINT_FAST8_TYPE "unsigned char"
+-#ifdef __x86_64__
+-#define UINT_FAST16_TYPE "long unsigned int"
+-#define UINT_FAST32_TYPE "long unsigned int"
+-#define UINT_FAST64_TYPE "long unsigned int"
+-#else
+-#define UINT_FAST16_TYPE "unsigned int"
+-#define UINT_FAST32_TYPE "unsigned int"
+-#define UINT_FAST64_TYPE "long long unsigned int"
+-#endif
++#define UINT_FAST16_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
++#define UINT_FAST32_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
++#define UINT_FAST64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
+
+ /* Integer types capable of holding object pointers */
+
+-#ifdef __x86_64__
+-#define INTPTR_TYPE "long int"
+-#define UINTPTR_TYPE "long unsigned int"
+-#else
+-#define INTPTR_TYPE "int"
+-#define UINTPTR_TYPE "unsigned int"
+-#endif
++#define INTPTR_TYPE (TARGET_64BIT ? "long int" : "int")
++#define UINTPTR_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
diff --git a/gcc45-cross-exe-suffix.diff b/1000-cross-exe-suffix.patch
index 6fbddf8..6fbddf8 100644
--- a/gcc45-cross-exe-suffix.diff
+++ b/1000-cross-exe-suffix.patch
diff --git a/gcc46-textdomain.patch b/1001-textdomain.patch
index 16dc8f1..d1da6ee 100644
--- a/gcc46-textdomain.patch
+++ b/1001-textdomain.patch
@@ -1,37 +1,37 @@
---- origsrc/gcc-4.6.3/gcc/Makefile.in 2011-08-20 02:51:09.000000000 -0500
-+++ src/gcc-4.6.3/gcc/Makefile.in 2013-11-15 01:21:11.915416300 -0600
+--- a/gcc/Makefile.in 2011-08-20 02:51:09.000000000 -0500
++++ b/gcc/Makefile.in 2013-11-15 01:21:11.915416300 -0600
@@ -5175,8 +5175,8 @@ install-po:
dir=$(localedir)/$$lang/LC_MESSAGES; \
echo $(mkinstalldirs) $(DESTDIR)$$dir; \
$(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
- echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
-+ echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/cygwin32-gcc.mo; \
-+ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/cygwin32-gcc.mo; \
++ echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/cygwin-gcc.mo; \
++ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/cygwin-gcc.mo; \
done
# Rule for regenerating the message template (gcc.pot).
---- origsrc/gcc-4.6.3/gcc/intl.c 2010-12-01 11:29:12.000000000 -0600
-+++ src/gcc-4.6.3/gcc/intl.c 2013-11-15 01:21:29.446419000 -0600
+--- a/gcc/intl.c 2010-12-01 11:29:12.000000000 -0600
++++ b/gcc/intl.c 2013-11-15 01:21:29.446419000 -0600
@@ -56,8 +56,8 @@ gcc_init_libintl (void)
setlocale (LC_ALL, "");
#endif
- (void) bindtextdomain ("gcc", LOCALEDIR);
- (void) textdomain ("gcc");
-+ (void) bindtextdomain ("cygwin32-gcc", LOCALEDIR);
-+ (void) textdomain ("cygwin32-gcc");
++ (void) bindtextdomain ("cygwin-gcc", LOCALEDIR);
++ (void) textdomain ("cygwin-gcc");
/* Opening quotation mark. */
open_quote = _("`");
---- origsrc/gcc-4.6.3/libcpp/configure 2012-03-01 06:03:46.000000000 -0600
-+++ src/gcc-4.6.3/libcpp/configure 2013-11-15 01:21:54.401846400 -0600
+--- a/libcpp/configure 2012-03-01 06:03:46.000000000 -0600
++++ b/libcpp/configure 2013-11-15 01:21:54.401846400 -0600
@@ -7042,7 +7042,7 @@ _ACEOF
# More defines and substitutions.
-PACKAGE="$PACKAGE_TARNAME"
-+PACKAGE="cygwin32-cpplib"
++PACKAGE="cygwin-cpplib"
cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
diff --git a/1002-isl-r218392.patch b/1002-isl-r218392.patch
new file mode 100644
index 0000000..5ea4e4b
--- /dev/null
+++ b/1002-isl-r218392.patch
@@ -0,0 +1,334 @@
+From 0cd222d26facd482b4835a551e1ac12a6490a5ae Mon Sep 17 00:00:00 2001
+From: burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 4 Dec 2014 18:25:37 +0000
+Subject: [PATCH] 2014-12-04 Tobias Burnus <burnus@net-b.de>
+
+ * configure.ac: Permit also ISL 0.14 with CLooG.
+ * Makefile.def: Make more dependent on mpfr, mpc, isl, and
+ * cloog.
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
+
+2014-12-04 Tobias Burnus <burnus@net-b.de>
+
+ * configure.ac
+ (ac_has_isl_schedule_constraints_compute_schedule):
+ New check.
+ * graphite-clast-to-gimple.c: For ISL 0.14, include deprecate
+ * headers.
+ * graphite-interchange.c: Ditto.
+ * graphite-poly.c: Ditto.
+ * graphite-sese-to-poly.c: Ditto.
+ * graphite-optimize-isl.c (getScheduleForBandList): Ditto.
+ Conditionally use ISL 0.13+ functions.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@218392 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ ChangeLog | 7 ++++++
+ Makefile.def | 4 ++++
+ Makefile.in | 32 +++++++++++++++++++++++++++
+ configure | 49 ++++++++++++++++++++++++++++++++++++++++++
+ configure.ac | 3 +++
+ gcc/ChangeLog | 14 ++++++++++++
+ gcc/config.in | 6 ++++++
+ gcc/configure | 40 ++++++++++++++++++++++++++++++++++
+ gcc/configure.ac | 23 ++++++++++++++++++++
+ gcc/graphite-clast-to-gimple.c | 5 +++++
+ gcc/graphite-interchange.c | 6 ++++++
+ gcc/graphite-optimize-isl.c | 8 +++++++
+ gcc/graphite-poly.c | 4 ++++
+ gcc/graphite-sese-to-poly.c | 5 +++++
+ 14 files changed, 206 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 4a457e4..21a9792 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2014-12-04 Tobias Burnus <burnus@net-b.de>
++
++ * configure.ac: Permit also ISL 0.14 with CLooG.
++ * Makefile.def: Make more dependent on mpfr, mpc, isl, and cloog.
++ * Makefile.in: Regenerate.
++ * configure: Regenerate.
++
+ 2014-10-30 Release Manager
+
+ * GCC 4.9.2 released.
+mv diff --git a/configure b/configure
+index d1c67e5..d769d93 100755
+--- a/configure
++++ b/configure
+@@ -6024,6 +6024,55 @@ $as_echo "$gcc_cv_isl" >&6; }
+ fi
+
+
++ if test "${gcc_cv_isl}" = no ; then
++
++ if test "${ENABLE_ISL_CHECK}" = yes ; then
++ _isl_saved_CFLAGS=$CFLAGS
++ _isl_saved_LDFLAGS=$LDFLAGS
++ _isl_saved_LIBS=$LIBS
++
++ CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}"
++ LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
++ LIBS="${_isl_saved_LIBS} -lisl"
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14 of ISL" >&5
++$as_echo_n "checking for version 0.14 of ISL... " >&6; }
++ if test "$cross_compiling" = yes; then :
++ gcc_cv_isl=yes
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#include <isl/version.h>
++ #include <string.h>
++int
++main ()
++{
++if (strncmp (isl_version (), "isl-0.14", strlen ("isl-0.14")) != 0)
++ return 1;
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_run "$LINENO"; then :
++ gcc_cv_isl=yes
++else
++ gcc_cv_isl=no
++fi
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++ conftest.$ac_objext conftest.beam conftest.$ac_ext
++fi
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_isl" >&5
++$as_echo "$gcc_cv_isl" >&6; }
++
++ CFLAGS=$_isl_saved_CFLAGS
++ LDFLAGS=$_isl_saved_LDFLAGS
++ LIBS=$_isl_saved_LIBS
++ fi
++
++
++ fi
+ fi
+ fi
+
+diff --git a/configure.ac b/configure.ac
+index 1bab680..2aee14a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1658,6 +1658,9 @@ if test "x$with_isl" != "xno" &&
+ ISL_CHECK_VERSION(0,11)
+ if test "${gcc_cv_isl}" = no ; then
+ ISL_CHECK_VERSION(0,12)
++ if test "${gcc_cv_isl}" = no ; then
++ ISL_CHECK_VERSION(0,14)
++ fi
+ fi
+ fi
+ dnl Only execute fail-action, if ISL has been requested.
+diff --git a/gcc/config.in b/gcc/config.in
+index 1e85325..71cf0c9 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -1211,6 +1211,12 @@
+ #endif
+
+
++/* Define if isl_schedule_constraints_compute_schedule exists. */
++#ifndef USED_FOR_TARGET
++#undef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
++#endif
++
++
+ /* Define to 1 if you have the `kill' function. */
+ #ifndef USED_FOR_TARGET
+ #undef HAVE_KILL
+diff --git a/gcc/configure b/gcc/configure
+index 291e463..f48dd18 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27851,7 +27851,47 @@ if test "x${CLOOGLIBS}" != "x" ; then
+
+ $as_echo "#define HAVE_cloog 1" >>confdefs.h
+
++
++ # Check whether isl_schedule_constraints_compute_schedule is available;
++ # it's new in ISL-0.13.
++ saved_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $ISLINC"
++ saved_LIBS="$LIBS"
++ LIBS="$LIBS $CLOOGLIBS $ISLLIBS $GMPLIBS"
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_schedule_constraints_compute_schedule" >&5
++$as_echo_n "checking Checking for isl_schedule_constraints_compute_schedule... " >&6; }
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#include <isl/schedule.h>
++int
++main ()
++{
++isl_schedule_constraints_compute_schedule (NULL);
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_has_isl_schedule_constraints_compute_schedule=yes
++else
++ ac_has_isl_schedule_constraints_compute_schedule=no
+ fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5
++$as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; }
++
++ LIBS="$saved_LIBS"
++ CFLAGS="$saved_CFLAGS"
++
++ if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
++
++$as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h
++
++ fi
++fi
++
+
+ # Check for plugin support
+ # Check whether --enable-plugin was given.
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index b9a3799..e54df10 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5495,8 +5495,31 @@ AC_ARG_VAR(CLOOGLIBS,[How to link CLOOG])
+ AC_ARG_VAR(CLOOGINC,[How to find CLOOG include files])
+ if test "x${CLOOGLIBS}" != "x" ; then
+ AC_DEFINE(HAVE_cloog, 1, [Define if cloog is in use.])
++
++ # Check whether isl_schedule_constraints_compute_schedule is available;
++ # it's new in ISL-0.13.
++ saved_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $ISLINC"
++ saved_LIBS="$LIBS"
++ LIBS="$LIBS $CLOOGLIBS $ISLLIBS $GMPLIBS"
++
++ AC_MSG_CHECKING([Checking for isl_schedule_constraints_compute_schedule])
++ AC_TRY_LINK([#include <isl/schedule.h>],
++ [isl_schedule_constraints_compute_schedule (NULL);],
++ [ac_has_isl_schedule_constraints_compute_schedule=yes],
++ [ac_has_isl_schedule_constraints_compute_schedule=no])
++ AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule)
++
++ LIBS="$saved_LIBS"
++ CFLAGS="$saved_CFLAGS"
++
++ if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
++ AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
++ [Define if isl_schedule_constraints_compute_schedule exists.])
++ fi
+ fi
+
++
+ # Check for plugin support
+ AC_ARG_ENABLE(plugin,
+ [AS_HELP_STRING([--enable-plugin], [enable plugin support])],
+diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
+index fc60845..134388c 100644
+--- a/gcc/graphite-clast-to-gimple.c
++++ b/gcc/graphite-clast-to-gimple.c
+@@ -30,6 +30,11 @@ along with GCC; see the file COPYING3. If not see
+ #include <isl/aff.h>
+ #include <cloog/cloog.h>
+ #include <cloog/isl/domain.h>
++#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
++#include <isl/deprecated/int.h>
++#include <isl/lp.h>
++#include <isl/deprecated/ilp_int.h>
++#endif
+ #endif
+
+ #include "system.h"
+diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c
+index 55e3fab..2e625c1 100644
+--- a/gcc/graphite-interchange.c
++++ b/gcc/graphite-interchange.c
+@@ -31,6 +31,12 @@ along with GCC; see the file COPYING3. If not see
+ #include <isl/ilp.h>
+ #include <cloog/cloog.h>
+ #include <cloog/isl/domain.h>
++#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
++#include <isl/deprecated/int.h>
++#include <isl/deprecated/aff_int.h>
++#include <isl/deprecated/ilp_int.h>
++#include <isl/deprecated/constraint_int.h>
++#endif
+ #endif
+
+ #include "system.h"
+diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
+index 88d6d6c..fc12eeb 100644
+--- a/gcc/graphite-optimize-isl.c
++++ b/gcc/graphite-optimize-isl.c
+@@ -28,6 +28,10 @@ along with GCC; see the file COPYING3. If not see
+ #include <isl/band.h>
+ #include <isl/aff.h>
+ #include <isl/options.h>
++#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
++#include <isl/deprecated/int.h>
++#include <isl/deprecated/aff_int.h>
++#endif
+ #endif
+
+ #include "system.h"
+@@ -373,7 +377,11 @@ getScheduleForBandList (isl_band_list *BandList)
+ {
+ for (i = ScheduleDimensions - 1 ; i >= 0 ; i--)
+ {
++#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
++ if (isl_band_member_is_coincident (Band, i))
++#else
+ if (isl_band_member_is_zero_distance (Band, i))
++#endif
+ {
+ isl_map *TileMap;
+ isl_union_map *TileUMap;
+diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
+index 4ca62f9..fccc2ec 100644
+--- a/gcc/graphite-poly.c
++++ b/gcc/graphite-poly.c
+@@ -30,6 +30,10 @@ along with GCC; see the file COPYING3. If not see
+ #include <isl/aff.h>
+ #include <cloog/cloog.h>
+ #include <cloog/isl/domain.h>
++#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
++#include <isl/deprecated/int.h>
++#include <isl/deprecated/ilp_int.h>
++#endif
+ #endif
+
+ #include "system.h"
+diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
+index 28447e4..059c10d 100644
+--- a/gcc/graphite-sese-to-poly.c
++++ b/gcc/graphite-sese-to-poly.c
+@@ -29,6 +29,11 @@ along with GCC; see the file COPYING3. If not see
+ #include <cloog/cloog.h>
+ #include <cloog/cloog.h>
+ #include <cloog/isl/domain.h>
++#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
++#include <isl/deprecated/int.h>
++#include <isl/deprecated/aff_int.h>
++#include <isl/deprecated/constraint_int.h>
++#endif
+ #endif
+
+ #include "system.h"
+--
+1.9.4
+
diff --git a/cygwin-gcc.spec b/cygwin-gcc.spec
index 6c6f1b3..e037291 100644
--- a/cygwin-gcc.spec
+++ b/cygwin-gcc.spec
@@ -1,18 +1,16 @@
-# when changing gcc_minor, also change the soversion of cyggcj-*.dll etc.
-# and the name of libgcj-*.pc
%global gcc_major 4
-%global gcc_minor 8
-%global gcc_micro 3
+%global gcc_minor 9
+%global gcc_micro 2
%global gcc_branch %{gcc_major}.%{gcc_minor}
%global gcc_version %{gcc_major}.%{gcc_minor}.%{gcc_micro}
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
-%global gcc_release 6
+%global gcc_release 1
%global build_ada 0
# building cross-gnat requires matching X.Y version of native gnat
-%if 0%{?fedora} >= 19 && 0%{?fedora} < 21 || 0%{?rhel} == 7
-%ifarch %{ix86} x86_64 ia64 ppc ppc64 alpha
+%if 0%{?fedora} == 21
+%ifarch %{ix86} x86_64 ia64 ppc ppc64 ppc64p7 alpha %{arm} aarch64
%global build_ada 1
%endif
%endif
@@ -34,12 +32,18 @@ BuildRequires: cygwin32-binutils
BuildRequires: cygwin32 >= 1.7.32
BuildRequires: cygwin32-w32api-headers
BuildRequires: cygwin32-w32api-runtime
+BuildRequires: cygwin64-filesystem
+BuildRequires: cygwin64-binutils
+BuildRequires: cygwin64 >= 1.7.32
+BuildRequires: cygwin64-w32api-headers
+BuildRequires: cygwin64-w32api-runtime
BuildRequires: gmp-devel
BuildRequires: mpfr-devel
BuildRequires: libmpc-devel
-%if 0
-BuildRequires: isl-devel = 0.11.1
-BuildRequires: cloog-isl-devel = 0.18.0
+BuildRequires: libstdc++-static
+%if 0%{?fedora} >= 20
+BuildRequires: isl-devel >= 0.11.1
+BuildRequires: cloog-devel >= 0.18.0
%endif
BuildRequires: zlib-devel
BuildRequires: flex
@@ -49,25 +53,50 @@ BuildRequires: gcc-gnat
%endif
Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
-Patch0: gcc46-textdomain.patch
-Patch1: gcc47-ada.patch
-Patch4: gcc47-libstdc-cygwin.patch
-Patch13: gcc45-cross-exe-suffix.diff
-Patch15: gcc47-execstack.patch
-Patch17: gcc48-specs-cygwin.patch
-Patch19: gcc48-lto-plugin-soname.patch
-Patch21: gcc48-libatomic-cygwin.patch
-Patch23: gcc48-Wimplicit-decls.patch
-Patch24: gcc49-default-manifest.patch
-Patch25: gcc48-libgcc-deregister.patch
-Patch26: gcc48-__cxa_atexit.patch
-Patch27: gcc48-libstdc-atexit_thread.patch
+# Cygwin patches
+Patch1: 0001-share-mingw-fset-stack-executable-with-cygwin.patch
+Patch2: 0002-boehm-gc-for-cygwin.patch
+Patch3: 0003-AWT-Font-fix-for-Cygwin.patch
+Patch4: 0004-Cygwin-ioctl-may-emit-EINVAL.patch
+Patch5: 0005-use-avoid-version-if-not-tracking-SO-version.patch
+Patch6: 0006-cygwin-uses-cyg-library-prefix.patch
+Patch7: 0007-bump-libgcj-version.patch
+Patch8: 0008-libatomic-libtool-fixes-for-Cygwin.patch
+Patch9: 0009-support-64bit-cygwin-too.patch
+Patch10: 0010-Avoid-installing-libffi.patch
+Patch11: 0011-libitm-libtool-fixes-for-Cygwin.patch
+Patch12: 0012-Cygwin-uses-sysv-ABI-on-x86_64.patch
+Patch13: 0013-Do-not-version-lto-plugin-on-cygwin-mingw.patch
+Patch14: 0014-add-dummy-pthread-tsaware-and-large-address-aware-fo.patch
+Patch15: 0015-handle-dllimport-properly-in-medium-model.patch
+Patch16: 0016-skip-test-for-cygwin-mingw.patch
+Patch17: 0017-64bit-Cygwin-uses-SEH.patch
+Patch18: 0018-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch
+Patch19: 0019-fix-some-implicit-declaration-warnings.patch
+Patch20: 0020-fix-gnat-DLL-prefix-for-Cygwin.patch
+Patch21: 0021-__cxa-atexit-for-Cygwin.patch
+Patch22: 0022-prevent-modules-from-being-unloaded-before-their-dto.patch
+Patch23: 0023-Attempt-to-fix-dw2-unwinder-for-Cygwin.patch
+Patch24: 0024-Restore-compile-mode-pthread.patch
+Patch25: 0025-fix-cygwin-stdint.patch
+
+# Fedora-specific patches
+Patch1000: 1000-cross-exe-suffix.patch
+Patch1001: 1001-textdomain.patch
+Patch1002: 1002-isl-r218392.patch
%description
Cygwin cross-compiler (GCC) suite.
+%package common
+Summary: Common data for Cygwin cross-compilers
+Group: Development/Languages
+
+%description common
+%{summary}.
+
%package -n cygwin32-gcc
Summary: Cygwin cross-compiler for C
Group: Development/Languages
@@ -94,6 +123,10 @@ Obsoletes: %{name} < 4.7
# prevent update errors
Obsoletes: %{name}-java < %{version}-%{release}
Obsoletes: cygwin32-gcc-java < %{version}-%{release}
+%if ! %{build_ada}
+Obsoletes: %{name}-gnat < 4.7
+Obsoletes: cygwin32-gcc-gnat < %{version}-%{release}
+%endif
%description -n cygwin32-gcc
@@ -103,6 +136,7 @@ Cygwin i686 cross-compiler (GCC) for C.
%package -n cygwin32-cpp
Summary: Cygwin cross-C Preprocessor
Group: Development/Languages
+Requires: %{name}-common = %{version}-%{release}
Provides: cygwin-cpp = %{version}-%{release}
Obsoletes: cygwin-cpp < 4.7
@@ -185,22 +219,132 @@ Obsoletes: %{name}-gnat < 4.7
%description -n cygwin32-gcc-gnat
Cygwin cross-compiler for Ada.
+%package -n cygwin64-gcc
+Summary: Cygwin64 cross-compiler for C
+Group: Development/Languages
+# NB: Explicit cygwin-filesystem dependency is REQUIRED here.
+Requires: cygwin64-filesystem
+Requires: cygwin64-binutils
+Requires: cygwin64 >= 1.7.32
+Requires: cygwin64-default-manifest
+Requires: cygwin64-w32api-runtime
+Requires: cygwin64-cpp = %{version}-%{release}
+# We don't run the automatic dependency scripts which would
+# normally detect and provide the following DLLs:
+Provides: cygwin64(cygatomic-1.dll)
+Provides: cygwin64(cyggcc_s-seh-1.dll)
+Provides: cygwin64(cyggomp-1.dll)
+Provides: cygwin64(cygquadmath-0.dll)
+Provides: cygwin64(cygssp-0.dll)
+# prevent update errors
+%if ! %{build_ada}
+Obsoletes: cygwin64-gcc-gnat < %{version}-%{release}
+%endif
+
+
+%description -n cygwin64-gcc
+Cygwin x86_64 cross-compiler (GCC) for C.
+
+%package -n cygwin64-cpp
+Summary: Cygwin64 cross-C Preprocessor
+Group: Development/Languages
+Requires: %{name}-common = %{version}-%{release}
+
+%description -n cygwin64-cpp
+Cygwin x86_64 cross-C Preprocessor
+
+
+%package -n cygwin64-gcc-c++
+Summary: Cygwin64 cross-compiler for C++
+Group: Development/Languages
+Requires: cygwin64-gcc = %{version}-%{release}
+# We don't run the automatic dependency scripts which would
+# normally detect and provide the following DLL:
+Provides: cygwin64(cygstdc++-6.dll)
+
+%description -n cygwin64-gcc-c++
+Cygwin x86_64 cross-compiler for C++.
+
+
+%package -n cygwin64-gcc-objc
+Summary: Cygwin64 cross-compiler support for Objective C
+Group: Development/Languages
+Requires: cygwin64-gcc = %{version}-%{release}
+# We don't run the automatic dependency scripts which would
+# normally detect and provide the following DLL:
+Provides: cygwin64(cygobjc-4.dll)
+
+%description -n cygwin64-gcc-objc
+Cygwin x86_64 cross-compiler support for Objective C.
+
+
+%package -n cygwin64-gcc-objc++
+Summary: Cygwin64 cross-compiler support for Objective C++
+Group: Development/Languages
+Requires: cygwin64-gcc-c++ = %{version}-%{release}
+Requires: cygwin64-gcc-objc = %{version}-%{release}
+
+%description -n cygwin64-gcc-objc++
+Cygwin x86_64 cross-compiler support for Objective C++.
+
+
+%package -n cygwin64-gcc-gfortran
+Summary: Cygwin64 cross-compiler for FORTRAN
+Group: Development/Languages
+Requires: cygwin64-gcc = %{version}-%{release}
+# We don't run the automatic dependency scripts which would
+# normally detect and provide the following DLL:
+Provides: cygwin64(cyggfortran-3.dll)
+
+%description -n cygwin64-gcc-gfortran
+Cygwin x86_64 cross-compiler for FORTRAN.
+
+
+%package -n cygwin64-gcc-gnat
+Summary: Cygwin64 cross-compiler for Ada
+Group: Development/Languages
+Requires: cygwin64-gcc = %{version}-%{release}
+# We don't run the automatic dependency scripts which would
+# normally detect and provide the following DLL:
+# (shared libgnat doesn't work quite right, nor does it cross-build
+#Provides: cygwin64(cyggnat-4.7.dll)
+#Provides: cygwin64(cyggnarl-4.7.dll)
+
+%description -n cygwin64-gcc-gnat
+Cygwin x86_64 cross-compiler for Ada.
+
%prep
%setup -q -n gcc-%{gcc_version}
-%patch0 -p2
-%patch1 -p2
-%patch4 -p2
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
%patch13 -p1
-%patch15 -p2
-%patch17 -p0
-%patch19 -p2
-%patch21 -p2
-%patch23 -p2
-%patch24 -p0
-%patch25 -p0
-%patch26 -p2
-%patch27 -p0
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+%patch25 -p1
+
+%patch1000 -p1
+%patch1001 -p1
+%patch1002 -p1
echo %{gcc_version} > gcc/BASE-VER
echo 'Fedora Cygwin %{gcc_version}-%{gcc_release}' > gcc/DEV-PHASE
@@ -223,6 +367,7 @@ CC="%{__cc} ${RPM_OPT_FLAGS}" \
--target=%{cygwin32_target} \
--with-arch=i686 --with-tune=generic \
--with-gnu-as --with-gnu-ld --verbose \
+ --enable-linker-build-id \
--disable-multilib \
--with-system-zlib \
--enable-shared --enable-shared-libgcc --enable-static \
@@ -233,7 +378,7 @@ CC="%{__cc} ${RPM_OPT_FLAGS}" \
--with-sysroot=%{cygwin32_sysroot} \
--enable-shared --enable-shared-libgcc --enable-__cxa_atexit \
--with-dwarf2 --disable-sjlj-exceptions \
-%if 0%{?fedora} >= 15 || 0%{?rhel} == 7
+%if 0%{?fedora} >= 20
--enable-graphite \
%endif
--enable-languages="c,c++,objc,obj-c++,fortran${enablelada},lto" \
@@ -250,40 +395,104 @@ make %{?_smp_mflags} all
popd
+mkdir -p build_cyg64
+pushd build_cyg64
+
+%if %{build_ada}
+enablelada=,ada
+%endif
+
+CC="%{__cc} ${RPM_OPT_FLAGS}" \
+../configure \
+ --prefix=%{_prefix} \
+ --mandir=%{_mandir} \
+ --infodir=%{_infodir} \
+ --build=%_build --host=%_host \
+ --target=%{cygwin64_target} \
+ --with-tune=generic \
+ --with-gnu-as --with-gnu-ld --verbose \
+ --enable-linker-build-id \
+ --disable-multilib \
+ --with-system-zlib \
+ --enable-shared --enable-shared-libgcc --enable-static \
+ --without-included-gettext \
+ --disable-win32-registry \
+ --enable-threads=posix \
+ --enable-version-specific-runtime-libs \
+ --with-sysroot=%{cygwin64_sysroot} \
+ --enable-shared --enable-shared-libgcc --enable-__cxa_atexit \
+ --with-dwarf2 \
+%if 0%{?fedora} >= 20
+ --enable-graphite \
+%endif
+ --enable-languages="c,c++,objc,obj-c++,fortran${enablelada},lto" \
+ --enable-lto --disable-symvers \
+ --enable-libgomp --disable-libitm --enable-libssp \
+ --enable-libquadmath --enable-libquadmath-support \
+ --with-python-dir=/share/gcc-%{gcc_version}/%{cygwin64_target}/python \
+%if %{build_ada}
+ --enable-libada \
+%endif
+ --with-bugurl=http://cygwinports.org
+
+make %{?_smp_mflags} all
+
+popd
+
%install
pushd build_cyg32
make DESTDIR=$RPM_BUILD_ROOT install
+popd
+pushd build_cyg64
+make DESTDIR=$RPM_BUILD_ROOT install
+popd
# These files conflict with existing installed files.
rm -rf $RPM_BUILD_ROOT%{_infodir}
rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty*
rm -f $RPM_BUILD_ROOT%{_mandir}/man7/*
-# This file is provided by cygwin32-libbfd
+# This file is provided by cygwin*-libbfd
rm -f $RPM_BUILD_ROOT%{_prefix}/%{cygwin32_target}/lib/libiberty.a
+rm -f $RPM_BUILD_ROOT%{_prefix}/%{cygwin64_target}/lib/libiberty.a
mkdir -p $RPM_BUILD_ROOT/lib
ln -sf ..%{_prefix}/bin/%{cygwin32_target}-cpp \
$RPM_BUILD_ROOT/lib/%{cygwin32_target}-cpp
+ln -sf ..%{_prefix}/bin/%{cygwin64_target}-cpp \
+ $RPM_BUILD_ROOT/lib/%{cygwin64_target}-cpp
+
+# installation bug on multilib platforms
+mv $RPM_BUILD_ROOT%{_prefix}/lib/gcc/%{cygwin64_target}/lib/libgcc_s.dll.a \
+ $RPM_BUILD_ROOT%{_prefix}/lib/gcc/%{cygwin64_target}/%{gcc_version}/
# libtool installs DLL files of runtime libraries into $(libdir)/../bin,
-# but we need them in cygwin32_bindir.
+# but we need them in cygwin*_bindir.
mkdir -p $RPM_BUILD_ROOT%{cygwin32_bindir}
mv $RPM_BUILD_ROOT%{_prefix}/lib/gcc/%{cygwin32_target}/*.dll \
$RPM_BUILD_ROOT%{_prefix}/lib/gcc/%{cygwin32_target}/%{gcc_version}/*.dll \
$RPM_BUILD_ROOT%{cygwin32_bindir}
+mkdir -p $RPM_BUILD_ROOT%{cygwin64_bindir}
+mv $RPM_BUILD_ROOT%{_prefix}/lib/gcc/%{cygwin64_target}/*.dll \
+ $RPM_BUILD_ROOT%{_prefix}/lib/gcc/%{cygwin64_target}/%{gcc_version}/*.dll \
+ $RPM_BUILD_ROOT%{cygwin64_bindir}
# Don't want the *.la files.
find $RPM_BUILD_ROOT -name '*.la' -delete
-popd
-%find_lang cygwin32-gcc
-%find_lang cygwin32-cpplib
+
+%find_lang cygwin-gcc
+%find_lang cygwin-cpplib
+cat cygwin-cpplib.lang >> cygwin-gcc.lang
+
+
+%files common -f cygwin-gcc.lang
+%doc gcc/README* gcc/COPYING*
-%files -n cygwin32-gcc -f cygwin32-gcc.lang
+%files -n cygwin32-gcc
%{_bindir}/%{cygwin32_target}-gcc
%{_bindir}/%{cygwin32_target}-gcc-%{version}
%{_bindir}/%{cygwin32_target}-gcc-ar
@@ -317,8 +526,8 @@ popd
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/include-fixed/
%dir %{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/install-tools
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/install-tools/*
-%dir %{_libexecdir}/gcc/%{cygwin32_target}/%{version}/install-tools
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/plugin/
+%dir %{_libexecdir}/gcc/%{cygwin32_target}/%{version}/install-tools
%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/install-tools/*
%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/liblto_plugin.so
%{_libexecdir}/gcc/%{cygwin32_target}/%{version}/lto1
@@ -333,10 +542,9 @@ popd
%{cygwin32_bindir}/cygssp-0.dll
%{_mandir}/man1/%{cygwin32_target}-gcc.1*
%{_mandir}/man1/%{cygwin32_target}-gcov.1*
-%doc gcc/README* gcc/COPYING*
-%files -n cygwin32-cpp -f cygwin32-cpplib.lang
+%files -n cygwin32-cpp
/lib/%{cygwin32_target}-cpp
%{_bindir}/%{cygwin32_target}-cpp
%{_mandir}/man1/%{cygwin32_target}-cpp.1*
@@ -404,8 +612,132 @@ popd
#%%{cygwin32_bindir}/cyggnat-4.7.dll
%endif
+%files -n cygwin64-gcc
+%{_bindir}/%{cygwin64_target}-gcc
+%{_bindir}/%{cygwin64_target}-gcc-%{version}
+%{_bindir}/%{cygwin64_target}-gcc-ar
+%{_bindir}/%{cygwin64_target}-gcc-nm
+%{_bindir}/%{cygwin64_target}-gcc-ranlib
+%{_bindir}/%{cygwin64_target}-gcov
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}/%{version}
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/crtbegin.o
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/crtbeginS.o
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/crtend.o
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/crtfastmath.o
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libatomic.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libatomic.dll.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgcc.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgcc_eh.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgcc_s.dll.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgcov.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgomp.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgomp.dll.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgomp.spec
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libquadmath.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libquadmath.dll.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libssp.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libssp_nonshared.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libssp.dll.a
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include/ssp
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include/[^j]*.h
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include/ssp/*.h
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include-fixed/
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/install-tools
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/install-tools/*
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/plugin/
+%dir %{_libexecdir}/gcc/%{cygwin64_target}/%{version}/install-tools
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/install-tools/*
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/liblto_plugin.so
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/lto1
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/lto-wrapper
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/plugin/
+%dir %{_datadir}/gcc-%{gcc_version}
+%dir %{_datadir}/gcc-%{gcc_version}/%{cygwin64_target}
+%{cygwin64_bindir}/cygatomic-1.dll
+%{cygwin64_bindir}/cyggcc_s-seh-1.dll
+%{cygwin64_bindir}/cyggomp-1.dll
+%{cygwin64_bindir}/cygquadmath-0.dll
+%{cygwin64_bindir}/cygssp-0.dll
+%{_mandir}/man1/%{cygwin64_target}-gcc.1*
+%{_mandir}/man1/%{cygwin64_target}-gcov.1*
+
+
+%files -n cygwin64-cpp
+/lib/%{cygwin64_target}-cpp
+%{_bindir}/%{cygwin64_target}-cpp
+%{_mandir}/man1/%{cygwin64_target}-cpp.1*
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}/%{version}
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/cc1
+
+
+%files -n cygwin64-gcc-c++
+%{_bindir}/%{cygwin64_target}-g++
+%{_bindir}/%{cygwin64_target}-c++
+%{_mandir}/man1/%{cygwin64_target}-g++.1*
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include/c++
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include/c++/[^gjos]*
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include/c++/os*
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include/c++/s[^u]*
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libstdc++.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libstdc++.dll.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libstdc++.dll.a-gdb.py
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libsupc++.a
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/cc1plus
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/collect2
+%dir %{_datadir}/gcc-%{gcc_version}/%{cygwin64_target}/python
+%{_datadir}/gcc-%{gcc_version}/%{cygwin64_target}/python/libstdcxx/
+%{cygwin64_bindir}/cygstdc++-6.dll
+
+
+%files -n cygwin64-gcc-objc
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include/objc/
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libobjc.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libobjc.dll.a
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/cc1obj
+%{cygwin64_bindir}/cygobjc-4.dll
+
+
+%files -n cygwin64-gcc-objc++
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/cc1objplus
+
+
+%files -n cygwin64-gcc-gfortran
+%{_bindir}/%{cygwin64_target}-gfortran
+%{_mandir}/man1/%{cygwin64_target}-gfortran.1*
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libcaf_single.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgfortran.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgfortran.dll.a
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgfortran.spec
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libgfortranbegin.a
+%dir %{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/finclude
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/finclude/omp_lib.f90
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/finclude/omp_lib.h
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/finclude/omp_lib.mod
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/finclude/omp_lib_kinds.mod
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/f951
+%{cygwin64_bindir}/cyggfortran-3.dll
+
+
+%if %{build_ada}
+%files -n cygwin64-gcc-gnat
+%{_bindir}/%{cygwin64_target}-gnat*
+#%%{_mandir}/man1/%%{cygwin64_target}-gnat*.1*
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/adainclude/
+%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/adalib/
+%{_libexecdir}/gcc/%{cygwin64_target}/%{version}/gnat1
+#%%{cygwin64_bindir}/cyggnarl-4.7.dll
+#%%{cygwin64_bindir}/cyggnat-4.7.dll
+%endif
+
%changelog
+* Fri Jun 19 2015 Yaakov Selkowitz <yselkowi@redhat.com> - 4.9.2-1
+- Update to 4.9.2
+- Build cygwin32-gcc and cygwin64-gcc from single SRPM
+
* Sun Nov 02 2014 Yaakov Selkowitz <yselkowi@redhat.com> - 4.8.3-6
- Fix optimization issue in crtbeginS.o.
diff --git a/gcc45-java-FIONREAD.diff b/gcc45-java-FIONREAD.diff
deleted file mode 100644
index 3086e1b..0000000
--- a/gcc45-java-FIONREAD.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35536
-
---- origsrc/gcc-4.5.1/libjava/gnu/java/nio/channels/natFileChannelPosix.cc 2007-04-02 20:05:50.000000000 -0500
-+++ src/gcc-4.5.1/libjava/gnu/java/nio/channels/natFileChannelPosix.cc 2010-10-27 13:39:34.044718100 -0500
-@@ -386,7 +386,7 @@ FileChannelImpl::available (void)
-
- #if defined (FIONREAD)
- r = ::ioctl (fd, FIONREAD, &num);
-- if (r == -1 && errno == ENOTTY)
-+ if (r == -1 && (errno == ENOTTY || errno == EINVAL))
- {
- // If the ioctl doesn't work, we don't care.
- r = 0;
diff --git a/gcc47-ada.patch b/gcc47-ada.patch
deleted file mode 100644
index 419636f..0000000
--- a/gcc47-ada.patch
+++ /dev/null
@@ -1,3285 +0,0 @@
---- origsrc/gcc-4.7.2/gcc/ada/a-intnam-cygwin.ads 1970-01-01 00:00:00.000000000 +0000
-+++ src/gcc-4.7.2/gcc/ada/a-intnam-cygwin.ads 2012-11-01 21:17:31.000000000 +0000
-@@ -0,0 +1,170 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-+-- --
-+-- A D A . I N T E R R U P T S . N A M E S --
-+-- --
-+-- S p e c --
-+-- --
-+-- Copyright (C) 1991-2011, Free Software Foundation, Inc. --
-+-- --
-+-- GNARL is free software; you can redistribute it and/or modify it under --
-+-- terms of the GNU General Public License as published by the Free Soft- --
-+-- ware Foundation; either version 3, or (at your option) any later ver- --
-+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-+-- --
-+-- As a special exception under Section 7 of GPL version 3, you are granted --
-+-- additional permissions described in the GCC Runtime Library Exception, --
-+-- version 3.1, as published by the Free Software Foundation. --
-+-- --
-+-- You should have received a copy of the GNU General Public License and --
-+-- a copy of the GCC Runtime Library Exception along with this program; --
-+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-+-- <http://www.gnu.org/licenses/>. --
-+-- --
-+-- GNARL was developed by the GNARL team at Florida State University. --
-+-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-+-- --
-+------------------------------------------------------------------------------
-+
-+-- This is a Cygwin version of this package but really it's a copy of the
-+-- Linux version, so the below comments are probably irrelevant:
-+
-+-- The following signals are reserved by the run time (FSU threads):
-+
-+-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGABRT, SIGINT,
-+-- SIGALRM, SIGVTALRM, SIGUNUSED, SIGSTOP, SIGKILL
-+
-+-- The following signals are reserved by the run time (LinuxThreads):
-+
-+-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGABRT, SIGINT,
-+-- SIGUSR1, SIGUSR2, SIGVTALRM, SIGUNUSED, SIGSTOP, SIGKILL
-+
-+-- The pragma Unreserve_All_Interrupts affects the following signal(s):
-+
-+-- SIGINT: made available for Ada handler
-+
-+-- This target-dependent package spec contains names of interrupts
-+-- supported by the local system.
-+
-+with System.OS_Interface;
-+-- used for names of interrupts
-+
-+package Ada.Interrupts.Names is
-+
-+ -- All identifiers in this unit are implementation defined
-+
-+ pragma Implementation_Defined;
-+
-+ -- Beware that the mapping of names to signals may be many-to-one. There
-+ -- may be aliases. Also, for all signal names that are not supported on the
-+ -- current system the value of the corresponding constant will be zero.
-+
-+ SIGHUP : constant Interrupt_ID :=
-+ System.OS_Interface.SIGHUP; -- hangup
-+
-+ SIGINT : constant Interrupt_ID :=
-+ System.OS_Interface.SIGINT; -- interrupt (rubout)
-+
-+ SIGQUIT : constant Interrupt_ID :=
-+ System.OS_Interface.SIGQUIT; -- quit (ASCD FS)
-+
-+ SIGILL : constant Interrupt_ID :=
-+ System.OS_Interface.SIGILL; -- illegal instruction (not reset)
-+
-+ SIGTRAP : constant Interrupt_ID :=
-+ System.OS_Interface.SIGTRAP; -- trace trap (not reset)
-+
-+ SIGIOT : constant Interrupt_ID :=
-+ System.OS_Interface.SIGIOT; -- IOT instruction
-+
-+ SIGABRT : constant Interrupt_ID := -- used by abort,
-+ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future
-+
-+ SIGFPE : constant Interrupt_ID :=
-+ System.OS_Interface.SIGFPE; -- floating point exception
-+
-+ SIGKILL : constant Interrupt_ID :=
-+ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored)
-+
-+ SIGBUS : constant Interrupt_ID :=
-+ System.OS_Interface.SIGBUS; -- bus error
-+
-+ SIGSEGV : constant Interrupt_ID :=
-+ System.OS_Interface.SIGSEGV; -- segmentation violation
-+
-+ SIGPIPE : constant Interrupt_ID := -- write on a pipe with
-+ System.OS_Interface.SIGPIPE; -- no one to read it
-+
-+ SIGALRM : constant Interrupt_ID :=
-+ System.OS_Interface.SIGALRM; -- alarm clock
-+
-+ SIGTERM : constant Interrupt_ID :=
-+ System.OS_Interface.SIGTERM; -- software termination signal from kill
-+
-+ SIGUSR1 : constant Interrupt_ID :=
-+ System.OS_Interface.SIGUSR1; -- user defined signal 1
-+
-+ SIGUSR2 : constant Interrupt_ID :=
-+ System.OS_Interface.SIGUSR2; -- user defined signal 2
-+
-+ SIGCLD : constant Interrupt_ID :=
-+ System.OS_Interface.SIGCLD; -- child status change
-+
-+ SIGCHLD : constant Interrupt_ID :=
-+ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD
-+
-+ SIGWINCH : constant Interrupt_ID :=
-+ System.OS_Interface.SIGWINCH; -- window size change
-+
-+ SIGURG : constant Interrupt_ID :=
-+ System.OS_Interface.SIGURG; -- urgent condition on IO channel
-+
-+ SIGPOLL : constant Interrupt_ID :=
-+ System.OS_Interface.SIGPOLL; -- pollable event occurred
-+
-+ SIGIO : constant Interrupt_ID := -- input/output possible,
-+ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris)
-+
-+ SIGSTOP : constant Interrupt_ID :=
-+ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored)
-+
-+ SIGTSTP : constant Interrupt_ID :=
-+ System.OS_Interface.SIGTSTP; -- user stop requested from tty
-+
-+ SIGCONT : constant Interrupt_ID :=
-+ System.OS_Interface.SIGCONT; -- stopped process has been continued
-+
-+ SIGTTIN : constant Interrupt_ID :=
-+ System.OS_Interface.SIGTTIN; -- background tty read attempted
-+
-+ SIGTTOU : constant Interrupt_ID :=
-+ System.OS_Interface.SIGTTOU; -- background tty write attempted
-+
-+ SIGVTALRM : constant Interrupt_ID :=
-+ System.OS_Interface.SIGVTALRM; -- virtual timer expired
-+
-+ SIGPROF : constant Interrupt_ID :=
-+ System.OS_Interface.SIGPROF; -- profiling timer expired
-+
-+ SIGXCPU : constant Interrupt_ID :=
-+ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded
-+
-+ SIGXFSZ : constant Interrupt_ID :=
-+ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded
-+
-+ SIGUNUSED : constant Interrupt_ID :=
-+ System.OS_Interface.SIGUNUSED; -- unused signal
-+
-+ SIGSTKFLT : constant Interrupt_ID :=
-+ System.OS_Interface.SIGSTKFLT; -- stack fault on coprocessor
-+
-+ SIGLOST : constant Interrupt_ID :=
-+ System.OS_Interface.SIGLOST; -- Linux alias for SIGIO
-+
-+ SIGPWR : constant Interrupt_ID :=
-+ System.OS_Interface.SIGPWR; -- Power failure
-+
-+end Ada.Interrupts.Names;
---- origsrc/gcc-4.7.2/gcc/ada/gcc-interface/Makefile.in 2012-11-02 15:16:49.765625000 +0000
-+++ src/gcc-4.7.2/gcc/ada/gcc-interface/Makefile.in 2012-11-01 21:17:31.000000000 +0000
-@@ -191,6 +191,13 @@ TARGET_ADA_SRCS =
- # Type of tools build we are doing; default is not compiling tools.
- TOOLSCASE =
-
-+# Which install goal to use.
-+INSTALL_GNATLIB_MAIN = install-gnatlib
-+INSTALL_GNATLIB_WIN32 = unused-install-gnatlib
-+
-+# Set shared lib prefix (lib on all systems but cygwin, which uses cyg)
-+LIBGNAT_SHARED_LIB_PREFIX=lib
-+
- # Multilib handling
- MULTISUBDIR =
- RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
-@@ -1583,6 +1590,12 @@ ifeq ($(strip $(filter-out avr none powe
-
- # Cygwin/Mingw32
- ifeq ($(strip $(filter-out cygwin% mingw32% pe,$(osys))),)
-+ # Set target pair suffix for mingw or cygwin
-+ W32_TARG=mingw
-+ ifneq ($(strip $(filter cygwin%,$(osys))),)
-+ W32_TARG=cygwin
-+ LIBGNAT_SHARED_LIB_PREFIX=cyg
-+ endif
- # Cygwin provides a full Posix environment, and so we use the default
- # versions of s-memory and g-socthi rather than the Windows-specific
- # MinGW versions. Ideally we would use all the default versions for
-@@ -1651,24 +1664,24 @@ ifeq ($(strip $(filter-out cygwin% mingw
- ifeq ($(strip $(MULTISUBDIR)),/32)
- LIBGNAT_TARGET_PAIRS += \
- $(X86_TARGET_PAIRS) \
-- system.ads<system-mingw.ads
-+ system.ads<system-$(W32_TARG).ads
- SO_OPTS= -m32 -Wl,-soname,
- else
- LIBGNAT_TARGET_PAIRS += \
- $(X86_64_TARGET_PAIRS) \
-- system.ads<system-mingw-x86_64.ads
-+ system.ads<system-$(W32_TARG)-x86_64.ads
- SO_OPTS = -m64 -Wl,-soname,
- endif
- else
- ifeq ($(strip $(MULTISUBDIR)),/64)
- LIBGNAT_TARGET_PAIRS += \
- $(X86_64_TARGET_PAIRS) \
-- system.ads<system-mingw-x86_64.ads
-+ system.ads<system-$(W32_TARG)-x86_64.ads
- SO_OPTS = -m64 -Wl,-soname,
- else
- LIBGNAT_TARGET_PAIRS += \
- $(X86_TARGET_PAIRS) \
-- system.ads<system-mingw.ads
-+ system.ads<system-$(W32_TARG).ads
- SO_OPTS = -m32 -Wl,-soname,
- endif
- endif
-@@ -1677,7 +1690,14 @@ ifeq ($(strip $(filter-out cygwin% mingw
- s-win32.o s-winext.o g-regist.o g-sse.o g-ssvety.o
- EXTRA_GNATRTL_TASKING_OBJS = a-exetim.o
-
-- MISCLIB = -lws2_32
-+ # Which install goal to use.
-+ INSTALL_GNATLIB_MAIN = unused-install-gnatlib
-+ INSTALL_GNATLIB_WIN32 = install-gnatlib
-+
-+ # Mingw uses winsock-based sockets; cygwin uses POSIX sockets.
-+ ifneq ($(strip $(filter-out cygwin%,$(osys))),)
-+ MISCLIB = -lwsock32
-+ endif
-
- # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT
- # auto-import support for array/record will be done.
-@@ -1687,10 +1707,11 @@ ifeq ($(strip $(filter-out cygwin% mingw
- endif
-
- TOOLS_TARGET_PAIRS= \
-- mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
-- indepsw.adb<indepsw-mingw.adb
-+ mlib-tgt-specific.adb<mlib-tgt-specific-$(W32_TARG).adb \
-+ indepsw.adb<indepsw-$(W32_TARG).adb
-
- GMEM_LIB = gmemlib
-+ EH_MECHANISM=-gcc
- EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
- EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
- soext = .dll
-@@ -2425,7 +2446,7 @@ gnatlink-re: ../stamp-tools link.o targe
- true; \
- fi
-
--install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
-+$(INSTALL_GNATLIB_MAIN): ../stamp-gnatlib-$(RTSDIR)
- # Create the directory before deleting it, in case the directory is
- # a list of directories (as it may be on VMS). This ensures we are
- # deleting the right one.
-@@ -2472,6 +2493,46 @@ install-gnatlib: ../stamp-gnatlib-$(RTSD
- cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
- cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
-
-+$(INSTALL_GNATLIB_WIN32): ../stamp-gnatlib-$(RTSDIR)
-+# Create the directory before deleting it, in case the directory is
-+# a list of directories (as it may be on VMS). This ensures we are
-+# deleting the right one.
-+ -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
-+ -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
-+ $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
-+ $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
-+ -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
-+ -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
-+ for file in $(RTSDIR)/*.ali; do \
-+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
-+ done
-+ -$(INSTALL_DATA) $(RTSDIR)/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
-+ -cd $(RTSDIR); for file in *$(arext);do \
-+ $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
-+ $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
-+ done
-+ -$(foreach file, $(EXTRA_ADALIB_FILES), \
-+ $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
-+ ) true
-+# Install the shared libraries, if any, using $(INSTALL) instead
-+# of $(INSTALL_DATA). The latter may force a mode inappropriate
-+# for shared libraries on some targets, e.g. on HP-UX where the x
-+# permission is required. We are win32 here.
-+ for file in gnat gnarl; do \
-+ if [ -f $(RTSDIR)/$(LIBGNAT_SHARED_LIB_PREFIX)$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
-+ $(INSTALL) $(RTSDIR)/$(LIBGNAT_SHARED_LIB_PREFIX)$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
-+ $(DESTDIR)$(bindir); \
-+ $(LN_S) $(bindir)/$(LIBGNAT_SHARED_LIB_PREFIX)$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
-+ $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION).dll.a; \
-+ fi; \
-+ done
-+# This copy must be done preserving the date on the original file.
-+ for file in $(RTSDIR)/*.ad?; do \
-+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
-+ done
-+ cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
-+ cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
-+
- ../stamp-gnatlib2-$(RTSDIR):
- $(RM) $(RTSDIR)/s-*.ali
- $(RM) $(RTSDIR)/s-*$(objext)
-@@ -2672,20 +2733,20 @@ gnatlib-shared-win32:
- MULTISUBDIR="$(MULTISUBDIR)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
-- $(RM) $(RTSDIR)/libgna*$(soext)
-+ $(RM) $(RTSDIR)/$(LIBGNAT_SHARED_LIB_PREFIX)gna*$(soext)
- cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
- | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
- $(PICFLAG_FOR_TARGET) \
-- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
-+ -o $(LIBGNAT_SHARED_LIB_PREFIX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
-- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
-+ $(SO_OPTS)$(LIBGNAT_SHARED_LIB_PREFIX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
- cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
- | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
- $(PICFLAG_FOR_TARGET) \
-- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
-+ -o $(LIBGNAT_SHARED_LIB_PREFIX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_TASKING_OBJS) \
-- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
-- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
-+ $(SO_OPTS)$(LIBGNAT_SHARED_LIB_PREFIX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
-+ $(THREADSLIB) -Wl,$(LIBGNAT_SHARED_LIB_PREFIX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext)
-
- gnatlib-shared-darwin:
- $(MAKE) $(FLAGS_TO_PASS) \
---- origsrc/gcc-4.7.2/gcc/ada/gsocket.h 2012-11-02 15:16:49.781250000 +0000
-+++ src/gcc-4.7.2/gcc/ada/gsocket.h 2012-11-01 21:17:31.000000000 +0000
-@@ -204,7 +204,7 @@
- #endif
-
- #if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || \
-- defined (_WIN32) || defined (__APPLE__)
-+ defined (_WIN32) || defined (__APPLE__) || defined (__CYGWIN__)
- # define HAVE_THREAD_SAFE_GETxxxBYyyy 1
-
- #elif defined (linux) || defined (__GLIBC__) || \
---- origsrc/gcc-4.7.2/gcc/ada/indepsw-cygwin.adb 1970-01-01 00:00:00.000000000 +0000
-+++ src/gcc-4.7.2/gcc/ada/indepsw-cygwin.adb 2012-11-01 21:17:31.000000000 +0000
-@@ -0,0 +1,67 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- GNAT COMPILER COMPONENTS --
-+-- --
-+-- I N D E P S W --
-+-- --
-+-- B o d y --
-+-- (Windows version) --
-+-- --
-+-- Copyright (C) 2009 Free Software Foundation, Inc. --
-+-- --
-+-- GNAT is free software; you can redistribute it and/or modify it under --
-+-- terms of the GNU General Public License as published by the Free Soft- --
-+-- ware Foundation; either version 3, or (at your option) any later ver- --
-+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-+-- --
-+-- As a special exception under Section 7 of GPL version 3, you are granted --
-+-- additional permissions described in the GCC Runtime Library Exception, --
-+-- version 3.1, as published by the Free Software Foundation. --
-+-- --
-+-- You should have received a copy of the GNU General Public License and --
-+-- a copy of the GCC Runtime Library Exception along with this program; --
-+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-+-- <http://www.gnu.org/licenses/>. --
-+-- --
-+-- GNAT was originally developed by the GNAT team at New York University. --
-+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-+-- --
-+------------------------------------------------------------------------------
-+
-+-- This is the Windows version
-+
-+package body Indepsw is
-+
-+ Map_Switch : aliased constant String := "-Wl,-Map,";
-+
-+ -------------
-+ -- Convert --
-+ -------------
-+
-+ procedure Convert
-+ (Switch : Switch_Kind;
-+ Argument : String;
-+ To : out String_List_Access)
-+ is
-+ begin
-+ case Switch is
-+ when Map_File =>
-+ To := new Argument_List'(1 => new String'(Map_Switch & Argument));
-+ end case;
-+ end Convert;
-+
-+ ------------------
-+ -- Is_Supported --
-+ ------------------
-+
-+ function Is_Supported (Switch : Switch_Kind) return Boolean is
-+ begin
-+ case Switch is
-+ when Map_File =>
-+ return True;
-+ end case;
-+ end Is_Supported;
-+
-+end Indepsw;
---- origsrc/gcc-4.7.2/gcc/ada/initialize.c 2012-11-02 15:16:50.031250000 +0000
-+++ src/gcc-4.7.2/gcc/ada/initialize.c 2012-11-01 21:17:31.000000000 +0000
-@@ -348,6 +348,40 @@ __gnat_initialize (void *eh ATTRIBUTE_UN
- __main ();
- }
-
-+#elif defined (__CYGWIN__)
-+
-+/***************************************/
-+/* __gnat_initialize (Cygwin Version) */
-+/***************************************/
-+
-+extern void __main (void);
-+
-+void
-+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
-+{
-+#ifdef IN_RTS
-+ /* We must call __main to run the static ctors, or DW2 EH, amongst
-+ other things, will fail. */
-+ __main ();
-+#endif
-+ /* Initialize floating-point coprocessor. This call is needed because
-+ the MS libraries default to 64-bit precision instead of 80-bit
-+ precision, and we require the full precision for proper operation,
-+ given that we have set Max_Digits etc with this in mind */
-+ __gnat_init_float ();
-+
-+ /* Note that we do not activate this for the compiler itself to avoid a
-+ bootstrap path problem. Older version of gnatbind will generate a call
-+ to __gnat_initialize() without argument. Therefore we cannot use eh in
-+ this case. It will be possible to remove the following #ifdef at some
-+ point. */
-+#ifdef IN_RTS
-+ /* Install the Structured Exception handler. */
-+ if (eh)
-+ __gnat_install_SEH_handler (eh);
-+#endif
-+}
-+
- #else
-
- /* For all other versions of GNAT, the initialize routine and handler
---- origsrc/gcc-4.7.2/gcc/ada/mlib-tgt-specific-cygwin.adb 1970-01-01 00:00:00.000000000 +0000
-+++ src/gcc-4.7.2/gcc/ada/mlib-tgt-specific-cygwin.adb 2012-11-01 21:17:31.000000000 +0000
-@@ -0,0 +1,162 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- GNAT COMPILER COMPONENTS --
-+-- --
-+-- M L I B . T G T . S P E C I F I C --
-+-- (Cygwin Version) --
-+-- --
-+-- B o d y --
-+-- --
-+-- Copyright (C) 2002-2010, Free Software Foundation, Inc. --
-+-- --
-+-- GNAT is free software; you can redistribute it and/or modify it under --
-+-- terms of the GNU General Public License as published by the Free Soft- --
-+-- ware Foundation; either version 3, or (at your option) any later ver- --
-+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-+-- for more details. You should have received a copy of the GNU General --
-+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-+-- http://www.gnu.org/licenses for a complete copy of the license. --
-+-- --
-+-- GNAT was originally developed by the GNAT team at New York University. --
-+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-+-- --
-+------------------------------------------------------------------------------
-+
-+-- This is the Windows version of the body. Works only with GCC versions
-+-- supporting the "-shared" option.
-+
-+with Opt;
-+with Output; use Output;
-+
-+with MLib.Fil;
-+with MLib.Utl;
-+
-+package body MLib.Tgt.Specific is
-+
-+ package Files renames MLib.Fil;
-+ package Tools renames MLib.Utl;
-+
-+ -- Non default subprograms
-+
-+ procedure Build_Dynamic_Library
-+ (Ofiles : Argument_List;
-+ Options : Argument_List;
-+ Interfaces : Argument_List;
-+ Lib_Filename : String;
-+ Lib_Dir : String;
-+ Symbol_Data : Symbol_Record;
-+ Driver_Name : Name_Id := No_Name;
-+ Lib_Version : String := "";
-+ Auto_Init : Boolean := False);
-+
-+ function DLL_Ext return String;
-+
-+ function DLL_Prefix return String;
-+
-+ function Is_Archive_Ext (Ext : String) return Boolean;
-+
-+ function Library_Major_Minor_Id_Supported return Boolean;
-+
-+ function PIC_Option return String;
-+
-+ Shared_Libgcc : aliased String := "-shared-libgcc";
-+
-+ Shared_Libgcc_Switch : constant Argument_List :=
-+ (1 => Shared_Libgcc'Access);
-+
-+ ---------------------------
-+ -- Build_Dynamic_Library --
-+ ---------------------------
-+
-+ procedure Build_Dynamic_Library
-+ (Ofiles : Argument_List;
-+ Options : Argument_List;
-+ Interfaces : Argument_List;
-+ Lib_Filename : String;
-+ Lib_Dir : String;
-+ Symbol_Data : Symbol_Record;
-+ Driver_Name : Name_Id := No_Name;
-+ Lib_Version : String := "";
-+ Auto_Init : Boolean := False)
-+ is
-+ pragma Unreferenced (Symbol_Data);
-+ pragma Unreferenced (Interfaces);
-+ pragma Unreferenced (Lib_Version);
-+ pragma Unreferenced (Auto_Init);
-+
-+ Lib_File : constant String :=
-+ Lib_Dir & Directory_Separator &
-+ DLL_Prefix & Files.Append_To (Lib_Filename, DLL_Ext);
-+
-+ -- Start of processing for Build_Dynamic_Library
-+
-+ begin
-+ if Opt.Verbose_Mode then
-+ Write_Str ("building relocatable shared library ");
-+ Write_Line (Lib_File);
-+ end if;
-+
-+ Tools.Gcc
-+ (Output_File => Lib_File,
-+ Objects => Ofiles,
-+ Options => Shared_Libgcc_Switch,
-+ Options_2 => Options,
-+ Driver_Name => Driver_Name);
-+ end Build_Dynamic_Library;
-+
-+ -------------
-+ -- DLL_Ext --
-+ -------------
-+
-+ function DLL_Ext return String is
-+ begin
-+ return "dll";
-+ end DLL_Ext;
-+
-+ ----------------
-+ -- DLL_Prefix --
-+ ----------------
-+
-+ function DLL_Prefix return String is
-+ begin
-+ return "cyg";
-+ end DLL_Prefix;
-+
-+ --------------------
-+ -- Is_Archive_Ext --
-+ --------------------
-+
-+ function Is_Archive_Ext (Ext : String) return Boolean is
-+ begin
-+ return Ext = ".a" or else Ext = ".dll";
-+ end Is_Archive_Ext;
-+
-+ --------------------------------------
-+ -- Library_Major_Minor_Id_Supported --
-+ --------------------------------------
-+
-+ function Library_Major_Minor_Id_Supported return Boolean is
-+ begin
-+ return False;
-+ end Library_Major_Minor_Id_Supported;
-+
-+ ----------------
-+ -- PIC_Option --
-+ ----------------
-+
-+ function PIC_Option return String is
-+ begin
-+ return "";
-+ end PIC_Option;
-+
-+begin
-+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
-+ DLL_Ext_Ptr := DLL_Ext'Access;
-+ DLL_Prefix_Ptr := DLL_Prefix'Access;
-+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
-+ PIC_Option_Ptr := PIC_Option'Access;
-+ Library_Major_Minor_Id_Supported_Ptr :=
-+ Library_Major_Minor_Id_Supported'Access;
-+end MLib.Tgt.Specific;
---- origsrc/gcc-4.7.2/gcc/ada/s-gloloc-cygwin.adb 1970-01-01 00:00:00.000000000 +0000
-+++ src/gcc-4.7.2/gcc/ada/s-gloloc-cygwin.adb 2012-11-01 21:17:31.000000000 +0000
-@@ -0,0 +1,107 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- GNAT COMPILER COMPONENTS --
-+-- --
-+-- S Y S T E M . G L O B A L _ L O C K S --
-+-- --
-+-- B o d y --
-+-- --
-+-- Copyright (C) 1999-2010, AdaCore --
-+-- --
-+-- GNAT is free software; you can redistribute it and/or modify it under --
-+-- terms of the GNU General Public License as published by the Free Soft- --
-+-- ware Foundation; either version 3, or (at your option) any later ver- --
-+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-+-- --
-+-- As a special exception under Section 7 of GPL version 3, you are granted --
-+-- additional permissions described in the GCC Runtime Library Exception, --
-+-- version 3.1, as published by the Free Software Foundation. --
-+-- --
-+-- You should have received a copy of the GNU General Public License and --
-+-- a copy of the GCC Runtime Library Exception along with this program; --
-+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-+-- <http://www.gnu.org/licenses/>. --
-+-- --
-+-- GNAT was originally developed by the GNAT team at New York University. --
-+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-+-- --
-+------------------------------------------------------------------------------
-+
-+-- This implementation is specific to NT
-+
-+with System.OS_Interface;
-+with System.Task_Lock;
-+with System.Win32;
-+
-+with Interfaces.C.Strings;
-+
-+package body System.Global_Locks is
-+
-+ package TSL renames System.Task_Lock;
-+ package OSI renames System.OS_Interface;
-+ package ICS renames Interfaces.C.Strings;
-+
-+ subtype Lock_File_Entry is Win32.HANDLE;
-+
-+ Last_Lock : Lock_Type := Null_Lock;
-+ Lock_Table : array (Lock_Type range 1 .. 15) of Lock_File_Entry;
-+
-+ -----------------
-+ -- Create_Lock --
-+ -----------------
-+
-+ procedure Create_Lock (Lock : out Lock_Type; Name : String) is
-+ L : Lock_Type;
-+
-+ begin
-+ TSL.Lock;
-+ Last_Lock := Last_Lock + 1;
-+ L := Last_Lock;
-+ TSL.Unlock;
-+
-+ if L > Lock_Table'Last then
-+ raise Lock_Error;
-+ end if;
-+
-+ Lock_Table (L) :=
-+ OSI.CreateMutex (null, Win32.FALSE, ICS.New_String (Name));
-+ Lock := L;
-+ end Create_Lock;
-+
-+ ------------------
-+ -- Acquire_Lock --
-+ ------------------
-+
-+ procedure Acquire_Lock (Lock : in out Lock_Type) is
-+ use type Win32.DWORD;
-+
-+ Res : Win32.DWORD;
-+
-+ begin
-+ Res := OSI.WaitForSingleObject (Lock_Table (Lock), OSI.Wait_Infinite);
-+
-+ if Res = OSI.WAIT_FAILED then
-+ raise Lock_Error;
-+ end if;
-+ end Acquire_Lock;
-+
-+ ------------------
-+ -- Release_Lock --
-+ ------------------
-+
-+ procedure Release_Lock (Lock : in out Lock_Type) is
-+ use type Win32.BOOL;
-+
-+ Res : Win32.BOOL;
-+
-+ begin
-+ Res := OSI.ReleaseMutex (Lock_Table (Lock));
-+
-+ if Res = Win32.FALSE then
-+ raise Lock_Error;
-+ end if;
-+ end Release_Lock;
-+
-+end System.Global_Locks;
---- origsrc/gcc-4.8.2/gcc/ada/s-oscons-tmplt.c (revision 202887)
-+++ src/gcc-4.8.2/gcc/ada/s-oscons-tmplt.c (working copy)
-@@ -973,7 +973,12 @@
-
- #endif /* HAVE_TERMIOS */
-
--#ifdef __MINGW32__
-+#ifdef __CYGWIN__
-+#define RTS_CONTROL_ENABLE 0x1
-+#define DTR_CONTROL_ENABLE 0x1
-+#endif
-+
-+#if defined (__CYGWIN__) || defined (__MINGW32__)
- CNU(DTR_CONTROL_ENABLE, "Enable DTR flow ctrl")
- CNU(RTS_CONTROL_ENABLE, "Enable RTS flow ctrl")
- #endif
-
---- origsrc/gcc-4.7.2/gcc/ada/s-osinte-cygwin.ads 1970-01-01 00:00:00.000000000 +0000
-+++ src/gcc-4.7.2/gcc/ada/s-osinte-cygwin.ads 2012-11-01 21:17:31.000000000 +0000
-@@ -0,0 +1,951 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-+-- --
-+-- S Y S T E M . O S _ I N T E R F A C E --
-+-- --
-+-- S p e c --
-+-- --
-+-- Copyright (C) 1991-1994, Florida State University --
-+-- Copyright (C) 1995-2010, Free Software Foundation, Inc. --
-+-- --
-+-- GNAT is free software; you can redistribute it and/or modify it under --
-+-- terms of the GNU General Public License as published by the Free Soft- --
-+-- ware Foundation; either version 3, or (at your option) any later ver- --
-+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-+-- --
-+-- As a special exception under Section 7 of GPL version 3, you are granted --
-+-- additional permissions described in the GCC Runtime Library Exception, --
-+-- version 3.1, as published by the Free Software Foundation. --
-+-- --
-+-- You should have received a copy of the GNU General Public License and --
-+-- a copy of the GCC Runtime Library Exception along with this program; --
-+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-+-- <http://www.gnu.org/licenses/>. --
-+-- --
-+-- GNARL was developed by the GNARL team at Florida State University. --
-+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-+-- --
-+------------------------------------------------------------------------------
-+
-+-- This is a GNU/Linux (GNU/LinuxThreads) version of this package
-+
-+-- This package encapsulates all direct interfaces to OS services
-+-- that are needed by children of System.
-+
-+-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
-+-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
-+
-+with Interfaces.C;
-+with Interfaces.C.Strings;
-+with Ada.Unchecked_Conversion;
-+
-+package System.OS_Interface is
-+ pragma Preelaborate;
-+
-+ subtype int is Interfaces.C.int;
-+ subtype char is Interfaces.C.char;
-+ subtype short is Interfaces.C.short;
-+ subtype long is Interfaces.C.long;
-+ subtype unsigned is Interfaces.C.unsigned;
-+ subtype unsigned_short is Interfaces.C.unsigned_short;
-+ subtype unsigned_long is Interfaces.C.unsigned_long;
-+ subtype unsigned_char is Interfaces.C.unsigned_char;
-+ subtype plain_char is Interfaces.C.plain_char;
-+ subtype size_t is Interfaces.C.size_t;
-+
-+ -----------
-+ -- Errno --
-+ -----------
-+
-+ function errno return int;
-+ pragma Import (C, errno, "__get_errno");
-+
-+ EAGAIN : constant := 11;
-+ EINTR : constant := 4;
-+ EINVAL : constant := 22;
-+ ENOMEM : constant := 12;
-+ EPERM : constant := 1;
-+ ETIMEDOUT : constant := 110;
-+
-+ -------------
-+ -- Signals --
-+ -------------
-+
-+ Max_Interrupt : constant := 63;
-+ type Signal is new int range 0 .. Max_Interrupt;
-+ for Signal'Size use int'Size;
-+
-+ SIGHUP : constant := 1; -- hangup
-+ SIGINT : constant := 2; -- interrupt (rubout)
-+ SIGQUIT : constant := 3; -- quit (ASCD FS)
-+ SIGILL : constant := 4; -- illegal instruction (not reset)
-+ SIGTRAP : constant := 5; -- trace trap (not reset)
-+ SIGIOT : constant := 6; -- IOT instruction
-+ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
-+ SIGFPE : constant := 8; -- floating point exception
-+ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
-+ SIGBUS : constant := 7; -- bus error
-+ SIGSEGV : constant := 11; -- segmentation violation
-+ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
-+ SIGALRM : constant := 14; -- alarm clock
-+ SIGTERM : constant := 15; -- software termination signal from kill
-+ SIGUSR1 : constant := 10; -- user defined signal 1
-+ SIGUSR2 : constant := 12; -- user defined signal 2
-+ SIGCLD : constant := 17; -- alias for SIGCHLD
-+ SIGCHLD : constant := 17; -- child status change
-+ SIGPWR : constant := 30; -- power-fail restart
-+ SIGWINCH : constant := 28; -- window size change
-+ SIGURG : constant := 23; -- urgent condition on IO channel
-+ SIGPOLL : constant := 29; -- pollable event occurred
-+ SIGIO : constant := 29; -- I/O now possible (4.2 BSD)
-+ SIGLOST : constant := 29; -- File lock lost
-+ SIGSTOP : constant := 19; -- stop (cannot be caught or ignored)
-+ SIGTSTP : constant := 20; -- user stop requested from tty
-+ SIGCONT : constant := 18; -- stopped process has been continued
-+ SIGTTIN : constant := 21; -- background tty read attempted
-+ SIGTTOU : constant := 22; -- background tty write attempted
-+ SIGVTALRM : constant := 26; -- virtual timer expired
-+ SIGPROF : constant := 27; -- profiling timer expired
-+ SIGXCPU : constant := 24; -- CPU time limit exceeded
-+ SIGXFSZ : constant := 25; -- filesize limit exceeded
-+ SIGUNUSED : constant := 31; -- unused signal (GNU/Linux)
-+ SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux)
-+ SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal
-+ SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal
-+ SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal
-+
-+ SIGADAABORT : constant := SIGABRT;
-+ -- Change this if you want to use another signal for task abort.
-+ -- SIGTERM might be a good one.
-+
-+ type Signal_Set is array (Natural range <>) of Signal;
-+
-+ Unmasked : constant Signal_Set := (
-+ SIGTRAP,
-+ -- To enable debugging on multithreaded applications, mark SIGTRAP to
-+ -- be kept unmasked.
-+
-+ SIGBUS,
-+
-+ SIGTTIN, SIGTTOU, SIGTSTP,
-+ -- Keep these three signals unmasked so that background processes
-+ -- and IO behaves as normal "C" applications
-+
-+ SIGPROF,
-+ -- To avoid confusing the profiler
-+
-+ SIGKILL, SIGSTOP,
-+ -- These two signals actually cannot be masked;
-+ -- POSIX simply won't allow it.
-+
-+ SIGLTHRRES, SIGLTHRCAN, SIGLTHRDBG);
-+ -- These three signals are used by GNU/LinuxThreads starting from
-+ -- glibc 2.1 (future 2.2).
-+
-+ Reserved : constant Signal_Set :=
-+ -- I am not sure why the following two signals are reserved.
-+ -- I guess they are not supported by this version of GNU/Linux.
-+ (SIGVTALRM, SIGUNUSED);
-+
-+ type sigset_t is private;
-+
-+ function sigaddset (set : access sigset_t; sig : Signal) return int;
-+ pragma Import (C, sigaddset, "sigaddset");
-+
-+ function sigdelset (set : access sigset_t; sig : Signal) return int;
-+ pragma Import (C, sigdelset, "sigdelset");
-+
-+ function sigfillset (set : access sigset_t) return int;
-+ pragma Import (C, sigfillset, "sigfillset");
-+
-+ function sigismember (set : access sigset_t; sig : Signal) return int;
-+ pragma Import (C, sigismember, "sigismember");
-+
-+ function sigemptyset (set : access sigset_t) return int;
-+ pragma Import (C, sigemptyset, "sigemptyset");
-+
-+ type union_type_3 is new String (1 .. 116);
-+ type siginfo_t is record
-+ si_signo : int;
-+ si_code : int;
-+ si_errno : int;
-+ X_data : union_type_3;
-+ end record;
-+ pragma Convention (C, siginfo_t);
-+
-+ type struct_sigaction is record
-+ sa_handler : System.Address;
-+ sa_mask : sigset_t;
-+ sa_flags : unsigned_long;
-+ sa_restorer : System.Address;
-+ end record;
-+ pragma Convention (C, struct_sigaction);
-+
-+ type struct_sigaction_ptr is access all struct_sigaction;
-+
-+ type Machine_State is record
-+ eip : unsigned_long;
-+ ebx : unsigned_long;
-+ esp : unsigned_long;
-+ ebp : unsigned_long;
-+ esi : unsigned_long;
-+ edi : unsigned_long;
-+ end record;
-+ type Machine_State_Ptr is access all Machine_State;
-+
-+ SA_SIGINFO : constant := 16#04#;
-+
-+ SIG_BLOCK : constant := 0;
-+ SIG_UNBLOCK : constant := 1;
-+ SIG_SETMASK : constant := 2;
-+
-+ SIG_DFL : constant := 0;
-+ SIG_IGN : constant := 1;
-+
-+ function sigaction
-+ (sig : Signal;
-+ act : struct_sigaction_ptr;
-+ oact : struct_sigaction_ptr) return int;
-+ pragma Import (C, sigaction, "sigaction");
-+
-+ ----------
-+ -- Time --
-+ ----------
-+
-+ type timespec is private;
-+
-+ function To_Duration (TS : timespec) return Duration;
-+ pragma Inline (To_Duration);
-+
-+ function To_Timespec (D : Duration) return timespec;
-+ pragma Inline (To_Timespec);
-+
-+ type struct_timeval is private;
-+
-+ function To_Duration (TV : struct_timeval) return Duration;
-+ pragma Inline (To_Duration);
-+
-+ function To_Timeval (D : Duration) return struct_timeval;
-+ pragma Inline (To_Timeval);
-+
-+ function gettimeofday
-+ (tv : access struct_timeval;
-+ tz : System.Address := System.Null_Address) return int;
-+ pragma Import (C, gettimeofday, "gettimeofday");
-+
-+ function sysconf (name : int) return long;
-+ pragma Import (C, sysconf);
-+
-+ SC_CLK_TCK : constant := 2;
-+ SC_NPROCESSORS_ONLN : constant := 84;
-+
-+ -------------------------
-+ -- Priority Scheduling --
-+ -------------------------
-+
-+ SCHED_OTHER : constant := 0;
-+ SCHED_FIFO : constant := 1;
-+ SCHED_RR : constant := 2;
-+
-+ function To_Target_Priority
-+ (Prio : System.Any_Priority) return Interfaces.C.int;
-+ -- Maps System.Any_Priority to a POSIX priority
-+
-+ -------------
-+ -- Process --
-+ -------------
-+
-+ type pid_t is private;
-+
-+ function kill (pid : pid_t; sig : Signal) return int;
-+ pragma Import (C, kill, "kill");
-+
-+ function getpid return pid_t;
-+ pragma Import (C, getpid, "getpid");
-+
-+ -------------
-+ -- Threads --
-+ -------------
-+
-+ type Thread_Body is access
-+ function (arg : System.Address) return System.Address;
-+ pragma Convention (C, Thread_Body);
-+
-+ function Thread_Body_Access is new
-+ Ada.Unchecked_Conversion (System.Address, Thread_Body);
-+
-+ type pthread_t is new unsigned_long;
-+ subtype Thread_Id is pthread_t;
-+
-+ function To_pthread_t is
-+ new Ada.Unchecked_Conversion (unsigned_long, pthread_t);
-+
-+ type pthread_mutex_t is limited private;
-+ type pthread_cond_t is limited private;
-+ type pthread_attr_t is limited private;
-+ type pthread_mutexattr_t is limited private;
-+ type pthread_condattr_t is limited private;
-+ type pthread_key_t is private;
-+
-+ PTHREAD_CREATE_DETACHED : constant := 1;
-+
-+ -----------
-+ -- Stack --
-+ -----------
-+
-+ function Get_Stack_Base (thread : pthread_t) return Address;
-+ pragma Inline (Get_Stack_Base);
-+ -- This is a dummy procedure to share some GNULLI files
-+
-+ ---------------------------------------
-+ -- Nonstandard Thread Initialization --
-+ ---------------------------------------
-+
-+ procedure pthread_init;
-+ pragma Inline (pthread_init);
-+ -- This is a dummy procedure to share some GNULLI files
-+
-+ -------------------------
-+ -- POSIX.1c Section 3 --
-+ -------------------------
-+
-+ function sigwait (set : access sigset_t; sig : access Signal) return int;
-+ pragma Import (C, sigwait, "sigwait");
-+
-+ function pthread_kill (thread : pthread_t; sig : Signal) return int;
-+ pragma Import (C, pthread_kill, "pthread_kill");
-+
-+ function pthread_sigmask
-+ (how : int;
-+ set : access sigset_t;
-+ oset : access sigset_t) return int;
-+ pragma Import (C, pthread_sigmask, "pthread_sigmask");
-+
-+ --------------------------
-+ -- POSIX.1c Section 11 --
-+ --------------------------
-+
-+ function pthread_mutexattr_init
-+ (attr : access pthread_mutexattr_t) return int;
-+ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
-+
-+ function pthread_mutexattr_destroy
-+ (attr : access pthread_mutexattr_t) return int;
-+ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
-+
-+ function pthread_mutex_init
-+ (mutex : access pthread_mutex_t;
-+ attr : access pthread_mutexattr_t) return int;
-+ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
-+
-+ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
-+ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
-+
-+ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
-+ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
-+
-+ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
-+ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
-+
-+ function pthread_condattr_init
-+ (attr : access pthread_condattr_t) return int;
-+ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
-+
-+ function pthread_condattr_destroy
-+ (attr : access pthread_condattr_t) return int;
-+ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
-+
-+ function pthread_cond_init
-+ (cond : access pthread_cond_t;
-+ attr : access pthread_condattr_t) return int;
-+ pragma Import (C, pthread_cond_init, "pthread_cond_init");
-+
-+ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
-+ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
-+
-+ function pthread_cond_signal (cond : access pthread_cond_t) return int;
-+ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
-+
-+ function pthread_cond_wait
-+ (cond : access pthread_cond_t;
-+ mutex : access pthread_mutex_t) return int;
-+ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
-+
-+ function pthread_cond_timedwait
-+ (cond : access pthread_cond_t;
-+ mutex : access pthread_mutex_t;
-+ abstime : access timespec) return int;
-+ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
-+
-+ --------------------------
-+ -- POSIX.1c Section 13 --
-+ --------------------------
-+
-+ type struct_sched_param is record
-+ sched_priority : int; -- scheduling priority
-+ end record;
-+ pragma Convention (C, struct_sched_param);
-+
-+ function pthread_setschedparam
-+ (thread : pthread_t;
-+ policy : int;
-+ param : access struct_sched_param) return int;
-+ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
-+
-+ function pthread_attr_setschedpolicy
-+ (attr : access pthread_attr_t;
-+ policy : int) return int;
-+ pragma Import
-+ (C, pthread_attr_setschedpolicy, "pthread_attr_setschedpolicy");
-+
-+ function sched_yield return int;
-+ pragma Import (C, sched_yield, "sched_yield");
-+
-+ ---------------------------
-+ -- P1003.1c - Section 16 --
-+ ---------------------------
-+
-+ function pthread_attr_init
-+ (attributes : access pthread_attr_t) return int;
-+ pragma Import (C, pthread_attr_init, "pthread_attr_init");
-+
-+ function pthread_attr_destroy
-+ (attributes : access pthread_attr_t) return int;
-+ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
-+
-+ function pthread_attr_setdetachstate
-+ (attr : access pthread_attr_t;
-+ detachstate : int) return int;
-+ pragma Import
-+ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
-+
-+ function pthread_attr_setstacksize
-+ (attr : access pthread_attr_t;
-+ stacksize : size_t) return int;
-+ pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
-+
-+ function pthread_create
-+ (thread : access pthread_t;
-+ attributes : access pthread_attr_t;
-+ start_routine : Thread_Body;
-+ arg : System.Address) return int;
-+ pragma Import (C, pthread_create, "pthread_create");
-+
-+ procedure pthread_exit (status : System.Address);
-+ pragma Import (C, pthread_exit, "pthread_exit");
-+
-+ function pthread_self return pthread_t;
-+ pragma Import (C, pthread_self, "pthread_self");
-+
-+ --------------------------
-+ -- POSIX.1c Section 17 --
-+ --------------------------
-+
-+ function pthread_setspecific
-+ (key : pthread_key_t;
-+ value : System.Address) return int;
-+ pragma Import (C, pthread_setspecific, "pthread_setspecific");
-+
-+ function pthread_getspecific (key : pthread_key_t) return System.Address;
-+ pragma Import (C, pthread_getspecific, "pthread_getspecific");
-+
-+ type destructor_pointer is access procedure (arg : System.Address);
-+ pragma Convention (C, destructor_pointer);
-+
-+ function pthread_key_create
-+ (key : access pthread_key_t;
-+ destructor : destructor_pointer) return int;
-+ pragma Import (C, pthread_key_create, "pthread_key_create");
-+
-+ CPU_SETSIZE : constant := 1_024;
-+
-+ type bit_field is array (1 .. CPU_SETSIZE) of Boolean;
-+ for bit_field'Size use CPU_SETSIZE;
-+ pragma Pack (bit_field);
-+ pragma Convention (C, bit_field);
-+
-+ type cpu_set_t is record
-+ bits : bit_field;
-+ end record;
-+ pragma Convention (C, cpu_set_t);
-+
-+ function pthread_setaffinity_np
-+ (thread : pthread_t;
-+ cpusetsize : size_t;
-+ cpuset : access cpu_set_t) return int;
-+ pragma Import (C, pthread_setaffinity_np, "__gnat_pthread_setaffinity_np");
-+
-+ -------------------
-+ -- Win32 compat --
-+ -------------------
-+
-+ -------------------
-+ -- General Types --
-+ -------------------
-+
-+ type DWORD is new Interfaces.C.unsigned_long;
-+ type WORD is new Interfaces.C.unsigned_short;
-+
-+ -- The LARGE_INTEGER type is actually a fixed point type
-+ -- that only can represent integers. The reason for this is
-+ -- easier conversion to Duration or other fixed point types.
-+ -- (See Operations.Clock)
-+
-+ type LARGE_INTEGER is delta 1.0 range -2.0**63 .. 2.0**63 - 1.0;
-+
-+ subtype PSZ is Interfaces.C.Strings.chars_ptr;
-+ subtype PCHAR is Interfaces.C.Strings.chars_ptr;
-+
-+ subtype PVOID is System.Address;
-+
-+ Null_Void : constant PVOID := System.Null_Address;
-+
-+ type PLONG is access all Interfaces.C.long;
-+ type PDWORD is access all DWORD;
-+
-+ type BOOL is new Boolean;
-+ for BOOL'Size use Interfaces.C.unsigned_long'Size;
-+
-+ -------------------------
-+ -- Handles for objects --
-+ -------------------------
-+
-+ type HANDLE is new Interfaces.C.long;
-+ type PHANDLE is access all HANDLE;
-+
-+ subtype Win32_Thread_Id is HANDLE;
-+
-+ ------------------------
-+ -- System Information --
-+ ------------------------
-+
-+ type SYSTEM_INFO is record
-+ dwOemId : DWORD;
-+ dwPageSize : DWORD;
-+ lpMinimumApplicationAddress : PVOID;
-+ lpMaximumApplicationAddress : PVOID;
-+ dwActiveProcessorMask : DWORD;
-+ dwNumberOfProcessors : DWORD;
-+ dwProcessorType : DWORD;
-+ dwAllocationGranularity : DWORD;
-+ dwReserved : DWORD;
-+ end record;
-+
-+ procedure GetSystemInfo (SI : access SYSTEM_INFO);
-+ pragma Import (Stdcall, GetSystemInfo, "GetSystemInfo");
-+
-+ ---------------------
-+ -- Time Management --
-+ ---------------------
-+
-+ procedure Sleep (dwMilliseconds : DWORD);
-+ pragma Import (Stdcall, Sleep, External_Name => "Sleep");
-+
-+ type SYSTEMTIME is record
-+ wYear : WORD;
-+ wMonth : WORD;
-+ wDayOfWeek : WORD;
-+ wDay : WORD;
-+ wHour : WORD;
-+ wMinute : WORD;
-+ wSecond : WORD;
-+ wMilliseconds : WORD;
-+ end record;
-+
-+ procedure GetSystemTime (pSystemTime : access SYSTEMTIME);
-+ pragma Import (Stdcall, GetSystemTime, "GetSystemTime");
-+
-+ procedure GetSystemTimeAsFileTime (lpFileTime : access Long_Long_Integer);
-+ pragma Import (Stdcall, GetSystemTimeAsFileTime, "GetSystemTimeAsFileTime");
-+
-+ function SetSystemTime (pSystemTime : access SYSTEMTIME) return BOOL;
-+ pragma Import (Stdcall, SetSystemTime, "SetSystemTime");
-+
-+ function FileTimeToSystemTime
-+ (lpFileTime : access Long_Long_Integer;
-+ lpSystemTime : access SYSTEMTIME) return BOOL;
-+ pragma Import (Stdcall, FileTimeToSystemTime, "FileTimeToSystemTime");
-+
-+ function SystemTimeToFileTime
-+ (lpSystemTime : access SYSTEMTIME;
-+ lpFileTime : access Long_Long_Integer) return BOOL;
-+ pragma Import (Stdcall, SystemTimeToFileTime, "SystemTimeToFileTime");
-+
-+ function FileTimeToLocalFileTime
-+ (lpFileTime : access Long_Long_Integer;
-+ lpLocalFileTime : access Long_Long_Integer) return BOOL;
-+ pragma Import (Stdcall, FileTimeToLocalFileTime, "FileTimeToLocalFileTime");
-+
-+ function LocalFileTimeToFileTime
-+ (lpFileTime : access Long_Long_Integer;
-+ lpLocalFileTime : access Long_Long_Integer) return BOOL;
-+ pragma Import (Stdcall, LocalFileTimeToFileTime, "LocalFileTimeToFileTime");
-+
-+ function QueryPerformanceCounter
-+ (lpPerformanceCount : access LARGE_INTEGER) return BOOL;
-+ pragma Import
-+ (Stdcall, QueryPerformanceCounter, "QueryPerformanceCounter");
-+
-+ function QueryPerformanceFrequency
-+ (lpFrequency : access LARGE_INTEGER) return BOOL;
-+ pragma Import
-+ (Stdcall, QueryPerformanceFrequency, "QueryPerformanceFrequency");
-+
-+ -------------
-+ -- Threads --
-+ -------------
-+
-+-- type Win32_Thread_Body is access
-+-- function (arg : System.Address) return System.Address;
-+-- pragma Convention (C, Thread_Body);
-+
-+-- function Win32_Thread_Body_Access is new
-+-- Ada.Unchecked_Conversion (System.Address, Thread_Body);
-+
-+ procedure SwitchToThread;
-+ pragma Import (Stdcall, SwitchToThread, "SwitchToThread");
-+
-+ function GetThreadTimes
-+ (hThread : HANDLE;
-+ lpCreationTime : access Long_Long_Integer;
-+ lpExitTime : access Long_Long_Integer;
-+ lpKernelTime : access Long_Long_Integer;
-+ lpUserTime : access Long_Long_Integer) return BOOL;
-+ pragma Import (Stdcall, GetThreadTimes, "GetThreadTimes");
-+
-+ -----------------------
-+ -- Critical sections --
-+ -----------------------
-+
-+ type CRITICAL_SECTION is private;
-+
-+ procedure InitializeCriticalSection
-+ (pCriticalSection : access CRITICAL_SECTION);
-+ pragma Import
-+ (Stdcall, InitializeCriticalSection, "InitializeCriticalSection");
-+
-+ procedure EnterCriticalSection
-+ (pCriticalSection : access CRITICAL_SECTION);
-+ pragma Import (Stdcall, EnterCriticalSection, "EnterCriticalSection");
-+
-+ procedure LeaveCriticalSection
-+ (pCriticalSection : access CRITICAL_SECTION);
-+ pragma Import (Stdcall, LeaveCriticalSection, "LeaveCriticalSection");
-+
-+ procedure DeleteCriticalSection
-+ (pCriticalSection : access CRITICAL_SECTION);
-+ pragma Import (Stdcall, DeleteCriticalSection, "DeleteCriticalSection");
-+
-+ -------------------------------------------------------------
-+ -- Thread Creation, Activation, Suspension And Termination --
-+ -------------------------------------------------------------
-+
-+ subtype ProcessorId is DWORD;
-+
-+ type PTHREAD_START_ROUTINE is access function
-+ (pThreadParameter : PVOID) return DWORD;
-+ pragma Convention (Stdcall, PTHREAD_START_ROUTINE);
-+
-+ function To_PTHREAD_START_ROUTINE is new
-+ Ada.Unchecked_Conversion (System.Address, PTHREAD_START_ROUTINE);
-+
-+ type SECURITY_ATTRIBUTES is record
-+ nLength : DWORD;
-+ pSecurityDescriptor : PVOID;
-+ bInheritHandle : BOOL;
-+ end record;
-+
-+ type PSECURITY_ATTRIBUTES is access all SECURITY_ATTRIBUTES;
-+
-+ function CreateThread
-+ (pThreadAttributes : PSECURITY_ATTRIBUTES;
-+ dwStackSize : DWORD;
-+ pStartAddress : PTHREAD_START_ROUTINE;
-+ pParameter : PVOID;
-+ dwCreationFlags : DWORD;
-+ pThreadId : PDWORD) return HANDLE;
-+ pragma Import (Stdcall, CreateThread, "CreateThread");
-+
-+ function BeginThreadEx
-+ (pThreadAttributes : PSECURITY_ATTRIBUTES;
-+ dwStackSize : DWORD;
-+ pStartAddress : PTHREAD_START_ROUTINE;
-+ pParameter : PVOID;
-+ dwCreationFlags : DWORD;
-+ pThreadId : PDWORD) return HANDLE;
-+ pragma Import (C, BeginThreadEx, "_beginthreadex");
-+
-+ Debug_Process : constant := 16#00000001#;
-+ Debug_Only_This_Process : constant := 16#00000002#;
-+ Create_Suspended : constant := 16#00000004#;
-+ Detached_Process : constant := 16#00000008#;
-+ Create_New_Console : constant := 16#00000010#;
-+
-+ Create_New_Process_Group : constant := 16#00000200#;
-+
-+ Create_No_window : constant := 16#08000000#;
-+
-+ Profile_User : constant := 16#10000000#;
-+ Profile_Kernel : constant := 16#20000000#;
-+ Profile_Server : constant := 16#40000000#;
-+
-+ Stack_Size_Param_Is_A_Reservation : constant := 16#00010000#;
-+
-+ function GetExitCodeThread
-+ (hThread : HANDLE;
-+ pExitCode : PDWORD) return BOOL;
-+ pragma Import (Stdcall, GetExitCodeThread, "GetExitCodeThread");
-+
-+ function ResumeThread (hThread : HANDLE) return DWORD;
-+ pragma Import (Stdcall, ResumeThread, "ResumeThread");
-+
-+ function SuspendThread (hThread : HANDLE) return DWORD;
-+ pragma Import (Stdcall, SuspendThread, "SuspendThread");
-+
-+ procedure ExitThread (dwExitCode : DWORD);
-+ pragma Import (Stdcall, ExitThread, "ExitThread");
-+
-+ procedure EndThreadEx (dwExitCode : DWORD);
-+ pragma Import (C, EndThreadEx, "_endthreadex");
-+
-+ function TerminateThread
-+ (hThread : HANDLE;
-+ dwExitCode : DWORD) return BOOL;
-+ pragma Import (Stdcall, TerminateThread, "TerminateThread");
-+
-+ function GetCurrentThread return HANDLE;
-+ pragma Import (Stdcall, GetCurrentThread, "GetCurrentThread");
-+
-+ function GetCurrentProcess return HANDLE;
-+ pragma Import (Stdcall, GetCurrentProcess, "GetCurrentProcess");
-+
-+ function GetCurrentThreadId return DWORD;
-+ pragma Import (Stdcall, GetCurrentThreadId, "GetCurrentThreadId");
-+
-+ function TlsAlloc return DWORD;
-+ pragma Import (Stdcall, TlsAlloc, "TlsAlloc");
-+
-+ function TlsGetValue (dwTlsIndex : DWORD) return PVOID;
-+ pragma Import (Stdcall, TlsGetValue, "TlsGetValue");
-+
-+ function TlsSetValue (dwTlsIndex : DWORD; pTlsValue : PVOID) return BOOL;
-+ pragma Import (Stdcall, TlsSetValue, "TlsSetValue");
-+
-+ function TlsFree (dwTlsIndex : DWORD) return BOOL;
-+ pragma Import (Stdcall, TlsFree, "TlsFree");
-+
-+ TLS_Nothing : constant := DWORD'Last;
-+
-+ procedure ExitProcess (uExitCode : Interfaces.C.unsigned);
-+ pragma Import (Stdcall, ExitProcess, "ExitProcess");
-+
-+ function WaitForSingleObject
-+ (hHandle : HANDLE;
-+ dwMilliseconds : DWORD) return DWORD;
-+ pragma Import (Stdcall, WaitForSingleObject, "WaitForSingleObject");
-+
-+ function WaitForSingleObjectEx
-+ (hHandle : HANDLE;
-+ dwMilliseconds : DWORD;
-+ fAlertable : BOOL) return DWORD;
-+ pragma Import (Stdcall, WaitForSingleObjectEx, "WaitForSingleObjectEx");
-+
-+ function SetThreadIdealProcessor
-+ (hThread : HANDLE;
-+ dwIdealProcessor : ProcessorId) return DWORD;
-+ pragma Import (Stdcall, SetThreadIdealProcessor, "SetThreadIdealProcessor");
-+
-+ Wait_Infinite : constant := DWORD'Last;
-+ WAIT_TIMEOUT : constant := 16#0000_0102#;
-+ WAIT_FAILED : constant := 16#FFFF_FFFF#;
-+
-+ ------------------------------------
-+ -- Semaphores, Events and Mutexes --
-+ ------------------------------------
-+
-+ function CloseHandle (hObject : HANDLE) return BOOL;
-+ pragma Import (Stdcall, CloseHandle, "CloseHandle");
-+
-+ function CreateSemaphore
-+ (pSemaphoreAttributes : PSECURITY_ATTRIBUTES;
-+ lInitialCount : Interfaces.C.long;
-+ lMaximumCount : Interfaces.C.long;
-+ pName : PSZ) return HANDLE;
-+ pragma Import (Stdcall, CreateSemaphore, "CreateSemaphoreA");
-+
-+ function OpenSemaphore
-+ (dwDesiredAccess : DWORD;
-+ bInheritHandle : BOOL;
-+ pName : PSZ) return HANDLE;
-+ pragma Import (Stdcall, OpenSemaphore, "OpenSemaphoreA");
-+
-+ function ReleaseSemaphore
-+ (hSemaphore : HANDLE;
-+ lReleaseCount : Interfaces.C.long;
-+ pPreviousCount : PLONG) return BOOL;
-+ pragma Import (Stdcall, ReleaseSemaphore, "ReleaseSemaphore");
-+
-+ function CreateEvent
-+ (pEventAttributes : PSECURITY_ATTRIBUTES;
-+ bManualReset : BOOL;
-+ bInitialState : BOOL;
-+ pName : PSZ) return HANDLE;
-+ pragma Import (Stdcall, CreateEvent, "CreateEventA");
-+
-+ function OpenEvent
-+ (dwDesiredAccess : DWORD;
-+ bInheritHandle : BOOL;
-+ pName : PSZ) return HANDLE;
-+ pragma Import (Stdcall, OpenEvent, "OpenEventA");
-+
-+ function SetEvent (hEvent : HANDLE) return BOOL;
-+ pragma Import (Stdcall, SetEvent, "SetEvent");
-+
-+ function ResetEvent (hEvent : HANDLE) return BOOL;
-+ pragma Import (Stdcall, ResetEvent, "ResetEvent");
-+
-+ function PulseEvent (hEvent : HANDLE) return BOOL;
-+ pragma Import (Stdcall, PulseEvent, "PulseEvent");
-+
-+ function CreateMutex
-+ (pMutexAttributes : PSECURITY_ATTRIBUTES;
-+ bInitialOwner : BOOL;
-+ pName : PSZ) return HANDLE;
-+ pragma Import (Stdcall, CreateMutex, "CreateMutexA");
-+
-+ function OpenMutex
-+ (dwDesiredAccess : DWORD;
-+ bInheritHandle : BOOL;
-+ pName : PSZ) return HANDLE;
-+ pragma Import (Stdcall, OpenMutex, "OpenMutexA");
-+
-+ function ReleaseMutex (hMutex : HANDLE) return BOOL;
-+ pragma Import (Stdcall, ReleaseMutex, "ReleaseMutex");
-+
-+ ---------------------------------------------------
-+ -- Accessing properties of Threads and Processes --
-+ ---------------------------------------------------
-+
-+ -----------------
-+ -- Priorities --
-+ -----------------
-+
-+ function SetThreadPriority
-+ (hThread : HANDLE;
-+ nPriority : Interfaces.C.int) return BOOL;
-+ pragma Import (Stdcall, SetThreadPriority, "SetThreadPriority");
-+
-+ function GetThreadPriority (hThread : HANDLE) return Interfaces.C.int;
-+ pragma Import (Stdcall, GetThreadPriority, "GetThreadPriority");
-+
-+ function SetPriorityClass
-+ (hProcess : HANDLE;
-+ dwPriorityClass : DWORD) return BOOL;
-+ pragma Import (Stdcall, SetPriorityClass, "SetPriorityClass");
-+
-+ procedure SetThreadPriorityBoost
-+ (hThread : HANDLE;
-+ DisablePriorityBoost : BOOL);
-+ pragma Import (Stdcall, SetThreadPriorityBoost, "SetThreadPriorityBoost");
-+
-+ Normal_Priority_Class : constant := 16#00000020#;
-+ Idle_Priority_Class : constant := 16#00000040#;
-+ High_Priority_Class : constant := 16#00000080#;
-+ Realtime_Priority_Class : constant := 16#00000100#;
-+
-+ Thread_Priority_Idle : constant := -15;
-+ Thread_Priority_Lowest : constant := -2;
-+ Thread_Priority_Below_Normal : constant := -1;
-+ Thread_Priority_Normal : constant := 0;
-+ Thread_Priority_Above_Normal : constant := 1;
-+ Thread_Priority_Highest : constant := 2;
-+ Thread_Priority_Time_Critical : constant := 15;
-+ Thread_Priority_Error_Return : constant := Interfaces.C.long'Last;
-+
-+ function GetLastError return DWORD;
-+ pragma Import (Stdcall, GetLastError, "GetLastError");
-+
-+private
-+
-+ type sigset_t is array (0 .. 127) of unsigned_char;
-+ pragma Convention (C, sigset_t);
-+ for sigset_t'Alignment use unsigned_long'Alignment;
-+
-+ type pid_t is new int;
-+
-+ type time_t is new long;
-+
-+ type timespec is record
-+ tv_sec : time_t;
-+ tv_nsec : long;
-+ end record;
-+ pragma Convention (C, timespec);
-+
-+ type struct_timeval is record
-+ tv_sec : time_t;
-+ tv_usec : time_t;
-+ end record;
-+ pragma Convention (C, struct_timeval);
-+
-+ type pthread_attr_t is record
-+ detachstate : int;
-+ schedpolicy : int;
-+ schedparam : struct_sched_param;
-+ inheritsched : int;
-+ scope : int;
-+ guardsize : size_t;
-+ stackaddr_set : int;
-+ stackaddr : System.Address;
-+ stacksize : size_t;
-+ end record;
-+ pragma Convention (C, pthread_attr_t);
-+
-+ type pthread_condattr_t is record
-+ dummy : int;
-+ end record;
-+ pragma Convention (C, pthread_condattr_t);
-+
-+ type pthread_mutexattr_t is record
-+ mutexkind : int;
-+ end record;
-+ pragma Convention (C, pthread_mutexattr_t);
-+
-+ type struct_pthread_fast_lock is record
-+ status : long;
-+ spinlock : int;
-+ end record;
-+ pragma Convention (C, struct_pthread_fast_lock);
-+
-+ type pthread_mutex_t is record
-+ m_reserved : int;
-+ m_count : int;
-+ m_owner : System.Address;
-+ m_kind : int;
-+ m_lock : struct_pthread_fast_lock;
-+ end record;
-+ pragma Convention (C, pthread_mutex_t);
-+
-+ type pthread_cond_t is array (0 .. 47) of unsigned_char;
-+ pragma Convention (C, pthread_cond_t);
-+
-+ type pthread_key_t is new unsigned;
-+
-+ -------------------
-+ -- Win32 private --
-+ -------------------
-+
-+ type CRITICAL_SECTION is record
-+ DebugInfo : System.Address;
-+ -- The following three fields control entering and
-+ -- exiting the critical section for the resource
-+ LockCount : Long_Integer;
-+ RecursionCount : Long_Integer;
-+ OwningThread : HANDLE;
-+ LockSemaphore : HANDLE;
-+ Reserved : DWORD;
-+ end record;
-+
-+end System.OS_Interface;
---- origsrc/gcc-4.7.2/gcc/ada/s-taprop-cygwin.adb 1970-01-01 00:00:00.000000000 +0000
-+++ src/gcc-4.7.2/gcc/ada/s-taprop-cygwin.adb 2012-11-01 21:17:31.000000000 +0000
-@@ -0,0 +1,1337 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-+-- --
-+-- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S --
-+-- --
-+-- B o d y --
-+-- --
-+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-+-- --
-+-- GNARL is free software; you can redistribute it and/or modify it under --
-+-- terms of the GNU General Public License as published by the Free Soft- --
-+-- ware Foundation; either version 3, or (at your option) any later ver- --
-+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-+-- --
-+-- As a special exception under Section 7 of GPL version 3, you are granted --
-+-- additional permissions described in the GCC Runtime Library Exception, --
-+-- version 3.1, as published by the Free Software Foundation. --
-+-- --
-+-- You should have received a copy of the GNU General Public License and --
-+-- a copy of the GCC Runtime Library Exception along with this program; --
-+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-+-- <http://www.gnu.org/licenses/>. --
-+-- --
-+-- GNARL was developed by the GNARL team at Florida State University. --
-+-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-+-- --
-+------------------------------------------------------------------------------
-+
-+-- This is a GNU/Linux (GNU/LinuxThreads) version of this package
-+
-+-- This package contains all the GNULL primitives that interface directly
-+-- with the underlying OS.
-+
-+pragma Polling (Off);
-+-- Turn off polling, we do not want ATC polling to take place during
-+-- tasking operations. It causes infinite loops and other problems.
-+
-+with Interfaces.C;
-+-- used for int
-+-- size_t
-+
-+with System.Task_Info;
-+-- used for Unspecified_Task_Info
-+
-+with System.Tasking.Debug;
-+-- used for Known_Tasks
-+
-+with System.Interrupt_Management;
-+-- used for Keep_Unmasked
-+-- Abort_Task_Interrupt
-+-- Interrupt_ID
-+
-+with System.OS_Primitives;
-+-- used for Delay_Modes
-+
-+with System.Soft_Links;
-+-- used for Abort_Defer/Undefer
-+
-+-- We use System.Soft_Links instead of System.Tasking.Initialization
-+-- because the later is a higher level package that we shouldn't depend on.
-+-- For example when using the restricted run time, it is replaced by
-+-- System.Tasking.Restricted.Stages.
-+
-+with System.Storage_Elements;
-+with System.Stack_Checking.Operations;
-+-- Used for Invalidate_Stack_Cache and Notify_Stack_Attributes;
-+
-+with Ada.Exceptions;
-+-- used for Raise_Exception
-+-- Raise_From_Signal_Handler
-+-- Exception_Id
-+
-+with Ada.Unchecked_Conversion;
-+with Ada.Unchecked_Deallocation;
-+
-+package body System.Task_Primitives.Operations is
-+
-+ package SSL renames System.Soft_Links;
-+ package SC renames System.Stack_Checking.Operations;
-+
-+ use System.Tasking.Debug;
-+ use System.Tasking;
-+ use Interfaces.C;
-+ use System.OS_Interface;
-+ use System.Parameters;
-+ use System.OS_Primitives;
-+ use System.Storage_Elements;
-+ use System.Task_Info;
-+
-+ ----------------
-+ -- Local Data --
-+ ----------------
-+
-+ -- The followings are logically constants, but need to be initialized
-+ -- at run time.
-+
-+ Single_RTS_Lock : aliased RTS_Lock;
-+ -- This is a lock to allow only one thread of control in the RTS at
-+ -- a time; it is used to execute in mutual exclusion from all other tasks.
-+ -- Used mainly in Single_Lock mode, but also to protect All_Tasks_List
-+
-+ ATCB_Key : aliased pthread_key_t;
-+ -- Key used to find the Ada Task_Id associated with a thread
-+
-+ Environment_Task_Id : Task_Id;
-+ -- A variable to hold Task_Id for the environment task
-+
-+ Unblocked_Signal_Mask : aliased sigset_t;
-+ -- The set of signals that should be unblocked in all tasks
-+
-+ -- The followings are internal configuration constants needed
-+
-+ Next_Serial_Number : Task_Serial_Number := 100;
-+ -- We start at 100 (reserve some special values for using in error checks)
-+
-+ Time_Slice_Val : Integer;
-+ pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
-+
-+ Dispatching_Policy : Character;
-+ pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
-+
-+ -- The following are effectively constants, but they need to be initialized
-+ -- by calling a pthread_ function.
-+
-+ Mutex_Attr : aliased pthread_mutexattr_t;
-+ Cond_Attr : aliased pthread_condattr_t;
-+
-+ Foreign_Task_Elaborated : aliased Boolean := True;
-+ -- Used to identified fake tasks (i.e., non-Ada Threads)
-+
-+ --------------------
-+ -- Local Packages --
-+ --------------------
-+
-+ package Specific is
-+
-+ procedure Initialize (Environment_Task : Task_Id);
-+ pragma Inline (Initialize);
-+ -- Initialize various data needed by this package
-+
-+ function Is_Valid_Task return Boolean;
-+ pragma Inline (Is_Valid_Task);
-+ -- Does executing thread have a TCB?
-+
-+ procedure Set (Self_Id : Task_Id);
-+ pragma Inline (Set);
-+ -- Set the self id for the current task
-+
-+ function Self return Task_Id;
-+ pragma Inline (Self);
-+ -- Return a pointer to the Ada Task Control Block of the calling task
-+
-+ end Specific;
-+
-+ package body Specific is separate;
-+ -- The body of this package is target specific
-+
-+ ---------------------------------
-+ -- Support for foreign threads --
-+ ---------------------------------
-+
-+ function Register_Foreign_Thread (Thread : Thread_Id) return Task_Id;
-+ -- Allocate and Initialize a new ATCB for the current Thread
-+
-+ function Register_Foreign_Thread
-+ (Thread : Thread_Id) return Task_Id is separate;
-+
-+ -----------------------
-+ -- Local Subprograms --
-+ -----------------------
-+
-+ subtype unsigned_long is Interfaces.C.unsigned_long;
-+
-+ procedure Abort_Handler (signo : Signal);
-+
-+ function To_pthread_t is new Ada.Unchecked_Conversion
-+ (unsigned_long, System.OS_Interface.pthread_t);
-+
-+ procedure Get_Stack_Attributes
-+ (T : Task_Id;
-+ ISP : out System.Address;
-+ Size : out Storage_Offset);
-+ -- Fill ISP and Size with the Initial Stack Pointer value and the
-+ -- thread stack size for task T.
-+
-+ -------------------
-+ -- Abort_Handler --
-+ -------------------
-+
-+ procedure Abort_Handler (signo : Signal) is
-+ pragma Unreferenced (signo);
-+
-+ Self_Id : constant Task_Id := Self;
-+ Result : Interfaces.C.int;
-+ Old_Set : aliased sigset_t;
-+
-+ begin
-+ if ZCX_By_Default and then GCC_ZCX_Support then
-+ return;
-+ end if;
-+
-+ if Self_Id.Deferral_Level = 0
-+ and then Self_Id.Pending_ATC_Level < Self_Id.ATC_Nesting_Level
-+ and then not Self_Id.Aborting
-+ then
-+ Self_Id.Aborting := True;
-+
-+ -- Make sure signals used for RTS internal purpose are unmasked
-+
-+ Result :=
-+ pthread_sigmask
-+ (SIG_UNBLOCK,
-+ Unblocked_Signal_Mask'Access,
-+ Old_Set'Access);
-+ pragma Assert (Result = 0);
-+
-+ raise Standard'Abort_Signal;
-+ end if;
-+ end Abort_Handler;
-+
-+ --------------
-+ -- Lock_RTS --
-+ --------------
-+
-+ procedure Lock_RTS is
-+ begin
-+ Write_Lock (Single_RTS_Lock'Access, Global_Lock => True);
-+ end Lock_RTS;
-+
-+ ----------------
-+ -- Unlock_RTS --
-+ ----------------
-+
-+ procedure Unlock_RTS is
-+ begin
-+ Unlock (Single_RTS_Lock'Access, Global_Lock => True);
-+ end Unlock_RTS;
-+
-+ -----------------
-+ -- Stack_Guard --
-+ -----------------
-+
-+ -- The underlying thread system extends the memory (up to 2MB) when needed
-+
-+ procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is
-+ pragma Unreferenced (T);
-+ pragma Unreferenced (On);
-+ begin
-+ null;
-+ end Stack_Guard;
-+
-+ --------------------
-+ -- Get_Thread_Id --
-+ --------------------
-+
-+ function Get_Thread_Id (T : ST.Task_Id) return OSI.Thread_Id is
-+ begin
-+ return T.Common.LL.Thread;
-+ end Get_Thread_Id;
-+
-+ ----------
-+ -- Self --
-+ ----------
-+
-+ function Self return Task_Id renames Specific.Self;
-+
-+ ---------------------
-+ -- Initialize_Lock --
-+ ---------------------
-+
-+ -- Note: mutexes and cond_variables needed per-task basis are
-+ -- initialized in Initialize_TCB and the Storage_Error is
-+ -- handled. Other mutexes (such as RTS_Lock, Memory_Lock...)
-+ -- used in RTS is initialized before any status change of RTS.
-+ -- Therefore rasing Storage_Error in the following routines
-+ -- should be able to be handled safely.
-+
-+ procedure Initialize_Lock
-+ (Prio : System.Any_Priority;
-+ L : not null access Lock)
-+ is
-+ pragma Unreferenced (Prio);
-+
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ Result := pthread_mutex_init (L, Mutex_Attr'Access);
-+
-+ pragma Assert (Result = 0 or else Result = ENOMEM);
-+
-+ if Result = ENOMEM then
-+ Ada.Exceptions.Raise_Exception (Storage_Error'Identity,
-+ "Failed to allocate a lock");
-+ end if;
-+ end Initialize_Lock;
-+
-+ procedure Initialize_Lock
-+ (L : not null access RTS_Lock;
-+ Level : Lock_Level)
-+ is
-+ pragma Unreferenced (Level);
-+
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ Result := pthread_mutex_init (L, Mutex_Attr'Access);
-+
-+ pragma Assert (Result = 0 or else Result = ENOMEM);
-+
-+ if Result = ENOMEM then
-+ raise Storage_Error;
-+ end if;
-+ end Initialize_Lock;
-+
-+ -------------------
-+ -- Finalize_Lock --
-+ -------------------
-+
-+ procedure Finalize_Lock (L : not null access Lock) is
-+ Result : Interfaces.C.int;
-+ begin
-+ Result := pthread_mutex_destroy (L);
-+ pragma Assert (Result = 0);
-+ end Finalize_Lock;
-+
-+ procedure Finalize_Lock (L : not null access RTS_Lock) is
-+ Result : Interfaces.C.int;
-+ begin
-+ Result := pthread_mutex_destroy (L);
-+ pragma Assert (Result = 0);
-+ end Finalize_Lock;
-+
-+ ----------------
-+ -- Write_Lock --
-+ ----------------
-+
-+ procedure Write_Lock
-+ (L : not null access Lock;
-+ Ceiling_Violation : out Boolean)
-+ is
-+ Result : Interfaces.C.int;
-+ begin
-+ Result := pthread_mutex_lock (L);
-+ Ceiling_Violation := Result = EINVAL;
-+
-+ -- Assume the cause of EINVAL is a priority ceiling violation
-+
-+ pragma Assert (Result = 0 or else Result = EINVAL);
-+ end Write_Lock;
-+
-+ procedure Write_Lock
-+ (L : not null access RTS_Lock;
-+ Global_Lock : Boolean := False)
-+ is
-+ Result : Interfaces.C.int;
-+ begin
-+ if not Single_Lock or else Global_Lock then
-+ Result := pthread_mutex_lock (L);
-+ pragma Assert (Result = 0);
-+ end if;
-+ end Write_Lock;
-+
-+ procedure Write_Lock (T : Task_Id) is
-+ Result : Interfaces.C.int;
-+ begin
-+ if not Single_Lock then
-+ Result := pthread_mutex_lock (T.Common.LL.L'Access);
-+ pragma Assert (Result = 0);
-+ end if;
-+ end Write_Lock;
-+
-+ ---------------
-+ -- Read_Lock --
-+ ---------------
-+
-+ procedure Read_Lock
-+ (L : not null access Lock;
-+ Ceiling_Violation : out Boolean)
-+ is
-+ begin
-+ Write_Lock (L, Ceiling_Violation);
-+ end Read_Lock;
-+
-+ ------------
-+ -- Unlock --
-+ ------------
-+
-+ procedure Unlock (L : not null access Lock) is
-+ Result : Interfaces.C.int;
-+ begin
-+ Result := pthread_mutex_unlock (L);
-+ pragma Assert (Result = 0);
-+ end Unlock;
-+
-+ procedure Unlock
-+ (L : not null access RTS_Lock;
-+ Global_Lock : Boolean := False)
-+ is
-+ Result : Interfaces.C.int;
-+ begin
-+ if not Single_Lock or else Global_Lock then
-+ Result := pthread_mutex_unlock (L);
-+ pragma Assert (Result = 0);
-+ end if;
-+ end Unlock;
-+
-+ procedure Unlock (T : Task_Id) is
-+ Result : Interfaces.C.int;
-+ begin
-+ if not Single_Lock then
-+ Result := pthread_mutex_unlock (T.Common.LL.L'Access);
-+ pragma Assert (Result = 0);
-+ end if;
-+ end Unlock;
-+
-+ -----------------
-+ -- Set_Ceiling --
-+ -----------------
-+
-+ -- Dynamic priority ceilings are not supported by the underlying system
-+
-+ procedure Set_Ceiling
-+ (L : not null access Lock;
-+ Prio : System.Any_Priority)
-+ is
-+ pragma Unreferenced (L, Prio);
-+ begin
-+ null;
-+ end Set_Ceiling;
-+
-+ -----------
-+ -- Sleep --
-+ -----------
-+
-+ procedure Sleep
-+ (Self_ID : Task_Id;
-+ Reason : System.Tasking.Task_States)
-+ is
-+ pragma Unreferenced (Reason);
-+
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ pragma Assert (Self_ID = Self);
-+
-+ if Single_Lock then
-+ Result :=
-+ pthread_cond_wait
-+ (Self_ID.Common.LL.CV'Access, Single_RTS_Lock'Access);
-+ else
-+ Result :=
-+ pthread_cond_wait
-+ (Self_ID.Common.LL.CV'Access, Self_ID.Common.LL.L'Access);
-+ end if;
-+
-+ -- EINTR is not considered a failure
-+
-+ pragma Assert (Result = 0 or else Result = EINTR);
-+ end Sleep;
-+
-+ -----------------
-+ -- Timed_Sleep --
-+ -----------------
-+
-+ -- This is for use within the run-time system, so abort is
-+ -- assumed to be already deferred, and the caller should be
-+ -- holding its own ATCB lock.
-+
-+ procedure Timed_Sleep
-+ (Self_ID : Task_Id;
-+ Time : Duration;
-+ Mode : ST.Delay_Modes;
-+ Reason : System.Tasking.Task_States;
-+ Timedout : out Boolean;
-+ Yielded : out Boolean)
-+ is
-+ pragma Unreferenced (Reason);
-+
-+ Base_Time : constant Duration := Monotonic_Clock;
-+ Check_Time : Duration := Base_Time;
-+ Abs_Time : Duration;
-+ Request : aliased timespec;
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ Timedout := True;
-+ Yielded := False;
-+
-+ if Mode = Relative then
-+ Abs_Time := Duration'Min (Time, Max_Sensible_Delay) + Check_Time;
-+ else
-+ Abs_Time := Duration'Min (Check_Time + Max_Sensible_Delay, Time);
-+ end if;
-+
-+ if Abs_Time > Check_Time then
-+ Request := To_Timespec (Abs_Time);
-+
-+ loop
-+ exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level;
-+
-+ if Single_Lock then
-+ Result :=
-+ pthread_cond_timedwait
-+ (Self_ID.Common.LL.CV'Access,
-+ Single_RTS_Lock'Access,
-+ Request'Access);
-+
-+ else
-+ Result :=
-+ pthread_cond_timedwait
-+ (Self_ID.Common.LL.CV'Access,
-+ Self_ID.Common.LL.L'Access,
-+ Request'Access);
-+ end if;
-+
-+ Check_Time := Monotonic_Clock;
-+ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time;
-+
-+ if Result = 0 or else Result = EINTR then
-+
-+ -- Somebody may have called Wakeup for us
-+
-+ Timedout := False;
-+ exit;
-+ end if;
-+
-+ pragma Assert (Result = ETIMEDOUT);
-+ end loop;
-+ end if;
-+ end Timed_Sleep;
-+
-+ -----------------
-+ -- Timed_Delay --
-+ -----------------
-+
-+ -- This is for use in implementing delay statements, so we assume the
-+ -- caller is abort-deferred but is holding no locks.
-+
-+ procedure Timed_Delay
-+ (Self_ID : Task_Id;
-+ Time : Duration;
-+ Mode : ST.Delay_Modes)
-+ is
-+ Base_Time : constant Duration := Monotonic_Clock;
-+ Check_Time : Duration := Base_Time;
-+ Abs_Time : Duration;
-+ Request : aliased timespec;
-+
-+ Result : Interfaces.C.int;
-+ pragma Warnings (Off, Result);
-+
-+ begin
-+ if Single_Lock then
-+ Lock_RTS;
-+ end if;
-+
-+ Write_Lock (Self_ID);
-+
-+ if Mode = Relative then
-+ Abs_Time := Time + Check_Time;
-+ else
-+ Abs_Time := Duration'Min (Check_Time + Max_Sensible_Delay, Time);
-+ end if;
-+
-+ if Abs_Time > Check_Time then
-+ Request := To_Timespec (Abs_Time);
-+ Self_ID.Common.State := Delay_Sleep;
-+
-+ loop
-+ exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level;
-+
-+ if Single_Lock then
-+ Result := pthread_cond_timedwait
-+ (Self_ID.Common.LL.CV'Access,
-+ Single_RTS_Lock'Access,
-+ Request'Access);
-+ else
-+ Result := pthread_cond_timedwait
-+ (Self_ID.Common.LL.CV'Access,
-+ Self_ID.Common.LL.L'Access,
-+ Request'Access);
-+ end if;
-+
-+ Check_Time := Monotonic_Clock;
-+ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time;
-+
-+ pragma Assert (Result = 0 or else
-+ Result = ETIMEDOUT or else
-+ Result = EINTR);
-+ end loop;
-+
-+ Self_ID.Common.State := Runnable;
-+ end if;
-+
-+ Unlock (Self_ID);
-+
-+ if Single_Lock then
-+ Unlock_RTS;
-+ end if;
-+
-+ Result := sched_yield;
-+ end Timed_Delay;
-+
-+ ---------------------
-+ -- Monotonic_Clock --
-+ ---------------------
-+
-+ function Monotonic_Clock return Duration is
-+ TV : aliased struct_timeval;
-+ Result : Interfaces.C.int;
-+ begin
-+ Result := gettimeofday (TV'Access, System.Null_Address);
-+ pragma Assert (Result = 0);
-+ return To_Duration (TV);
-+ end Monotonic_Clock;
-+
-+ -------------------
-+ -- RT_Resolution --
-+ -------------------
-+
-+ function RT_Resolution return Duration is
-+ begin
-+ return 10#1.0#E-6;
-+ end RT_Resolution;
-+
-+ ------------
-+ -- Wakeup --
-+ ------------
-+
-+ procedure Wakeup (T : Task_Id; Reason : System.Tasking.Task_States) is
-+ pragma Unreferenced (Reason);
-+ Result : Interfaces.C.int;
-+ begin
-+ Result := pthread_cond_signal (T.Common.LL.CV'Access);
-+ pragma Assert (Result = 0);
-+ end Wakeup;
-+
-+ -----------
-+ -- Yield --
-+ -----------
-+
-+ procedure Yield (Do_Yield : Boolean := True) is
-+ Result : Interfaces.C.int;
-+ pragma Unreferenced (Result);
-+ begin
-+ if Do_Yield then
-+ Result := sched_yield;
-+ end if;
-+ end Yield;
-+
-+ ------------------
-+ -- Set_Priority --
-+ ------------------
-+
-+ procedure Set_Priority
-+ (T : Task_Id;
-+ Prio : System.Any_Priority;
-+ Loss_Of_Inheritance : Boolean := False)
-+ is
-+ pragma Unreferenced (Loss_Of_Inheritance);
-+
-+ Result : Interfaces.C.int;
-+ Param : aliased struct_sched_param;
-+
-+ function Get_Policy (Prio : System.Any_Priority) return Character;
-+ pragma Import (C, Get_Policy, "__gnat_get_specific_dispatching");
-+ -- Get priority specific dispatching policy
-+
-+ Priority_Specific_Policy : constant Character := Get_Policy (Prio);
-+ -- Upper case first character of the policy name corresponding to the
-+ -- task as set by a Priority_Specific_Dispatching pragma.
-+
-+ begin
-+ T.Common.Current_Priority := Prio;
-+
-+ -- Priorities on Cygwin follow Win32 standards, we use the
-+ -- MinGW conversion table.
-+
-+ Param.sched_priority := Interfaces.C.int (Underlying_Priorities (Prio));
-+
-+ if Dispatching_Policy = 'R'
-+ or else Priority_Specific_Policy = 'R'
-+ or else Time_Slice_Val > 0
-+ then
-+ Result :=
-+ pthread_setschedparam
-+ (T.Common.LL.Thread, SCHED_RR, Param'Access);
-+
-+ elsif Dispatching_Policy = 'F'
-+ or else Priority_Specific_Policy = 'F'
-+ or else Time_Slice_Val = 0
-+ then
-+ Result :=
-+ pthread_setschedparam
-+ (T.Common.LL.Thread, SCHED_FIFO, Param'Access);
-+
-+ else
-+ Param.sched_priority := 0;
-+ Result :=
-+ pthread_setschedparam
-+ (T.Common.LL.Thread,
-+ SCHED_OTHER, Param'Access);
-+ end if;
-+
-+ pragma Assert (Result = 0 or else Result = EPERM);
-+ end Set_Priority;
-+
-+ ------------------
-+ -- Get_Priority --
-+ ------------------
-+
-+ function Get_Priority (T : Task_Id) return System.Any_Priority is
-+ begin
-+ return T.Common.Current_Priority;
-+ end Get_Priority;
-+
-+ --------------------------
-+ -- Get_Stack_Attributes --
-+ --------------------------
-+
-+ procedure Get_Stack_Attributes
-+ (T : Task_Id;
-+ ISP : out System.Address;
-+ Size : out Storage_Offset)
-+ is
-+ function pthread_getattr_np
-+ (thread : pthread_t;
-+ attr : System.Address) return Interfaces.C.int;
-+ pragma Import (C, pthread_getattr_np, "pthread_getattr_np");
-+
-+ function pthread_attr_getstack
-+ (attr : System.Address;
-+ base : System.Address;
-+ size : System.Address) return Interfaces.C.int;
-+ pragma Import (C, pthread_attr_getstack, "pthread_attr_getstack");
-+
-+ Result : Interfaces.C.int;
-+
-+ Attributes : aliased pthread_attr_t;
-+ Stack_Base : aliased System.Address;
-+ Stack_Size : aliased Storage_Offset;
-+
-+ begin
-+ Result :=
-+ pthread_getattr_np
-+ (T.Common.LL.Thread, Attributes'Address);
-+ pragma Assert (Result = 0);
-+
-+ Result :=
-+ pthread_attr_getstack
-+ (Attributes'Address, Stack_Base'Address, Stack_Size'Address);
-+ pragma Assert (Result = 0);
-+
-+ Result := pthread_attr_destroy (Attributes'Access);
-+ pragma Assert (Result = 0);
-+
-+ ISP := Stack_Base + Stack_Size;
-+ Size := Stack_Size;
-+ end Get_Stack_Attributes;
-+
-+ ----------------
-+ -- Enter_Task --
-+ ----------------
-+
-+ procedure Enter_Task (Self_ID : Task_Id) is
-+ begin
-+ if Self_ID.Common.Task_Info /= null
-+ and then
-+ Self_ID.Common.Task_Info.CPU_Affinity = No_CPU
-+ then
-+ raise Invalid_CPU_Number;
-+ end if;
-+
-+ Self_ID.Common.LL.Thread := pthread_self;
-+
-+ Specific.Set (Self_ID);
-+
-+ Lock_RTS;
-+
-+ for J in Known_Tasks'Range loop
-+ if Known_Tasks (J) = null then
-+ Known_Tasks (J) := Self_ID;
-+ Self_ID.Known_Tasks_Index := J;
-+ exit;
-+ end if;
-+ end loop;
-+
-+ Unlock_RTS;
-+
-+ -- Determine where the task stack starts, how large it is, and let the
-+ -- stack checking engine know about it.
-+
-+ declare
-+ Initial_SP : System.Address;
-+ Stack_Size : Storage_Offset;
-+ begin
-+ Get_Stack_Attributes (Self_ID, Initial_SP, Stack_Size);
-+ System.Stack_Checking.Operations.Notify_Stack_Attributes
-+ (Initial_SP, Stack_Size);
-+ end;
-+ end Enter_Task;
-+
-+ --------------
-+ -- New_ATCB --
-+ --------------
-+
-+ function New_ATCB (Entry_Num : Task_Entry_Index) return Task_Id is
-+ begin
-+ return new Ada_Task_Control_Block (Entry_Num);
-+ end New_ATCB;
-+
-+ -------------------
-+ -- Is_Valid_Task --
-+ -------------------
-+
-+ function Is_Valid_Task return Boolean renames Specific.Is_Valid_Task;
-+
-+ -----------------------------
-+ -- Register_Foreign_Thread --
-+ -----------------------------
-+
-+ function Register_Foreign_Thread return Task_Id is
-+ begin
-+ if Is_Valid_Task then
-+ return Self;
-+ else
-+ return Register_Foreign_Thread (pthread_self);
-+ end if;
-+ end Register_Foreign_Thread;
-+
-+ --------------------
-+ -- Initialize_TCB --
-+ --------------------
-+
-+ procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ -- Give the task a unique serial number
-+
-+ Self_ID.Serial_Number := Next_Serial_Number;
-+ Next_Serial_Number := Next_Serial_Number + 1;
-+ pragma Assert (Next_Serial_Number /= 0);
-+
-+ Self_ID.Common.LL.Thread := To_pthread_t (-1);
-+
-+ if not Single_Lock then
-+ Result := pthread_mutex_init (Self_ID.Common.LL.L'Access,
-+ Mutex_Attr'Access);
-+ pragma Assert (Result = 0 or else Result = ENOMEM);
-+
-+ if Result /= 0 then
-+ Succeeded := False;
-+ return;
-+ end if;
-+ end if;
-+
-+ Result := pthread_cond_init (Self_ID.Common.LL.CV'Access,
-+ Cond_Attr'Access);
-+ pragma Assert (Result = 0 or else Result = ENOMEM);
-+
-+ if Result = 0 then
-+ Succeeded := True;
-+ else
-+ if not Single_Lock then
-+ Result := pthread_mutex_destroy (Self_ID.Common.LL.L'Access);
-+ pragma Assert (Result = 0);
-+ end if;
-+
-+ Succeeded := False;
-+ end if;
-+ end Initialize_TCB;
-+
-+ -----------------
-+ -- Create_Task --
-+ -----------------
-+
-+ procedure Create_Task
-+ (T : Task_Id;
-+ Wrapper : System.Address;
-+ Stack_Size : System.Parameters.Size_Type;
-+ Priority : System.Any_Priority;
-+ Succeeded : out Boolean)
-+ is
-+ Attributes : aliased pthread_attr_t;
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ Result := pthread_attr_init (Attributes'Access);
-+ pragma Assert (Result = 0 or else Result = ENOMEM);
-+
-+ if Result /= 0 then
-+ Succeeded := False;
-+ return;
-+ end if;
-+
-+ Result :=
-+ pthread_attr_setstacksize
-+ (Attributes'Access, Interfaces.C.size_t (Stack_Size));
-+ pragma Assert (Result = 0);
-+
-+ Result :=
-+ pthread_attr_setdetachstate
-+ (Attributes'Access, PTHREAD_CREATE_DETACHED);
-+ pragma Assert (Result = 0);
-+
-+ -- Since the initial signal mask of a thread is inherited from the
-+ -- creator, and the Environment task has all its signals masked, we
-+ -- do not need to manipulate caller's signal mask at this point.
-+ -- All tasks in RTS will have All_Tasks_Mask initially.
-+
-+ Result := pthread_create
-+ (T.Common.LL.Thread'Access,
-+ Attributes'Access,
-+ Thread_Body_Access (Wrapper),
-+ To_Address (T));
-+ pragma Assert (Result = 0 or else Result = EAGAIN);
-+
-+ Succeeded := Result = 0;
-+
-+ -- Handle Task_Info
-+
-+ if T.Common.Task_Info /= null then
-+ if T.Common.Task_Info.CPU_Affinity /= Task_Info.Any_CPU then
-+ Result :=
-+ pthread_setaffinity_np
-+ (T.Common.LL.Thread,
-+ CPU_SETSIZE / 8,
-+ T.Common.Task_Info.CPU_Affinity'Access);
-+ pragma Assert (Result = 0);
-+ end if;
-+ end if;
-+
-+ Result := pthread_attr_destroy (Attributes'Access);
-+ pragma Assert (Result = 0);
-+
-+ Set_Priority (T, Priority);
-+ end Create_Task;
-+
-+ ------------------
-+ -- Finalize_TCB --
-+ ------------------
-+
-+ procedure Finalize_TCB (T : Task_Id) is
-+ Result : Interfaces.C.int;
-+ Tmp : Task_Id := T;
-+ Is_Self : constant Boolean := T = Self;
-+
-+ procedure Free is new
-+ Ada.Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id);
-+
-+ begin
-+ if not Single_Lock then
-+ Result := pthread_mutex_destroy (T.Common.LL.L'Access);
-+ pragma Assert (Result = 0);
-+ end if;
-+
-+ Result := pthread_cond_destroy (T.Common.LL.CV'Access);
-+ pragma Assert (Result = 0);
-+
-+ if T.Known_Tasks_Index /= -1 then
-+ Known_Tasks (T.Known_Tasks_Index) := null;
-+ end if;
-+ SC.Invalidate_Stack_Cache (T.Common.Compiler_Data.Pri_Stack_Info'Access);
-+ Free (Tmp);
-+
-+ if Is_Self then
-+ Specific.Set (null);
-+ end if;
-+ end Finalize_TCB;
-+
-+ ---------------
-+ -- Exit_Task --
-+ ---------------
-+
-+ procedure Exit_Task is
-+ begin
-+ Specific.Set (null);
-+ end Exit_Task;
-+
-+ ----------------
-+ -- Abort_Task --
-+ ----------------
-+
-+ procedure Abort_Task (T : Task_Id) is
-+ Result : Interfaces.C.int;
-+ begin
-+ Result :=
-+ pthread_kill
-+ (T.Common.LL.Thread,
-+ Signal (System.Interrupt_Management.Abort_Task_Interrupt));
-+ pragma Assert (Result = 0);
-+ end Abort_Task;
-+
-+ ----------------
-+ -- Initialize --
-+ ----------------
-+
-+ procedure Initialize (S : in out Suspension_Object) is
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ -- Initialize internal state (always to False (RM D.10(6)))
-+
-+ S.State := False;
-+ S.Waiting := False;
-+
-+ -- Initialize internal mutex
-+
-+ Result := pthread_mutex_init (S.L'Access, Mutex_Attr'Access);
-+
-+ pragma Assert (Result = 0 or else Result = ENOMEM);
-+
-+ if Result = ENOMEM then
-+ raise Storage_Error;
-+ end if;
-+
-+ -- Initialize internal condition variable
-+
-+ Result := pthread_cond_init (S.CV'Access, Cond_Attr'Access);
-+
-+ pragma Assert (Result = 0 or else Result = ENOMEM);
-+
-+ if Result /= 0 then
-+ Result := pthread_mutex_destroy (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ if Result = ENOMEM then
-+ raise Storage_Error;
-+ end if;
-+ end if;
-+ end Initialize;
-+
-+ --------------
-+ -- Finalize --
-+ --------------
-+
-+ procedure Finalize (S : in out Suspension_Object) is
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ -- Destroy internal mutex
-+
-+ Result := pthread_mutex_destroy (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ -- Destroy internal condition variable
-+
-+ Result := pthread_cond_destroy (S.CV'Access);
-+ pragma Assert (Result = 0);
-+ end Finalize;
-+
-+ -------------------
-+ -- Current_State --
-+ -------------------
-+
-+ function Current_State (S : Suspension_Object) return Boolean is
-+ begin
-+ -- We do not want to use lock on this read operation. State is marked
-+ -- as Atomic so that we ensure that the value retrieved is correct.
-+
-+ return S.State;
-+ end Current_State;
-+
-+ ---------------
-+ -- Set_False --
-+ ---------------
-+
-+ procedure Set_False (S : in out Suspension_Object) is
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ SSL.Abort_Defer.all;
-+
-+ Result := pthread_mutex_lock (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ S.State := False;
-+
-+ Result := pthread_mutex_unlock (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ SSL.Abort_Undefer.all;
-+ end Set_False;
-+
-+ --------------
-+ -- Set_True --
-+ --------------
-+
-+ procedure Set_True (S : in out Suspension_Object) is
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ SSL.Abort_Defer.all;
-+
-+ Result := pthread_mutex_lock (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ -- If there is already a task waiting on this suspension object then
-+ -- we resume it, leaving the state of the suspension object to False,
-+ -- as it is specified in ARM D.10 par. 9. Otherwise, it just leaves
-+ -- the state to True.
-+
-+ if S.Waiting then
-+ S.Waiting := False;
-+ S.State := False;
-+
-+ Result := pthread_cond_signal (S.CV'Access);
-+ pragma Assert (Result = 0);
-+
-+ else
-+ S.State := True;
-+ end if;
-+
-+ Result := pthread_mutex_unlock (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ SSL.Abort_Undefer.all;
-+ end Set_True;
-+
-+ ------------------------
-+ -- Suspend_Until_True --
-+ ------------------------
-+
-+ procedure Suspend_Until_True (S : in out Suspension_Object) is
-+ Result : Interfaces.C.int;
-+
-+ begin
-+ SSL.Abort_Defer.all;
-+
-+ Result := pthread_mutex_lock (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ if S.Waiting then
-+
-+ -- Program_Error must be raised upon calling Suspend_Until_True
-+ -- if another task is already waiting on that suspension object
-+ -- (RM D.10(10)).
-+
-+ Result := pthread_mutex_unlock (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ SSL.Abort_Undefer.all;
-+
-+ raise Program_Error;
-+ else
-+ -- Suspend the task if the state is False. Otherwise, the task
-+ -- continues its execution, and the state of the suspension object
-+ -- is set to False (ARM D.10 par. 9).
-+
-+ if S.State then
-+ S.State := False;
-+ else
-+ S.Waiting := True;
-+ Result := pthread_cond_wait (S.CV'Access, S.L'Access);
-+ end if;
-+
-+ Result := pthread_mutex_unlock (S.L'Access);
-+ pragma Assert (Result = 0);
-+
-+ SSL.Abort_Undefer.all;
-+ end
-+ if;
-+ end Suspend_Until_True;
-+
-+ ----------------
-+ -- Check_Exit --
-+ ----------------
-+
-+ -- Dummy version
-+
-+ function Check_Exit (Self_ID : ST.Task_Id) return Boolean is
-+ pragma Unreferenced (Self_ID);
-+ begin
-+ return True;
-+ end Check_Exit;
-+
-+ --------------------
-+ -- Check_No_Locks --
-+ --------------------
-+
-+ function Check_No_Locks (Self_ID : ST.Task_Id) return Boolean is
-+ pragma Unreferenced (Self_ID);
-+ begin
-+ return True;
-+ end Check_No_Locks;
-+
-+ ----------------------
-+ -- Environment_Task --
-+ ----------------------
-+
-+ function Environment_Task return Task_Id is
-+ begin
-+ return Environment_Task_Id;
-+ end Environment_Task;
-+
-+ ------------------
-+ -- Suspend_Task --
-+ ------------------
-+
-+ function Suspend_Task
-+ (T : ST.Task_Id;
-+ Thread_Self : Thread_Id) return Boolean
-+ is
-+ begin
-+ if T.Common.LL.Thread /= Thread_Self then
-+ return pthread_kill (T.Common.LL.Thread, SIGSTOP) = 0;
-+ else
-+ return True;
-+ end if;
-+ end Suspend_Task;
-+
-+ -----------------
-+ -- Resume_Task --
-+ -----------------
-+
-+ function Resume_Task
-+ (T : ST.Task_Id;
-+ Thread_Self : Thread_Id) return Boolean
-+ is
-+ begin
-+ if T.Common.LL.Thread /= Thread_Self then
-+ return pthread_kill (T.Common.LL.Thread, SIGCONT) = 0;
-+ else
-+ return True;
-+ end if;
-+ end Resume_Task;
-+
-+ --------------------
-+ -- Stop_All_Tasks --
-+ --------------------
-+
-+ procedure Stop_All_Tasks is
-+ begin
-+ null;
-+ end Stop_All_Tasks;
-+
-+ ---------------
-+ -- Stop_Task --
-+ ---------------
-+
-+ function Stop_Task (T : ST.Task_Id) return Boolean is
-+ pragma Unreferenced (T);
-+ begin
-+ return False;
-+ end Stop_Task;
-+
-+ -------------------
-+ -- Continue_Task --
-+ -------------------
-+
-+ function Continue_Task (T : ST.Task_Id) return Boolean is
-+ pragma Unreferenced (T);
-+ begin
-+ return False;
-+ end Continue_Task;
-+
-+ ----------------
-+ -- Initialize --
-+ ----------------
-+
-+ procedure Initialize (Environment_Task : Task_Id) is
-+ act : aliased struct_sigaction;
-+ old_act : aliased struct_sigaction;
-+ Tmp_Set : aliased sigset_t;
-+ Result : Interfaces.C.int;
-+
-+ function State
-+ (Int : System.Interrupt_Management.Interrupt_ID) return Character;
-+ pragma Import (C, State, "__gnat_get_interrupt_state");
-+ -- Get interrupt state. Defined in a-init.c
-+ -- The input argument is the interrupt number,
-+ -- and the result is one of the following:
-+
-+ Default : constant Character := 's';
-+ -- 'n' this interrupt not set by any Interrupt_State pragma
-+ -- 'u' Interrupt_State pragma set state to User
-+ -- 'r' Interrupt_State pragma set state to Runtime
-+ -- 's' Interrupt_State pragma set state to System (use "default"
-+ -- system handler)
-+
-+ begin
-+ Environment_Task_Id := Environment_Task;
-+
-+ Interrupt_Management.Initialize;
-+
-+ -- Prepare the set of signals that should be unblocked in all tasks
-+
-+ Result := sigemptyset (Unblocked_Signal_Mask'Access);
-+ pragma Assert (Result = 0);
-+
-+ for J in Interrupt_Management.Interrupt_ID loop
-+ if System.Interrupt_Management.Keep_Unmasked (J) then
-+ Result := sigaddset (Unblocked_Signal_Mask'Access, Signal (J));
-+ pragma Assert (Result = 0);
-+ end if;
-+ end loop;
-+
-+ Result := pthread_mutexattr_init (Mutex_Attr'Access);
-+ pragma Assert (Result = 0);
-+
-+ Result := pthread_condattr_init (Cond_Attr'Access);
-+ pragma Assert (Result = 0);
-+
-+ Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level);
-+
-+ -- Initialize the global RTS lock
-+
-+ Specific.Initialize (Environment_Task);
-+
-+ Enter_Task (Environment_Task);
-+
-+ -- Install the abort-signal handler
-+
-+ if State
-+ (System.Interrupt_Management.Abort_Task_Interrupt) /= Default
-+ then
-+ act.sa_flags := 0;
-+ act.sa_handler := Abort_Handler'Address;
-+
-+ Result := sigemptyset (Tmp_Set'Access);
-+ pragma Assert (Result = 0);
-+ act.sa_mask := Tmp_Set;
-+
-+ Result :=
-+ sigaction
-+ (Signal (Interrupt_Management.Abort_Task_Interrupt),
-+ act'Unchecked_Access,
-+ old_act'Unchecked_Access);
-+ pragma Assert (Result = 0);
-+ end if;
-+ end Initialize;
-+
-+end System.Task_Primitives.Operations;
---- origsrc/gcc-4.7.2/gcc/ada/sysdep.c 2012-11-02 15:16:50.062500000 +0000
-+++ src/gcc-4.7.2/gcc/ada/sysdep.c 2012-11-02 15:50:59.968750000 +0000
-@@ -311,7 +311,7 @@ getc_immediate_common (FILE *stream,
- int waiting)
- {
- #if defined (linux) || defined (sun) \
-- || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \
-+ || defined (__CYGWIN__) || defined (__MACHTEN__) || defined (__hpux__) \
- || defined (_AIX) || (defined (__svr4__) && defined (i386)) \
- || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
- || defined (__GLIBC__) || defined (__APPLE__)
-@@ -592,6 +592,18 @@ rts_get_nShowCmd (void)
- }
-
- #endif /* WINNT */
-+
-+#ifdef __CYGWIN__
-+
-+#include <malloc.h>
-+
-+size_t _msize(void *memblock)
-+{
-+ return (size_t) malloc_usable_size (memblock);
-+}
-+
-+#endif /* __CYGWIN__ */
-+
- #ifdef VMS
-
- /* This gets around a problem with using the old threads library on VMS 7.0. */
---- origsrc/gcc-4.7.2/gcc/ada/system-cygwin.ads 1970-01-01 00:00:00.000000000 +0000
-+++ src/gcc-4.7.2/gcc/ada/system-cygwin.ads 2012-11-01 21:17:31.000000000 +0000
-@@ -0,0 +1,198 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- GNAT RUN-TIME COMPONENTS --
-+-- --
-+-- S Y S T E M --
-+-- --
-+-- S p e c --
-+-- (Cygwin Version) --
-+-- --
-+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-+-- --
-+-- This specification is derived from the Ada Reference Manual for use with --
-+-- GNAT. The copyright notice above, and the license provisions that follow --
-+-- apply solely to the contents of the part following the private keyword. --
-+-- --
-+-- GNAT is free software; you can redistribute it and/or modify it under --
-+-- terms of the GNU General Public License as published by the Free Soft- --
-+-- ware Foundation; either version 2, or (at your option) any later ver- --
-+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-+-- for more details. You should have received a copy of the GNU General --
-+-- Public License distributed with GNAT; see file COPYING. If not, write --
-+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-+-- Boston, MA 02110-1301, USA. --
-+-- --
-+-- As a special exception, if other files instantiate generics from this --
-+-- unit, or you link this unit with other files to produce an executable, --
-+-- this unit does not by itself cause the resulting executable to be --
-+-- covered by the GNU General Public License. This exception does not --
-+-- however invalidate any other reasons why the executable file might be --
-+-- covered by the GNU Public License. --
-+-- --
-+-- GNAT was originally developed by the GNAT team at New York University. --
-+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-+-- --
-+------------------------------------------------------------------------------
-+
-+package System is
-+ pragma Pure;
-+ -- Note that we take advantage of the implementation permission to make
-+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
-+ -- 2005, this is Pure in any case (AI-362).
-+
-+ type Name is (SYSTEM_NAME_GNAT);
-+ System_Name : constant Name := SYSTEM_NAME_GNAT;
-+
-+ -- System-Dependent Named Numbers
-+
-+ Min_Int : constant := Long_Long_Integer'First;
-+ Max_Int : constant := Long_Long_Integer'Last;
-+
-+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
-+ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
-+
-+ Max_Base_Digits : constant := Long_Long_Float'Digits;
-+ Max_Digits : constant := Long_Long_Float'Digits;
-+
-+ Max_Mantissa : constant := 63;
-+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
-+
-+ Tick : constant := 0.01;
-+
-+ -- Storage-related Declarations
-+
-+ type Address is private;
-+ pragma Preelaborable_Initialization (Address);
-+ Null_Address : constant Address;
-+
-+ Storage_Unit : constant := 8;
-+ Word_Size : constant := 32;
-+ Memory_Size : constant := 2 ** 32;
-+
-+ -- Address comparison
-+
-+ function "<" (Left, Right : Address) return Boolean;
-+ function "<=" (Left, Right : Address) return Boolean;
-+ function ">" (Left, Right : Address) return Boolean;
-+ function ">=" (Left, Right : Address) return Boolean;
-+ function "=" (Left, Right : Address) return Boolean;
-+
-+ pragma Import (Intrinsic, "<");
-+ pragma Import (Intrinsic, "<=");
-+ pragma Import (Intrinsic, ">");
-+ pragma Import (Intrinsic, ">=");
-+ pragma Import (Intrinsic, "=");
-+
-+ -- Other System-Dependent Declarations
-+
-+ type Bit_Order is (High_Order_First, Low_Order_First);
-+ Default_Bit_Order : constant Bit_Order := Low_Order_First;
-+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
-+
-+ -- Priority-related Declarations (RM D.1)
-+
-+ Max_Priority : constant Positive := 30;
-+ Max_Interrupt_Priority : constant Positive := 31;
-+
-+ subtype Any_Priority is Integer range 0 .. 31;
-+ subtype Priority is Any_Priority range 0 .. 30;
-+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
-+
-+ Default_Priority : constant Priority := 15;
-+
-+private
-+
-+ type Address is mod Memory_Size;
-+ Null_Address : constant Address := 0;
-+
-+ --------------------------------------
-+ -- System Implementation Parameters --
-+ --------------------------------------
-+
-+ -- These parameters provide information about the target that is used
-+ -- by the compiler. They are in the private part of System, where they
-+ -- can be accessed using the special circuitry in the Targparm unit
-+ -- whose source should be consulted for more detailed descriptions
-+ -- of the individual switch values.
-+
-+ Backend_Divide_Checks : constant Boolean := False;
-+ Backend_Overflow_Checks : constant Boolean := False;
-+ Command_Line_Args : constant Boolean := True;
-+ Configurable_Run_Time : constant Boolean := False;
-+ Denorm : constant Boolean := True;
-+ Duration_32_Bits : constant Boolean := False;
-+ Exit_Status_Supported : constant Boolean := True;
-+ Fractional_Fixed_Ops : constant Boolean := False;
-+ Frontend_Layout : constant Boolean := False;
-+ Machine_Overflows : constant Boolean := False;
-+ Machine_Rounds : constant Boolean := True;
-+ Preallocated_Stacks : constant Boolean := False;
-+ Signed_Zeros : constant Boolean := True;
-+ Stack_Check_Default : constant Boolean := False;
-+ Stack_Check_Probes : constant Boolean := True;
-+ Stack_Check_Limits : constant Boolean := False;
-+ Support_64_Bit_Divides : constant Boolean := True;
-+ Support_Aggregates : constant Boolean := True;
-+ Support_Composite_Assign : constant Boolean := True;
-+ Support_Composite_Compare : constant Boolean := True;
-+ Support_Long_Shifts : constant Boolean := True;
-+ Always_Compatible_Rep : constant Boolean := True;
-+ Suppress_Standard_Library : constant Boolean := False;
-+ Use_Ada_Main_Program_Name : constant Boolean := False;
-+ ZCX_By_Default : constant Boolean := True;
-+
-+ ---------------------------
-+ -- Underlying Priorities --
-+ ---------------------------
-+
-+ -- Important note: this section of the file must come AFTER the
-+ -- definition of the system implementation parameters to ensure
-+ -- that the value of these parameters is available for analysis
-+ -- of the declarations here (using Rtsfind at compile time).
-+
-+ -- The underlying priorities table provides a generalized mechanism
-+ -- for mapping from Ada priorities to system priorities. In some
-+ -- cases a 1-1 mapping is not the convenient or optimal choice.
-+
-+ type Priorities_Mapping is array (Any_Priority) of Integer;
-+ pragma Suppress_Initialization (Priorities_Mapping);
-+ -- Suppress initialization in case gnat.adc specifies Normalize_Scalars
-+
-+ Underlying_Priorities : constant Priorities_Mapping :=
-+ (Priority'First ..
-+ Default_Priority - 8 => -15,
-+ Default_Priority - 7 => -7,
-+ Default_Priority - 6 => -6,
-+ Default_Priority - 5 => -5,
-+ Default_Priority - 4 => -4,
-+ Default_Priority - 3 => -3,
-+ Default_Priority - 2 => -2,
-+ Default_Priority - 1 => -1,
-+ Default_Priority => 0,
-+ Default_Priority + 1 => 1,
-+ Default_Priority + 2 => 2,
-+ Default_Priority + 3 => 3,
-+ Default_Priority + 4 => 4,
-+ Default_Priority + 5 => 5,
-+ Default_Priority + 6 ..
-+ Priority'Last => 6,
-+ Interrupt_Priority => 15);
-+ -- The default mapping preserves the standard 31 priorities of the Ada
-+ -- model, but maps them using compression onto the 7 priority levels
-+ -- available in NT and on the 16 priority levels available in 2000/XP.
-+
-+ -- To replace the default values of the Underlying_Priorities mapping,
-+ -- copy this source file into your build directory, edit the file to
-+ -- reflect your desired behavior, and recompile using Makefile.adalib
-+ -- which can be found under the adalib directory of your gnat installation
-+
-+ pragma Linker_Options ("-Wl,--stack=0x2000000");
-+ -- This is used to change the default stack (32 MB) size for non tasking
-+ -- programs. We change this value for GNAT on Windows here because the
-+ -- binutils on this platform have switched to a too low value for Ada
-+ -- programs. Note that we also set the stack size for tasking programs in
-+ -- System.Task_Primitives.Operations.
-+
-+end System;
diff --git a/gcc47-cross-ecjx.patch b/gcc47-cross-ecjx.patch
deleted file mode 100644
index 16179d1..0000000
--- a/gcc47-cross-ecjx.patch
+++ /dev/null
@@ -1,52 +0,0 @@
---- a/libjava/configure.ac 2013-06-27 23:25:19.370920178 -0500
-+++ b/libjava/configure.ac 2013-06-27 23:25:44.904921607 -0500
-@@ -414,8 +414,8 @@ if test -n "${with_cross_host}"; then
- # use ac_exeext, because that is for the target platform.
- NATIVE=no
- cross_host_exeext=
-- GCJ_FOR_ECJX="${with_cross_host}-gcj"
-- GCC_FOR_ECJX="${with_cross_host}-gcc"
-+ GCJ_FOR_ECJX="gcj"
-+ GCC_FOR_ECJX="gcc"
- case "${with_cross_host}" in
- *mingw* | *cygwin*)
- cross_host_exeext=.exe
---- a/libjava/configure 2013-06-27 23:25:22.521920354 -0500
-+++ b/libjava/configure 2013-06-27 23:25:57.828922331 -0500
-@@ -6726,8 +6726,8 @@ if test -n "${with_cross_host}"; then
- # use ac_exeext, because that is for the target platform.
- NATIVE=no
- cross_host_exeext=
-- GCJ_FOR_ECJX="${with_cross_host}-gcj"
-- GCC_FOR_ECJX="${with_cross_host}-gcc"
-+ GCJ_FOR_ECJX="gcj"
-+ GCC_FOR_ECJX="gcc"
- case "${with_cross_host}" in
- *mingw* | *cygwin*)
- cross_host_exeext=.exe
---- a/libjava/Makefile.am 2011-08-05 09:37:48.000000000 -0500
-+++ b/libjava/Makefile.am 2012-06-12 02:57:16.508693300 -0500
-@@ -1167,7 +1167,11 @@ endif
- else !NATIVE
-
- ecjx_LINK = $(GCJ_FOR_ECJX_LINK) $(ecjx_LDFLAGS)
-+if INSTALL_ECJ_JAR
- ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
-+else
-+ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR)
-+endif
- ecjx_LDADD =
- ecjx_DEPENDENCIES =
- ecjx.$(OBJEXT): ecjx.cc
---- a/libjava/Makefile.in 2012-06-12 03:04:48.185527700 -0500
-+++ b/libjava/Makefile.in 2012-03-22 02:37:39.000000000 -0500
-@@ -8445,7 +8445,8 @@ ECJX_BASE_FLAGS = -findirect-dispatch \
- @NATIVE_TRUE@ecjx_LINK = $(GCJLINK) $(ecjx_LDFLAGS)
- @ENABLE_SHARED_FALSE@@NATIVE_TRUE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) -fbootclasspath=$(BOOTCLASSPATH)
- @ENABLE_SHARED_TRUE@@NATIVE_TRUE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR)
--@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
-+@INSTALL_ECJ_JAR_FALSE@@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR)
-+@INSTALL_ECJ_JAR_TRUE@@NATIVE_FALSE@ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
- @NATIVE_FALSE@ecjx_LDADD =
- @NATIVE_TRUE@ecjx_LDADD = -L$(here)/.libs $(extra_ldflags) \
- @NATIVE_TRUE@ $(am__append_28)
diff --git a/gcc47-cross-jardir.patch b/gcc47-cross-jardir.patch
deleted file mode 100644
index 899a273..0000000
--- a/gcc47-cross-jardir.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- origsrc/gcc-4.7.0/libjava/Makefile.am 2011-08-05 09:37:48.000000000 -0500
-+++ src/gcc-4.7.0/libjava/Makefile.am 2012-06-12 02:57:16.508693300 -0500
-@@ -223,7 +223,7 @@ dbexec_LTLIBRARIES = libjvm.la
-
- pkgconfigdir = $(libdir)/pkgconfig
-
--jardir = $(datadir)/java
-+jardir = $(datadir)/gcc-$(gcc_version)/$(target_noncanonical)/java
- jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
- if INSTALL_ECJ_JAR
- jar_DATA += $(ECJ_BUILD_JAR)
---- origsrc/gcc-4.7.0/libjava/Makefile.in 2012-06-12 03:04:48.185527700 -0500
-+++ src/gcc-4.7.0/libjava/Makefile.in 2012-03-22 02:37:39.000000000 -0500
-@@ -938,7 +938,7 @@ CORE_PACKAGE_SOURCE_FILES_LO = $(filter-
- @BUILD_SUBLIBS_TRUE@LIBJAVA_CORE_EXTRA = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@
- dbexec_LTLIBRARIES = libjvm.la
- pkgconfigdir = $(libdir)/pkgconfig
--jardir = $(datadir)/java
-+jardir = $(datadir)/gcc-$(gcc_version)/$(target_noncanonical)/java
- jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar \
- $(am__append_5)
- @JAVA_HOME_SET_FALSE@JAVA_HOME_DIR = $(prefix)
diff --git a/gcc47-java-jni.patch b/gcc47-java-jni.patch
deleted file mode 100644
index 327bd70..0000000
--- a/gcc47-java-jni.patch
+++ /dev/null
@@ -1,56 +0,0 @@
---- origsrc/gcc-4.5.0/libjava/classpath/configure.ac 2009-02-05 17:26:08.000000000 -0600
-+++ src/gcc-4.5.0/libjava/classpath/configure.ac 2009-12-06 01:58:25.091013300 -0600
-@@ -26,7 +26,7 @@ case "$host_os" in
- cp_module=""
- ;;
- *)
-- cp_module="-module"
-+ cp_module="-module -avoid-version"
- ;;
- esac
-
---- origsrc/gcc-4.7.2/libjava/classpath/configure 2011-11-29 14:12:00.000000000 -0600
-+++ src/gcc-4.7.2/libjava/classpath/configure 2013-03-01 01:48:05.585762700 -0600
-@@ -3172,7 +3172,7 @@ case "$host_os" in
- cp_module=""
- ;;
- *)
-- cp_module="-module"
-+ cp_module="-module -avoid-version"
- ;;
- esac
-
---- origsrc/gcc-4.7.2/libjava/include/posix.h 2011-01-03 14:52:22.000000000 -0600
-+++ src/gcc-4.7.2/libjava/include/posix.h 2013-03-06 20:26:16.157459700 -0600
-@@ -47,11 +47,17 @@ details. */
- #include <java/util/Properties.h>
-
- // Prefix and suffix for shared libraries.
-+#ifdef __CYGWIN__
-+#define _Jv_platform_solib_prefix "cyg"
-+#else
- #define _Jv_platform_solib_prefix "lib"
-+#endif
- #if defined(__APPLE__) && defined(__MACH__)
- #define _Jv_platform_solib_suffix ".dylib"
- #elif defined(HPUX) && defined(HP_PA)
- #define _Jv_platform_solib_suffix ".sl"
-+#elif defined(__CYGWIN__)
-+#define _Jv_platform_solib_suffix ".dll"
- #else
- #define _Jv_platform_solib_suffix ".so"
- #endif
---- origsrc/gcc-4.7.2/libjava/java/net/natVMURLConnection.cc 2009-12-01 16:05:25.000000000 -0600
-+++ src/gcc-4.7.2/libjava/java/net/natVMURLConnection.cc 2013-03-06 20:20:42.202970700 -0600
-@@ -32,7 +32,11 @@ void
- java::net::VMURLConnection::init ()
- {
- #if defined (HAVE_MAGIC_T) && defined (HAVE_MAGIC_H) && defined (USE_LTDL)
-+#ifdef __CYGWIN__
-+ lt_dlhandle handle = lt_dlopenext ("cygmagic-1.dll");
-+#else
- lt_dlhandle handle = lt_dlopenext ("libmagic.so");
-+#endif
- if (!handle)
- return;
-
diff --git a/gcc47-libstdc-cygwin.patch b/gcc47-libstdc-cygwin.patch
deleted file mode 100644
index 18d8de6..0000000
--- a/gcc47-libstdc-cygwin.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- origsrc/gcc-4.8-20130310/libstdc++-v3/configure 2013-03-15 02:47:51.930826600 -0500
-+++ src/gcc-4.8-20130310/libstdc++-v3/configure 2013-03-17 00:43:35.146679400 -0500
-@@ -46017,7 +46017,7 @@ $as_echo "#define HAVE_TLS 1" >>confdefs
- ;;
- esac
- ;;
-- *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
-+ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-cygwin*)
-
- # All these tests are for C++; save the language and the compiler flags.
- # The CXXFLAGS thing is suspicious, but based on similar bits previously
---- origsrc/gcc-4.8-20130310/libstdc++-v3/crossconfig.m4 2013-03-15 02:47:51.723814700 -0500
-+++ src/gcc-4.8-20130310/libstdc++-v3/crossconfig.m4 2013-03-17 00:40:59.084753200 -0500
-@@ -141,7 +141,7 @@ case "${host}" in
- ;;
- esac
- ;;
-- *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
-+ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-cygwin*)
- GLIBCXX_CHECK_COMPILER_FEATURES
- GLIBCXX_CHECK_LINKER_FEATURES
- GLIBCXX_CHECK_MATH_SUPPORT
---- origsrc/gcc-4.7.2/libstdc++-v3/testsuite/lib/libstdc++.exp 2012-08-06 22:34:27.000000000 +0800
-+++ src/gcc-4.7.2/libstdc++-v3/testsuite/lib/libstdc++.exp 2013-02-26 19:31:07.934763700 +0800
-@@ -146,6 +146,9 @@ proc libstdc++_init { testfile } {
- set gccdir [file dirname $gccdir]
- append ld_library_path_tmp ":${gccdir}"
- }
-+ if { [string match "*-*-cygwin*" $target_triplet] } {
-+ append ld_library_path_tmp ":${blddir}/../libgcc"
-+ }
- v3track gccdir 3
-
- # Locate libgomp. This is only required for parallel mode.
diff --git a/gcc48-java-soname.patch b/gcc48-java-soname.patch
deleted file mode 100644
index b473867..0000000
--- a/gcc48-java-soname.patch
+++ /dev/null
@@ -1,7 +0,0 @@
---- gcc/config/i386/cygwin.h 2013-01-10 14:38:27.000000000 -0600
-+++ gcc/config/i386/cygwin.h 2013-03-17 01:31:17.078372600 -0500
-@@ -139,3 +139,3 @@
- /* We should find a way to not have to update this manually. */
--#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-13.dll"
-+#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-14.dll"
-
diff --git a/gcc48-specs-cygwin.patch b/gcc48-specs-cygwin.patch
deleted file mode 100644
index f29eec6..0000000
--- a/gcc48-specs-cygwin.patch
+++ /dev/null
@@ -1,317 +0,0 @@
---- gcc/config.build (revision 196430)
-+++ gcc/config.build (working copy)
-@@ -60,7 +60,7 @@
- # IBM 360/370/390 Architecture
- build_xm_defines='FATAL_EXIT_CODE=12'
- ;;
-- i[34567]86-*-cygwin* )
-+ i[34567]86-*-cygwin* | x86_64-*-cygwin* )
- build_xm_file=i386/xm-cygwin.h
- build_exeext=.exe
- ;;
---- gcc/config.gcc 2012-09-12 04:03:54.000000000 -0500
-+++ gcc/config.gcc 2013-03-11 03:41:03.674656700 -0500
-@@ -1438,15 +1438,30 @@ i[34567]86-*-cygwin*)
- xm_file=i386/xm-cygwin.h
- tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
- target_gtfiles="\$(srcdir)/config/i386/winnt.c"
-- extra_options="${extra_options} i386/cygming.opt"
-+ extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
- extra_objs="winnt.o winnt-stubs.o"
- c_target_objs="${c_target_objs} msformat-c.o"
- cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
- if test x$enable_threads = xyes; then
- thread_file='posix'
- fi
- use_gcc_stdint=wrap
- ;;
-+x86_64-*-cygwin*)
-+ need_64bit_isa=yes
-+ tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h i386/cygwin-w64.h i386/cygwin-stdint.h"
-+ xm_file=i386/xm-cygwin.h
-+ tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64"
-+ target_gtfiles="\$(srcdir)/config/i386/winnt.c"
-+ extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
-+ extra_objs="winnt.o winnt-stubs.o"
-+ c_target_objs="${c_target_objs} msformat-c.o"
-+ cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
-+ if test x$enable_threads = xyes; then
-+ thread_file='posix'
-+ fi
-+ use_gcc_stdint=wrap
-+ ;;
- i[34567]86-*-mingw* | x86_64-*-mingw*)
- tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h"
- xm_file=i386/xm-mingw32.h
-@@ -3699,7 +3715,9 @@
- ;;
- i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
- ;;
-- i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
-+ i[34567]86-*-cygwin* | x86_64-*-cygwin*)
-+ ;;
-+ i[34567]86-*-mingw* | x86_64-*-mingw*)
- ;;
- i[34567]86-*-freebsd* | x86_64-*-freebsd*)
- ;;
---- gcc/config.host (revision 196430)
-+++ gcc/config.host (working copy)
-@@ -214,7 +214,7 @@
- ;;
- esac
- ;;
-- i[34567]86-*-cygwin*)
-+ i[34567]86-*-cygwin* | x86_64-*-cygwin*)
- host_xm_file=i386/xm-cygwin.h
- out_host_hook_obj=host-cygwin.o
- host_xmake_file="${host_xmake_file} i386/x-cygwin"
---- gcc/config/i386/cygwin-stdint.h (revision 196430)
-+++ gcc/config/i386/cygwin-stdint.h (working copy)
-@@ -24,39 +24,39 @@
- #define INT8_TYPE "signed char"
- #define INT16_TYPE "short int"
- #define INT32_TYPE "int"
--#define INT64_TYPE "long long int"
-+#define INT64_TYPE (TARGET_64BIT ? "long int" : "long long int")
-
- #define UINT8_TYPE "unsigned char"
- #define UINT16_TYPE "short unsigned int"
- #define UINT32_TYPE "unsigned int"
--#define UINT64_TYPE "long long unsigned int"
-+#define UINT64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
-
- /* Minimum-width integer types */
-
- #define INT_LEAST8_TYPE "signed char"
- #define INT_LEAST16_TYPE "short int"
- #define INT_LEAST32_TYPE "int"
--#define INT_LEAST64_TYPE "long long int"
-+#define INT_LEAST64_TYPE (TARGET_64BIT ? "long int" : "long long int")
-
- #define UINT_LEAST8_TYPE "unsigned char"
- #define UINT_LEAST16_TYPE "short unsigned int"
- #define UINT_LEAST32_TYPE "unsigned int"
--#define UINT_LEAST64_TYPE "long long unsigned int"
-+#define UINT_LEAST64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
-
- /* Fastest minimum-width integer types */
-
- #define INT_FAST8_TYPE "signed char"
--#define INT_FAST16_TYPE "int"
--#define INT_FAST32_TYPE "int"
--#define INT_FAST64_TYPE "long long int"
-+#define INT_FAST16_TYPE (TARGET_64BIT ? "long int" : "int")
-+#define INT_FAST32_TYPE (TARGET_64BIT ? "long int" : "int")
-+#define INT_FAST64_TYPE (TARGET_64BIT ? "long int" : "long long int")
-
- #define UINT_FAST8_TYPE "unsigned char"
--#define UINT_FAST16_TYPE "unsigned int"
--#define UINT_FAST32_TYPE "unsigned int"
--#define UINT_FAST64_TYPE "long long unsigned int"
-+#define UINT_FAST16_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
-+#define UINT_FAST32_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
-+#define UINT_FAST64_TYPE (TARGET_64BIT ? "long unsigned int" : "long long unsigned int")
-
- /* Integer types capable of holding object pointers */
-
--#define INTPTR_TYPE "int"
--#define UINTPTR_TYPE "unsigned int"
-+#define INTPTR_TYPE (TARGET_64BIT ? "long int" : "int")
-+#define UINTPTR_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
-
---- gcc/config/i386/cygwin.h (revision 196430)
-+++ gcc/config/i386/cygwin.h (working copy)
-@@ -18,11 +18,20 @@
- along with GCC; see the file COPYING3. If not see
- <http://www.gnu.org/licenses/>. */
-
--#define EXTRA_OS_CPP_BUILTINS() /* Nothing. */
-+#define EXTRA_OS_CPP_BUILTINS() \
-+ do \
-+ { \
-+ builtin_define ("__CYGWIN__"); \
-+ if (!TARGET_64BIT) \
-+ builtin_define ("__CYGWIN32__"); \
-+ builtin_define ("__unix__"); \
-+ builtin_define ("__unix"); \
-+ } \
-+ while (0)
-
- #undef CPP_SPEC
- #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
-- -D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix \
-+ %{!ansi:-Dunix} %{pthread: } \
- %{mwin32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}} \
- %{!nostdinc:%{!mno-win32:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}\
- "
-@@ -71,12 +80,14 @@
- #undef LIB_SPEC
- #define LIB_SPEC "\
- %{pg:-lgmon} \
-+ %{pthread: } \
- -lcygwin \
- %{mwindows:-lgdi32 -lcomdlg32} \
- -ladvapi32 -lshell32 -luser32 -lkernel32"
-
- /* To implement C++ function replacement we always wrap the cxx
- malloc-like operators. See N2800 #17.6.4.6 [replacement.functions] */
-+#undef CXX_WRAP_SPEC_LIST
- #define CXX_WRAP_SPEC_LIST " \
- --wrap _Znwj \
- --wrap _Znaj \
-@@ -115,7 +126,9 @@
- %{shared: --shared} %{mdll:--dll} \
- %{static:-Bstatic} %{!static:-Bdynamic} \
- %{shared|mdll: --enable-auto-image-base -e __cygwin_dll_entry@12} \
-- --dll-search-prefix=cyg -tsaware"
-+ --dll-search-prefix=cyg \
-+ %{rdynamic: --export-all-symbols} \
-+ %{!shared: %{!mdll: --large-address-aware --tsaware}}"
-
- /* Binutils does not handle weak symbols from dlls correctly. For now,
- do not use them unnecessarily in gthr-posix.h. */
---- gcc/config/i386/cygwin.opt 1969-12-31 18:00:00.000000000 -0600
-+++ gcc/config/i386/cygwin.opt 2013-03-11 03:36:36.556378400 -0500
-@@ -0,0 +1,27 @@
-+; Cygwin-specific options.
-+
-+; Copyright (C) 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
-+;
-+; This file is part of GCC.
-+;
-+; GCC is free software; you can redistribute it and/or modify it under
-+; the terms of the GNU General Public License as published by the Free
-+; Software Foundation; either version 3, or (at your option) any later
-+; version.
-+;
-+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-+; for more details.
-+;
-+; You should have received a copy of the GNU General Public License
-+; along with GCC; see the file COPYING3. If not see
-+; <http://www.gnu.org/licenses/>.
-+
-+pthread
-+Driver
-+
-+rdynamic
-+Driver
-+
-+; Retain blank line above
---- gcc/config/i386/cygwin-w64.h (revision 0)
-+++ gcc/config/i386/cygwin-w64.h (working copy)
-@@ -0,0 +1,84 @@
-+/* Operating system specific defines to be used when targeting GCC for
-+ hosting on Windows 32/64 via Cygwin runtime, using GNU tools and
-+ the Windows API Library.
-+ Copyright (C) 2013 Free Software Foundation, Inc.
-+
-+This file is part of GCC.
-+
-+GCC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 3, or (at your option)
-+any later version.
-+
-+GCC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GCC; see the file COPYING3. If not see
-+<http://www.gnu.org/licenses/>. */
-+
-+/* Enable multilib. */
-+
-+#undef ASM_SPEC
-+#define ASM_SPEC "%{m32:--32} %{m64:--64}"
-+
-+/* To implement C++ function replacement we always wrap the cxx
-+ malloc-like operators. See N2800 #17.6.4.6 [replacement.functions] */
-+#undef CXX_WRAP_SPEC_LIST
-+#define CXX_WRAP_SPEC_LIST " \
-+ --wrap _Znwm \
-+ --wrap _Znam \
-+ --wrap _ZdlPv \
-+ --wrap _ZdaPv \
-+ --wrap _ZnwmRKSt9nothrow_t \
-+ --wrap _ZnamRKSt9nothrow_t \
-+ --wrap _ZdlPvRKSt9nothrow_t \
-+ --wrap _ZdaPvRKSt9nothrow_t \
-+"
-+
-+#undef SPEC_32
-+#undef SPEC_64
-+#define SPEC_32 "m32"
-+#define SPEC_64 "!m32"
-+
-+#undef SUB_LINK_ENTRY32
-+#undef SUB_LINK_ENTRY64
-+#define SUB_LINK_ENTRY32 "-e __cygwin_dll_entry@12"
-+#define SUB_LINK_ENTRY64 "-e _cygwin_dll_entry"
-+
-+#undef SUB_LINK_SPEC
-+#undef SUB_LINK_ENTRY
-+#define SUB_LINK_SPEC "%{" SPEC_64 ":-m i386pep} %{" SPEC_32 ":-m i386pe}"
-+#define SUB_LINK_ENTRY "%{" SPEC_64 ":" SUB_LINK_ENTRY64 "} %{" SPEC_32 ":" SUB_LINK_ENTRY32 "}"
-+
-+#undef MULTILIB_DEFAULTS
-+#define MULTILIB_DEFAULTS { "m64" }
-+
-+#undef LINK_SPEC
-+#define LINK_SPEC SUB_LINK_SPEC "\
-+ %{mwindows:--subsystem windows} \
-+ %{mconsole:--subsystem console} \
-+ " CXX_WRAP_SPEC " \
-+ %{shared: %{mdll: %eshared and mdll are not compatible}} \
-+ %{shared: --shared} %{mdll:--dll} \
-+ %{static:-Bstatic} %{!static:-Bdynamic} \
-+ %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
-+ %(shared_libgcc_undefs) \
-+ --dll-search-prefix=cyg \
-+ %{rdynamic: --export-all-symbols} \
-+ %{!shared: %{!mdll: %{" SPEC_32 ":--large-address-aware} --tsaware}}"
-+
-+/* Cygwin64 will have a 64-bit long type. */
-+#undef LONG_TYPE_SIZE
-+#define LONG_TYPE_SIZE (TARGET_64BIT ? 64 : 32)
-+
-+/* Override default "long long unsigned int" from cygming.h. */
-+#undef SIZE_TYPE
-+#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
-+#undef PTRDIFF_TYPE
-+#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
-+
-+#undef LIBGCC_SONAME
-+#define LIBGCC_SONAME "cyggcc_s-seh-1.dll"
---- gcc/config/i386/t-cygwin-w64 (revision 0)
-+++ gcc/config/i386/t-cygwin-w64 (working copy)
-@@ -0,0 +1,3 @@
-+MULTILIB_OPTIONS = m64/m32
-+MULTILIB_DIRNAMES = 64
-+MULTILIB_OSDIRNAMES = ../lib ../lib32
---- gcc/configure.ac (revision 196430)
-+++ gcc/configure.ac (working copy)
-@@ -3611,7 +3611,7 @@
- # wrappers to aid in interposing and redirecting operators new, delete,
- # etc., as per n2800 #17.6.4.6 [replacement.functions]. Check if we
- # are configuring for a version of Cygwin that exports the wrappers.
-- if test x$host = x$target; then
-+ if test x$host = x$target && test x$host_cpu = xi686; then
- AC_CHECK_FUNC([__wrap__Znaj],[gcc_ac_cygwin_dll_wrappers=yes],[gcc_ac_cygwin_dll_wrappers=no])
- else
- # Can't check presence of libc functions during cross-compile, so
---- gcc/configure (revision 196430)
-+++ gcc/configure (working copy)
-@@ -24261,7 +24261,7 @@
- # wrappers to aid in interposing and redirecting operators new, delete,
- # etc., as per n2800 #17.6.4.6 [replacement.functions]. Check if we
- # are configuring for a version of Cygwin that exports the wrappers.
-- if test x$host = x$target; then
-+ if test x$host = x$target && test x$host_cpu = xi686; then
- ac_fn_c_check_func "$LINENO" "__wrap__Znaj" "ac_cv_func___wrap__Znaj"
- if test "x$ac_cv_func___wrap__Znaj" = x""yes; then :
- gcc_ac_cygwin_dll_wrappers=yes
diff --git a/gcc49-default-manifest.patch b/gcc49-default-manifest.patch
deleted file mode 100644
index afb2c77..0000000
--- a/gcc49-default-manifest.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-2014-04-23 Nick Clifton <nickc@redhat.com>
-
- * config/i386/cygwin.h (ENDFILE_SPEC): Include
- default-manifest.o if it can be found in the search path.
- * config/i386/mingw32.h (ENDFILE_SPEC): Likewise.
-
-Index: gcc/config/i386/cygwin.h
-===================================================================
---- gcc/config/i386/cygwin.h (revision 209670)
-+++ gcc/config/i386/cygwin.h (working copy)
-@@ -45,6 +45,7 @@
- #undef ENDFILE_SPEC
- #define ENDFILE_SPEC \
- "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}\
-+ %{!shared:%:if-exists(default-manifest.o%s)}\
- crtend.o%s"
-
- /* Normally, -lgcc is not needed since everything in it is in the DLL, but we
-Index: gcc/config/i386/mingw32.h
-===================================================================
---- gcc/config/i386/mingw32.h (revision 209670)
-+++ gcc/config/i386/mingw32.h (working copy)
-@@ -148,6 +148,7 @@
- #undef ENDFILE_SPEC
- #define ENDFILE_SPEC \
- "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
-+ %{!shared:%:if-exists(default-manifest.o%s)}\
- crtend.o%s"
-
- /* Override startfile prefix defaults. */
-
diff --git a/sources b/sources
index b707160..ff000f3 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-7c60f24fab389f77af203d2516ee110f gcc-4.8.3.tar.bz2
+4df8ee253b7f3863ad0b86359cd39c43 gcc-4.9.2.tar.bz2