summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--0001-share-mingw-fset-stack-executable-with-cygwin.patch69
-rw-r--r--0002-boehm-gc-for-cygwin.patch71
-rw-r--r--0008-libitm-libtool-fixes-for-Cygwin.patch115
-rw-r--r--0009-Cygwin-uses-sysv-ABI-on-x86_64-V2.patch75
-rw-r--r--0010-Do-not-version-lto-plugin-on-cygwin-mingw.patch19
-rw-r--r--0013-skip-test-for-cygwin-mingw.patch4
-rw-r--r--0014-64bit-Cygwin-uses-SEH.patch304
-rw-r--r--0015-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch31
-rw-r--r--0018-prevent-modules-from-being-unloaded-before-their-dto.patch27
-rw-r--r--0020-cygwin-uses-cyg-lib-prefix-v3.patch199
-rw-r--r--0021-search-usr-lib-w32api-explicitly.patch24
-rw-r--r--0024-libitm-weak-symbols.patch200
-rw-r--r--0028-g++-time.patch8
-rw-r--r--0030-newlib-ftm.patch4
-rw-r--r--0031-define_std-unix.patch4
-rw-r--r--0032-libstdc-use-lt_host_flags-for-libstdc-.la.patch26
-rw-r--r--0033-libstdc-regenerate-src-Makefile.in-for-lt_host_flags.patch26
-rw-r--r--0034-libstdc-use-a-link-test-to-test-for-Wl-z-relro.patch38
-rw-r--r--0035-libstdc-regenerate-configure.patch455
-rw-r--r--1000-cross-exe-suffix.patch10
-rw-r--r--cygwin-gcc.spec79
-rw-r--r--sources2
23 files changed, 577 insertions, 1219 deletions
diff --git a/.gitignore b/.gitignore
index 41147a3..38ae3dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1 @@
-/gcc-5.3.0.tar.bz2
-/gcc-5.4.0.tar.bz2
-/gcc-6.4.0.tar.xz
-/gcc-7.3.0.tar.xz
-/gcc-7.4.0.tar.xz
+/gcc-*.tar.xz
diff --git a/0001-share-mingw-fset-stack-executable-with-cygwin.patch b/0001-share-mingw-fset-stack-executable-with-cygwin.patch
deleted file mode 100644
index d5663b7..0000000
--- a/0001-share-mingw-fset-stack-executable-with-cygwin.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From bb571d27350ba5e38ae1f2025dc32d826e21e48c 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/21] 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 c7e398f..ff63140 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.
-
-+fset-stack-executable
-+Common Report Var(flag_setstackexecutable) Init(1) Optimization
-+For nested functions on stack executable permission is set.
-+
- posix
- Driver
-
-diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
-index 2186937..803fb6c 100644
---- a/gcc/config/i386/cygwin.h
-+++ b/gcc/config/i386/cygwin.h
-@@ -153,3 +153,7 @@ along with GCC; see the file COPYING3. If not see
- #endif
- #define LIBGCC_SONAME "cyggcc_s" LIBGCC_EH_EXTN "-1.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
-diff --git a/gcc/config/i386/mingw.opt b/gcc/config/i386/mingw.opt
-index 322b66c..a0065a6 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.
-
--fset-stack-executable
--Common Report Var(flag_setstackexecutable) Init(1) Optimization
--For nested functions on stack executable permission is set.
--
- ; Need to retain blank line above.
-diff --git a/libgcc/config.host b/libgcc/config.host
-index 140aa22..ecaabc1 100644
---- a/libgcc/config.host
-+++ b/libgcc/config.host
-@@ -313,6 +313,9 @@ case ${host} in
- i[34567]86-*-mingw* | x86_64-*-mingw*)
- enable_execute_stack=config/i386/enable-execute-stack-mingw32.c
- ;;
-+i[34567]86-*-cygwin* | x86_64-*-cygwin*)
-+ enable_execute_stack=config/i386/enable-execute-stack-mingw32.c
-+ ;;
- *)
- enable_execute_stack=enable-execute-stack-empty.c;
- ;;
---
-2.4.5
-
diff --git a/0002-boehm-gc-for-cygwin.patch b/0002-boehm-gc-for-cygwin.patch
deleted file mode 100644
index 8614803..0000000
--- a/0002-boehm-gc-for-cygwin.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 350df6c8caa021f3237486ea6b5145ee559f4d00 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/21] 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 2de1c69..07ecde0 100644
---- a/boehm-gc/win32_threads.c
-+++ b/boehm-gc/win32_threads.c
-@@ -711,6 +711,54 @@ void * GC_start_routine(void * arg)
- return(result);
- }
-
-+void GC_register_my_thread()
-+{
-+ GC_thread me;
-+ pthread_t my_pthread;
-+
-+ my_pthread = pthread_self();
-+# if DEBUG_CYGWIN_THREADS
-+ GC_printf1("Attaching thread 0x%lx\n", my_pthread);
-+ GC_printf1("pid = %ld\n", (long) getpid());
-+# endif
-+
-+ /* Check to ensure this thread isn't attached already. */
-+ LOCK();
-+ me = GC_lookup_thread (my_pthread);
-+ UNLOCK();
-+ if (me != 0)
-+ {
-+# if DEBUG_CYGWIN_THREADS
-+ GC_printf1("Attempt to re-attach known thread 0x%lx\n", my_pthread);
-+# endif
-+ return;
-+ }
-+
-+ LOCK();
-+ me = GC_new_thread();
-+ me -> flags |= DETACHED;
-+ me -> pthread_id = pthread_self();
-+ UNLOCK();
-+}
-+
-+void GC_unregister_my_thread()
-+{
-+ pthread_t my_pthread;
-+ GC_thread me;
-+
-+ my_pthread = pthread_self();
-+
-+# if DEBUG_CYGWIN_THREADS
-+ GC_printf1("Detaching thread 0x%lx\n", my_pthread);
-+# endif
-+
-+ LOCK();
-+ me = GC_lookup_thread(my_pthread);
-+ UNLOCK();
-+ GC_thread_exit_proc ((void *)me);
-+}
-+
-+
- void GC_thread_exit_proc(void *arg)
- {
- GC_thread me = (GC_thread)arg;
---
-2.4.5
-
diff --git a/0008-libitm-libtool-fixes-for-Cygwin.patch b/0008-libitm-libtool-fixes-for-Cygwin.patch
deleted file mode 100644
index aab1b5b..0000000
--- a/0008-libitm-libtool-fixes-for-Cygwin.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 0e3b5257a3703bd2867c329a8fd60ec4994655ab Mon Sep 17 00:00:00 2001
-From: Jonathan Yong <10walls@gmail.com>
-Date: Sat, 28 Jun 2014 09:22:03 +0800
-Subject: [PATCH 08/21] 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 138eeb1..a25c6d2 100644
---- a/libitm/Makefile.in
-+++ b/libitm/Makefile.in
-@@ -307,6 +307,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@
-@@ -357,7 +358,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 aeab414..15be307 100644
---- a/libitm/aclocal.m4
-+++ b/libitm/aclocal.m4
-@@ -1016,6 +1016,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 55332bb..2696e86 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
-@@ -15152,6 +15153,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 2d99b11..6b8ad09 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.4.5
-
diff --git a/0009-Cygwin-uses-sysv-ABI-on-x86_64-V2.patch b/0009-Cygwin-uses-sysv-ABI-on-x86_64-V2.patch
deleted file mode 100644
index a36e9ce..0000000
--- a/0009-Cygwin-uses-sysv-ABI-on-x86_64-V2.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def
-index 38fb1bb..bd5d97a 100644
---- a/gcc/builtin-attrs.def
-+++ b/gcc/builtin-attrs.def
-@@ -112,6 +112,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_IDENT (ATTR_RETURNS_NONNULL, "returns_nonnull")
-
- DEF_ATTR_TREE_LIST (ATTR_NOVOPS_LIST, ATTR_NOVOPS, ATTR_NULL, ATTR_NULL)
-@@ -375,6 +376,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 6d5cfb9..1f47898 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/libitm.h b/libitm/libitm.h
-index 4745f2a..a8c77e7 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 b3633bb..3072bad 100644
---- a/libitm/libitm_i.h
-+++ b/libitm/libitm_i.h
-@@ -294,7 +294,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 init_cpp_exceptions ();
- void revert_cpp_exceptions (gtm_transaction_cp *cp = 0);
-@@ -328,7 +328,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;
-
diff --git a/0010-Do-not-version-lto-plugin-on-cygwin-mingw.patch b/0010-Do-not-version-lto-plugin-on-cygwin-mingw.patch
index 9a7760e..5049d2c 100644
--- a/0010-Do-not-version-lto-plugin-on-cygwin-mingw.patch
+++ b/0010-Do-not-version-lto-plugin-on-cygwin-mingw.patch
@@ -16,7 +16,7 @@ diff --git a/gcc/config.host b/gcc/config.host
index 8b7e16d..361de8e 100644
--- a/gcc/config.host
+++ b/gcc/config.host
-@@ -232,22 +232,22 @@ case ${host} in
+@@ -232,7 +232,7 @@ case ${host} in
out_host_hook_obj=host-cygwin.o
host_xmake_file="${host_xmake_file} i386/x-cygwin"
host_exeext=.exe
@@ -25,23 +25,6 @@ index 8b7e16d..361de8e 100644
;;
i[34567]86-*-mingw32*)
host_xm_file=i386/xm-mingw32.h
- host_xmake_file="${host_xmake_file} i386/x-mingw32"
- host_exeext=.exe
- out_host_hook_obj=host-mingw32.o
-- host_lto_plugin_soname=liblto_plugin-0.dll
-+ host_lto_plugin_soname=liblto_plugin.dll
- ;;
- x86_64-*-mingw*)
- use_long_long_for_widest_fast_int=yes
- host_xm_file=i386/xm-mingw32.h
- host_xmake_file="${host_xmake_file} i386/x-mingw32"
- host_exeext=.exe
- out_host_hook_obj=host-mingw32.o
-- host_lto_plugin_soname=liblto_plugin-0.dll
-+ host_lto_plugin_soname=liblto_plugin.dll
- ;;
- i[34567]86-*-darwin* | x86_64-*-darwin*)
- out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o"
diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
index a90a5da..1ebf155 100644
--- a/lto-plugin/Makefile.am
diff --git a/0013-skip-test-for-cygwin-mingw.patch b/0013-skip-test-for-cygwin-mingw.patch
index 6c6968c..d94fc14 100644
--- a/0013-skip-test-for-cygwin-mingw.patch
+++ b/0013-skip-test-for-cygwin-mingw.patch
@@ -13,8 +13,8 @@ index b079e25..c30eaf5 100644
+++ 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-skip-if "" { "*-*-darwin*" "*-*-mingw*" } } */
++/* { dg-skip-if "" { "*-*-darwin*" "*-*-mingw*" "*-*-cygwin*" } } */
/* { dg-options "-std=c99 -x assembler-with-cpp" } */
#ifndef __ASSEMBLER__
diff --git a/0014-64bit-Cygwin-uses-SEH.patch b/0014-64bit-Cygwin-uses-SEH.patch
deleted file mode 100644
index 1d68485..0000000
--- a/0014-64bit-Cygwin-uses-SEH.patch
+++ /dev/null
@@ -1,304 +0,0 @@
-From 1a3122f89dd16478d913ad09735c26754eb789ae Mon Sep 17 00:00:00 2001
-From: Jonathan Yong <10walls@gmail.com>
-Date: Sat, 28 Jun 2014 10:01:33 +0800
-Subject: [PATCH 14/21] 64bit Cygwin uses SEH
-
-Conflicts:
- gcc/ada/seh_init.c
----
- gcc/ada/seh_init.c | 16 ++--
- gcc/ada/system-cygwin-x86_64.ads | 198 +++++++++++++++++++++++++++++++++++++++
- gcc/ada/tracebak.c | 2 +-
- 3 files changed, 209 insertions(+), 7 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 c8e6512..73e8928 100644
---- a/gcc/ada/seh_init.c
-+++ b/gcc/ada/seh_init.c
-@@ -46,6 +46,7 @@
- #define xmalloc(S) malloc (S)
-
- #else
-+#define FLEX_SCANNER /* do not poison malloc */
- #include "config.h"
- #include "system.h"
- #endif
-@@ -72,6 +73,9 @@ extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *)
-
- #if defined (_WIN32) || (defined (__CYGWIN__) && defined (__SEH__))
-
-+#include <windows.h>
-+#include <excpt.h>
-+
- /* Prototypes. */
- extern void _global_unwind2 (void *);
-
-@@ -173,7 +177,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,
-@@ -192,7 +196,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. */
-@@ -203,9 +207,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
-@@ -258,7 +262,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
-@@ -291,7 +295,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 1e53ab5..2096f1a 100644
---- a/gcc/ada/tracebak.c
-+++ b/gcc/ada/tracebak.c
-@@ -95,7 +95,7 @@ extern void (*Unlock_Task) (void);
- *-- Target specific implementations --*
- *-------------------------------------*/
-
--#if defined (_WIN64) && defined (__SEH__)
-+#if (defined (_WIN64) || defined(__CYGWIN__)) && defined (__SEH__)
-
- #include <windows.h>
-
---
-2.4.5
-
diff --git a/0015-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch b/0015-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch
deleted file mode 100644
index a8fc3df..0000000
--- a/0015-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From c7bb06877773f0a0c3b1192c68e726b7f61191f3 Mon Sep 17 00:00:00 2001
-From: Jonathan Yong <10walls@gmail.com>
-Date: Sat, 28 Jun 2014 10:05:50 +0800
-Subject: [PATCH 15/21] define RTS_CONTROL_ENABLE and DTR_CONTROL_ENABLE for
- Cygwin
-
-Conflicts:
- gcc/ada/s-oscons-tmplt.c
----
- gcc/ada/s-oscons-tmplt.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
-index 56da9f8..de6d3cd 100644
---- a/gcc/ada/s-oscons-tmplt.c
-+++ b/gcc/ada/s-oscons-tmplt.c
-@@ -1001,6 +1001,11 @@ CND(VEOL2, "Alternative EOL")
-
- #endif /* HAVE_TERMIOS */
-
-+#if defined(__CYGWIN__)
-+#define RTS_CONTROL_ENABLE 0x1
-+#define DTR_CONTROL_ENABLE 0x1
-+#endif
-+
- #if defined(__MINGW32__) || defined(__CYGWIN__)
- CNU(DTR_CONTROL_ENABLE, "Enable DTR flow ctrl")
- CNU(RTS_CONTROL_ENABLE, "Enable RTS flow ctrl")
---
-2.4.5
-
diff --git a/0018-prevent-modules-from-being-unloaded-before-their-dto.patch b/0018-prevent-modules-from-being-unloaded-before-their-dto.patch
deleted file mode 100644
index 898d023..0000000
--- a/0018-prevent-modules-from-being-unloaded-before-their-dto.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From c1d40554910707ad87f9bcef43b537b5d6ca2f78 Mon Sep 17 00:00:00 2001
-From: Jonathan Yong <10walls@gmail.com>
-Date: Fri, 31 Oct 2014 06:46:02 +0800
-Subject: [PATCH 18/21] prevent modules from being unloaded before their dtors
- are called
-
----
- libstdc++-v3/config/os/mingw32-w64/os_defines.h | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libstdc++-v3/config/os/mingw32-w64/os_defines.h b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
-index 976355c..b1d048d 100644
---- a/libstdc++-v3/config/os/mingw32-w64/os_defines.h
-+++ b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
-@@ -86,4 +86,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
-+// their dtors are called
-+#define _GLIBCXX_THREAD_ATEXIT_WIN32 1
-+
- #endif
---
-2.4.5
-
diff --git a/0020-cygwin-uses-cyg-lib-prefix-v3.patch b/0020-cygwin-uses-cyg-lib-prefix-v3.patch
deleted file mode 100644
index a1a1598..0000000
--- a/0020-cygwin-uses-cyg-lib-prefix-v3.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
-index 7a57019..6feeaf9 100644
---- a/gcc/ada/gcc-interface/Makefile.in
-+++ b/gcc/ada/gcc-interface/Makefile.in
-@@ -131,6 +131,7 @@ arext = .a
- soext = .so
- shext =
- hyphen = -
-+soprefix = lib
-
- # program_transform_name and objdir are set by configure.ac.
- program_transform_name =
-@@ -373,7 +374,7 @@ EH_MECHANISM=
-
- # Default shared object option. Note that we rely on the fact that the "soname"
- # option will always be present and last in this flag, so that we can have
--# $(SO_OPTS)libgnat-x.xx
-+# $(SO_OPTS)$(soprefix)gnat-x.xx
-
- SO_OPTS = -Wl,-soname,
-
-@@ -1847,6 +1848,9 @@ ifeq ($(strip $(filter-out cygwin% mingw32% pe,$(target_os))),)
- GMEM_LIB = gmemlib
- EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
- EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
-+ ifeq ($(strip $(filter-out cygwin%,$(target_os))),)
-+ soprefix = cyg
-+ endif
- soext = .dll
- LIBRARY_VERSION := $(LIB_VERSION)
- endif
-@@ -2686,16 +2690,16 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR) install-gcc-specs
- # 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)/$(soprefix)$${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
-@@ -2828,25 +2832,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)$(soprefix)gnarl$(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) $(soprefix)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
-+ $(soprefix)gnarl$(soext)
-
- # Create static libgnat and libgnarl compiled with -fPIC
- $(RM) $(RTSDIR)/libgnat_pic$(arext) $(RTSDIR)/libgnarl_pic$(arext)
-@@ -2866,7 +2870,7 @@ gnatlib-shared-dual:
- MULTISUBDIR="$(MULTISUBDIR)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib-shared-default
-- $(MV) $(RTSDIR)/libgna*$(soext) .
-+ $(MV) $(RTSDIR)/$(soprefix)gna*$(soext) .
- $(MV) $(RTSDIR)/libgnat_pic$(arext) .
- $(MV) $(RTSDIR)/libgnarl_pic$(arext) .
- $(RM) ../stamp-gnatlib2-$(RTSDIR)
-@@ -2877,7 +2881,7 @@ gnatlib-shared-dual:
- MULTISUBDIR="$(MULTISUBDIR)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
-- $(MV) libgna*$(soext) $(RTSDIR)
-+ $(MV) $(soprefix)gna*$(soext) $(RTSDIR)
- $(MV) libgnat_pic$(arext) $(RTSDIR)
- $(MV) libgnarl_pic$(arext) $(RTSDIR)
-
-@@ -2890,7 +2894,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)" \
-@@ -2899,7 +2903,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
-@@ -2913,22 +2917,24 @@ gnatlib-shared-win32:
- MULTISUBDIR="$(MULTISUBDIR)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
-- $(RM) $(RTSDIR)/libgna*$(soext)
-+ $(RM) $(RTSDIR)/$(soprefix)gna*$(soext)
- $(CP) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnat_pic$(arext)
- $(CP) $(RTSDIR)/libgnarl$(arext) $(RTSDIR)/libgnarl_pic$(arext)
- 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)
-+ -Wl,-out-implib,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)$(arext) \
-+ $(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) \
-+ -Wl,-out-implib,libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext)$(arext) \
-+ $(THREADSLIB) -Wl,$(soprefix)gnat$(hyphen)$(LIBRARY_VERSION)$(soext)
-
- gnatlib-shared-darwin:
- $(MAKE) $(FLAGS_TO_PASS) \
-@@ -2938,29 +2944,29 @@ 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)
- $(CP) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnat_pic$(arext)
- $(CP) $(RTSDIR)/libgnarl$(arext) $(RTSDIR)/libgnarl_pic$(arext)
- 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:
- $(MAKE) $(FLAGS_TO_PASS) \
diff --git a/0021-search-usr-lib-w32api-explicitly.patch b/0021-search-usr-lib-w32api-explicitly.patch
deleted file mode 100644
index 33df116..0000000
--- a/0021-search-usr-lib-w32api-explicitly.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From cc937b29a9b772240a9cfbb41428a08db66a91af Mon Sep 17 00:00:00 2001
-From: Jonathan Yong <10walls@gmail.com>
-Date: Sat, 19 Sep 2015 15:41:44 +0800
-Subject: [PATCH 21/21] search /usr/lib/w32api explicitly
-
----
- gcc/config/i386/cygwin.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
-index 2a2a0bf..fd3bc0a 100644
---- a/gcc/config/i386/cygwin.h
-+++ b/gcc/config/i386/cygwin.h
-@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
-
- #undef STARTFILE_SPEC
- #define STARTFILE_SPEC "\
-+ -L%R/usr/lib/w32api \
- %{!shared: %{!mdll: crt0%O%s \
- %{pg:gcrt0%O%s}}}\
- %{shared:crtbeginS.o%s;:crtbegin.o%s} \
---
-2.4.5
-
diff --git a/0024-libitm-weak-symbols.patch b/0024-libitm-weak-symbols.patch
deleted file mode 100644
index 9f3f6e0..0000000
--- a/0024-libitm-weak-symbols.patch
+++ /dev/null
@@ -1,200 +0,0 @@
-diff --git a/libitm/Makefile.am b/libitm/Makefile.am
-index 1dce82d..8b133b3 100644
---- a/libitm/Makefile.am
-+++ b/libitm/Makefile.am
-@@ -53,7 +53,6 @@ libitm_version_info = -version-info $(libtool_VERSION)
- # Force link with C, not C++. For now, while we're using C++ we don't
- # 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_SOURCES = \
-diff --git a/libitm/Makefile.in b/libitm/Makefile.in
-index 138eeb1..f688e84 100644
---- a/libitm/Makefile.in
-+++ b/libitm/Makefile.in
-@@ -356,7 +356,6 @@ libitm_version_info = -version-info $(libtool_VERSION)
- # Force link with C, not C++. For now, while we're using C++ we don't
- # 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_SOURCES = aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc \
- barrier.cc beginend.cc clone.cc eh_cpp.cc local.cc query.cc \
-@@ -473,7 +472,7 @@ clean-toolexeclibLTLIBRARIES:
- rm -f "$${dir}/so_locations"; \
- done
- libitm.la: $(libitm_la_OBJECTS) $(libitm_la_DEPENDENCIES) $(EXTRA_libitm_la_DEPENDENCIES)
-- $(libitm_la_LINK) -rpath $(toolexeclibdir) $(libitm_la_OBJECTS) $(libitm_la_LIBADD) $(LIBS)
-+ $(CXXLINK) $(libitm_la_LDFLAGS) -rpath $(toolexeclibdir) $(libitm_la_OBJECTS) $(libitm_la_LIBADD) $(LIBS)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-diff --git a/libitm/alloc_cpp.cc b/libitm/alloc_cpp.cc
-index 1d52e89..9722a0b 100644
---- a/libitm/alloc_cpp.cc
-+++ b/libitm/alloc_cpp.cc
-@@ -50,24 +50,30 @@ using namespace GTM;
- /* Everything from libstdc++ is weak, to avoid requiring that library
- to be linked into plain C applications using libitm.so. */
-
-+#if defined(__CYGWIN__) && defined(PIC)
-+#define WEAK
-+#else
-+#define WEAK __attribute__((weak))
-+#endif
-+
- extern "C" {
-
--extern void *_ZnwX (size_t) __attribute__((weak));
--extern void _ZdlPv (void *) __attribute__((weak));
--extern void _ZdlPvX (void *, size_t) __attribute__((weak));
--extern void *_ZnaX (size_t) __attribute__((weak));
--extern void _ZdaPv (void *) __attribute__((weak));
-+extern void *_ZnwX (size_t) WEAK;
-+extern void _ZdlPv (void *) WEAK;
-+extern void _ZdlPvX (void *, size_t) WEAK;
-+extern void *_ZnaX (size_t) WEAK;
-+extern void _ZdaPv (void *) WEAK;
-
- typedef const struct nothrow_t { } *c_nothrow_p;
-
--extern void *_ZnwXRKSt9nothrow_t (size_t, c_nothrow_p) __attribute__((weak));
--extern void _ZdlPvRKSt9nothrow_t (void *, c_nothrow_p) __attribute__((weak));
-+extern void *_ZnwXRKSt9nothrow_t (size_t, c_nothrow_p) WEAK;
-+extern void _ZdlPvRKSt9nothrow_t (void *, c_nothrow_p) WEAK;
- extern void _ZdlPvXRKSt9nothrow_t
--(void *, size_t, c_nothrow_p) __attribute__((weak));
--extern void *_ZnaXRKSt9nothrow_t (size_t, c_nothrow_p) __attribute__((weak));
--extern void _ZdaPvRKSt9nothrow_t (void *, c_nothrow_p) __attribute__((weak));
-+(void *, size_t, c_nothrow_p) WEAK;
-+extern void *_ZnaXRKSt9nothrow_t (size_t, c_nothrow_p) WEAK;
-+extern void _ZdaPvRKSt9nothrow_t (void *, c_nothrow_p) WEAK;
-
--#if !defined (HAVE_ELF_STYLE_WEAKREF)
-+#if !defined (HAVE_ELF_STYLE_WEAKREF) && !defined(PIC)
- void *_ZnwX (size_t) { return NULL; }
- void _ZdlPv (void *) { return; }
- void _ZdlPvX (void *, size_t) { return; }
-diff --git a/libitm/beginend.cc b/libitm/beginend.cc
-index 20b5547..3e19441 100644
---- a/libitm/beginend.cc
-+++ b/libitm/beginend.cc
-@@ -25,6 +25,24 @@
- #include "libitm_i.h"
- #include <pthread.h>
-
-+#if defined(__CYGWIN__) && defined(PIC)
-+#define WEAK
-+#else
-+#define WEAK __attribute__((weak))
-+#endif
-+
-+/* Everything from libgcc_s is weak, to avoid requiring that library
-+ to be linked into plain C applications using libitm.so. */
-+
-+extern "C" {
-+
-+extern void _Unwind_DeleteException (_Unwind_Exception*) WEAK;
-+
-+#if !defined (HAVE_ELF_STYLE_WEAKREF) && !defined(PIC)
-+void _Unwind_DeleteException (_Unwind_Exception *) { return; }
-+#endif /* HAVE_ELF_STYLE_WEAKREF */
-+
-+}
-
- using namespace GTM;
-
-diff --git a/libitm/configure.tgt b/libitm/configure.tgt
-index e84382f..8dbe036 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* | *-*-dragonfly*)
-+ | *-*-darwin* | *-*-aix* | *-*-dragonfly* | *-*-cygwin*)
- # POSIX system. The OS is supported.
- ;;
-
-diff --git a/libitm/eh_cpp.cc b/libitm/eh_cpp.cc
-index a6c06b5..a4ba223 100644
---- a/libitm/eh_cpp.cc
-+++ b/libitm/eh_cpp.cc
-@@ -77,7 +77,11 @@ using namespace GTM;
- /* Everything from libstdc++ is weak, to avoid requiring that library
- to be linked into plain C applications using libitm.so. */
-
-+#if defined(__CYGWIN__) && defined(PIC)
-+#define WEAK
-+#else
- #define WEAK __attribute__((weak))
-+#endif
-
- extern "C" {
-
-@@ -95,14 +99,13 @@ extern void __cxa_end_catch (void) WEAK;
- extern void __cxa_tm_cleanup (void *, void *, unsigned int) WEAK;
- extern __cxa_eh_globals *__cxa_get_globals (void) WEAK;
-
--#if !defined (HAVE_ELF_STYLE_WEAKREF)
-+#if !defined (HAVE_ELF_STYLE_WEAKREF) && !defined(PIC)
- void *__cxa_allocate_exception (size_t) { return NULL; }
- void __cxa_free_exception (void *) { return; }
- void __cxa_throw (void *, void *, void *) { return; }
- void *__cxa_begin_catch (void *) { return NULL; }
- void __cxa_end_catch (void) { return; }
- void __cxa_tm_cleanup (void *, void *, unsigned int) { return; }
--void _Unwind_DeleteException (_Unwind_Exception *) { return; }
- __cxa_eh_globals *__cxa_get_globals (void) { return NULL; }
- #endif /* HAVE_ELF_STYLE_WEAKREF */
-
-@@ -176,9 +179,10 @@ _ITM_cxa_end_catch (void)
- void
- GTM::gtm_thread::init_cpp_exceptions ()
- {
-+ __cxa_eh_globals *(*__cxa_get_globals_ptr)() = &__cxa_get_globals;
- // Only save and restore the number of uncaught exceptions if this is
- // actually used in the program.
-- if (__cxa_get_globals != NULL && __cxa_get_globals () != 0)
-+ if (__cxa_get_globals_ptr != NULL && __cxa_get_globals () != 0)
- cxa_uncaught_count_ptr = &__cxa_get_globals ()->uncaughtExceptions;
- else
- cxa_uncaught_count_ptr = 0;
-diff --git a/libitm/libitm_i.h b/libitm/libitm_i.h
-index a8cff57..52d2069 100644
---- a/libitm/libitm_i.h
-+++ b/libitm/libitm_i.h
-@@ -37,11 +37,6 @@
- #include <string.h>
- #include <unwind.h>
- #include "local_atomic"
--
--/* Don't require libgcc_s.so for exceptions. */
--extern void _Unwind_DeleteException (_Unwind_Exception*) __attribute__((weak));
--
--
- #include "common.h"
-
- namespace GTM HIDDEN {
-diff --git a/libitm/method-serial.cc b/libitm/method-serial.cc
-index a151b66..3f47f58 100644
---- a/libitm/method-serial.cc
-+++ b/libitm/method-serial.cc
-@@ -24,12 +24,14 @@
-
- #include "libitm_i.h"
-
-+#if 0 // !defined(__CYGWIN__) || !defined(PIC)
- // Avoid a dependency on libstdc++ for the pure virtuals in abi_dispatch.
- extern "C" void HIDDEN
- __cxa_pure_virtual ()
- {
- abort ();
- }
-+#endif
-
- using namespace GTM;
-
diff --git a/0028-g++-time.patch b/0028-g++-time.patch
index 50299d8..9dd3107 100644
--- a/0028-g++-time.patch
+++ b/0028-g++-time.patch
@@ -1,7 +1,7 @@
This was just a bit outdated...
---- origsrc/gcc-5.3.0/libstdc++-v3/acinclude.m4 2015-11-24 07:25:07.000000000 -0600
-+++ src/gcc-5.3.0/libstdc++-v3/acinclude.m4 2016-04-01 00:21:40.077426000 -0500
+--- a/libstdc++-v3/acinclude.m4 2015-11-24 07:25:07.000000000 -0600
++++ b/libstdc++-v3/acinclude.m4 2016-04-01 00:21:40.077426000 -0500
@@ -1196,7 +1196,10 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME]
case "${target_os}" in
@@ -13,8 +13,8 @@ This was just a bit outdated...
;;
darwin*)
ac_has_nanosleep=yes
---- origsrc/gcc-5.3.0/libstdc++-v3/configure 2016-03-31 21:24:38.558164300 -0500
-+++ src/gcc-5.3.0/libstdc++-v3/configure 2016-04-01 00:26:14.110723800 -0500
+--- a/libstdc++-v3/configure 2016-03-31 21:24:38.558164300 -0500
++++ b/libstdc++-v3/configure 2016-04-01 00:26:14.110723800 -0500
@@ -19632,7 +19632,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
case "${target_os}" in
diff --git a/0030-newlib-ftm.patch b/0030-newlib-ftm.patch
index 773813a..804957a 100644
--- a/0030-newlib-ftm.patch
+++ b/0030-newlib-ftm.patch
@@ -1,5 +1,5 @@
---- origsrc/gcc-6.4.0/gcc/glimits.h 2016-01-04 08:30:50.652828000 -0600
-+++ src/gcc-6.4.0/gcc/glimits.h 2017-11-13 18:46:28.887539100 -0600
+--- a/gcc/glimits.h 2016-01-04 08:30:50.652828000 -0600
++++ b/gcc/glimits.h 2017-11-13 18:46:28.887539100 -0600
@@ -111,7 +111,7 @@
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
#endif
diff --git a/0031-define_std-unix.patch b/0031-define_std-unix.patch
index d2b6961..1d2c20f 100644
--- a/0031-define_std-unix.patch
+++ b/0031-define_std-unix.patch
@@ -1,5 +1,5 @@
---- origsrc/gcc-6.4.0/gcc/config/i386/cygwin.h 2017-11-03 00:47:46.634665300 -0500
-+++ src/gcc-6.4.0/gcc/config/i386/cygwin.h 2018-01-15 16:36:17.677500200 -0600
+--- a/gcc/config/i386/cygwin.h 2017-11-03 00:47:46.634665300 -0500
++++ b/gcc/config/i386/cygwin.h 2018-01-15 16:36:17.677500200 -0600
@@ -24,14 +24,12 @@
builtin_define ("__CYGWIN__"); \
if (!TARGET_64BIT) \
diff --git a/0032-libstdc-use-lt_host_flags-for-libstdc-.la.patch b/0032-libstdc-use-lt_host_flags-for-libstdc-.la.patch
new file mode 100644
index 0000000..6884247
--- /dev/null
+++ b/0032-libstdc-use-lt_host_flags-for-libstdc-.la.patch
@@ -0,0 +1,26 @@
+From 12c2962dd64b191bb3b6f335ca0e57fdfb003cc7 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sun, 22 Mar 2020 09:56:58 +0800
+Subject: [PATCH 32/35] libstdc++: use lt_host_flags for libstdc++.la
+
+Signed-off-by: Jonathan Yong <10walls@gmail.com>
+---
+ libstdc++-v3/src/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
+index 8511a30..fee5aaf 100644
+--- a/libstdc++-v3/src/Makefile.am
++++ b/libstdc++-v3/src/Makefile.am
+@@ -107,7 +107,7 @@ libstdc___la_DEPENDENCIES = \
+ libstdc___la_LDFLAGS = \
+ -version-info $(libtool_VERSION) ${version_arg} -lm
+
+-libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
++libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags)
+
+ # Use special rules for compatibility-ldbl.cc compilation, as we need to
+ # pass -mlong-double-64.
+--
+2.21.0
+
diff --git a/0033-libstdc-regenerate-src-Makefile.in-for-lt_host_flags.patch b/0033-libstdc-regenerate-src-Makefile.in-for-lt_host_flags.patch
new file mode 100644
index 0000000..bb72e63
--- /dev/null
+++ b/0033-libstdc-regenerate-src-Makefile.in-for-lt_host_flags.patch
@@ -0,0 +1,26 @@
+From 4a79d7008671991fc142b5fecffc32efbaf06728 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sun, 22 Mar 2020 09:57:42 +0800
+Subject: [PATCH 33/35] libstdc++: regenerate src/Makefile.in for lt_host_flags
+
+Signed-off-by: Jonathan Yong <10walls@gmail.com>
+---
+ libstdc++-v3/src/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
+index d91f715..9115d97 100644
+--- a/libstdc++-v3/src/Makefile.in
++++ b/libstdc++-v3/src/Makefile.in
+@@ -515,7 +515,7 @@ libstdc___la_DEPENDENCIES = \
+ libstdc___la_LDFLAGS = \
+ -version-info $(libtool_VERSION) ${version_arg} -lm
+
+-libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
++libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags)
+
+ # A note on compatibility and static libraries.
+ #
+--
+2.21.0
+
diff --git a/0034-libstdc-use-a-link-test-to-test-for-Wl-z-relro.patch b/0034-libstdc-use-a-link-test-to-test-for-Wl-z-relro.patch
new file mode 100644
index 0000000..c81923c
--- /dev/null
+++ b/0034-libstdc-use-a-link-test-to-test-for-Wl-z-relro.patch
@@ -0,0 +1,38 @@
+From 5d7541c13423bfc7457400dd9b48c92ec46dac96 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sun, 22 Mar 2020 09:59:37 +0800
+Subject: [PATCH 34/35] libstdc++: use a link test to test for -Wl,-z,relro
+
+Do a link test instead of just a grep. The linker can
+support multiple targets, but not all targets can use it.
+
+Signed-off-by: Jonathan Yong <10walls@gmail.com>
+---
+ libstdc++-v3/acinclude.m4 | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 192ecab..d5e0e5e 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -274,7 +274,16 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
+ ac_ld_relro=no
+ if test x"$with_gnu_ld" = x"yes"; then
+ AC_MSG_CHECKING([for ld that supports -Wl,-z,relro])
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ AC_LINK_IFELSE([
++ AC_LANG_SOURCE(
++ [[int main() { return 0; }]]
++ )],
++ [cxx_z_relo="1"],
++ [cxx_z_relo=""])
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+--
+2.21.0
+
diff --git a/0035-libstdc-regenerate-configure.patch b/0035-libstdc-regenerate-configure.patch
new file mode 100644
index 0000000..1d66bc3
--- /dev/null
+++ b/0035-libstdc-regenerate-configure.patch
@@ -0,0 +1,455 @@
+From 66212278341c9defdc4a194d706908fcb593d6b4 Mon Sep 17 00:00:00 2001
+From: Jonathan Yong <10walls@gmail.com>
+Date: Sun, 22 Mar 2020 10:03:10 +0800
+Subject: [PATCH 35/35] libstdc++: regenerate configure
+
+Signed-off-by: Jonathan Yong <10walls@gmail.com>
+---
+ libstdc++-v3/configure | 263 +++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 242 insertions(+), 21 deletions(-)
+
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index b3ddad9..bb4f0ea 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -871,6 +871,7 @@ infodir
+ docdir
+ oldincludedir
+ includedir
++runstatedir
+ localstatedir
+ sharedstatedir
+ sysconfdir
+@@ -996,6 +997,7 @@ datadir='${datarootdir}'
+ sysconfdir='${prefix}/etc'
+ sharedstatedir='${prefix}/com'
+ localstatedir='${prefix}/var'
++runstatedir='${localstatedir}/run'
+ includedir='${prefix}/include'
+ oldincludedir='/usr/include'
+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+@@ -1248,6 +1250,15 @@ do
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
++ -runstatedir | --runstatedir | --runstatedi | --runstated \
++ | --runstate | --runstat | --runsta | --runst | --runs \
++ | --run | --ru | --r)
++ ac_prev=runstatedir ;;
++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
++ | --run=* | --ru=* | --r=*)
++ runstatedir=$ac_optarg ;;
++
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+@@ -1385,7 +1396,7 @@ fi
+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+- libdir localedir mandir
++ libdir localedir mandir runstatedir
+ do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+@@ -1538,6 +1549,7 @@ Fine tuning of the installation directories:
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+@@ -12048,7 +12060,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12051 "configure"
++#line 12063 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -12154,7 +12166,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12157 "configure"
++#line 12169 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -15840,7 +15852,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
+ # Fake what AC_TRY_COMPILE does.
+
+ cat > conftest.$ac_ext << EOF
+-#line 15843 "configure"
++#line 15855 "configure"
+ int main()
+ {
+ typedef bool atomic_type;
+@@ -15875,7 +15887,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 15878 "configure"
++#line 15890 "configure"
+ int main()
+ {
+ typedef short atomic_type;
+@@ -15910,7 +15922,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 15913 "configure"
++#line 15925 "configure"
+ int main()
+ {
+ // NB: _Atomic_word not necessarily int.
+@@ -15946,7 +15958,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 15949 "configure"
++#line 15961 "configure"
+ int main()
+ {
+ typedef long long atomic_type;
+@@ -16099,7 +16111,7 @@ $as_echo "mutex" >&6; }
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+-#line 16102 "configure"
++#line 16114 "configure"
+ int main()
+ {
+ _Decimal32 d1;
+@@ -16141,7 +16153,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+-#line 16144 "configure"
++#line 16156 "configure"
+ template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+@@ -16175,7 +16187,7 @@ $as_echo "$enable_int128" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 16178 "configure"
++#line 16190 "configure"
+ template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+@@ -22611,7 +22623,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -29778,7 +29809,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -35756,7 +35806,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -41868,7 +41937,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -53775,7 +53863,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -54040,7 +54147,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -54507,7 +54633,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -60875,7 +61020,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -66806,7 +66970,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -67007,7 +67190,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+@@ -67227,7 +67429,26 @@ $as_echo "$ac_gcsections" >&6; }
+ if test x"$with_gnu_ld" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-z,relro" >&5
+ $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
+- cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
++ ac_save_ldflags="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -Wl,-z,relro"
++ if test x$gcc_no_link = xyes; then
++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
++fi
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++ int main() { return 0; }
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ cxx_z_relo="1"
++else
++ cxx_z_relo=""
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$ac_save_ldflags"
++
+ if test -n "$cxx_z_relo"; then
+ OPT_LDFLAGS="-Wl,-z,relro"
+ ac_ld_relro=yes
+--
+2.21.0
+
diff --git a/1000-cross-exe-suffix.patch b/1000-cross-exe-suffix.patch
deleted file mode 100644
index 6fbddf8..0000000
--- a/1000-cross-exe-suffix.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/gcc/gcc.c 2011-08-14 14:15:46.614869280 -0500
-+++ b/gcc/gcc.c 2011-08-14 14:16:05.757302186 -0500
-@@ -98,6 +98,5 @@ compilation is specified by a string cal
-
- /* By default there is no special suffix for target executables. */
--/* FIXME: when autoconf is fixed, remove the host check - dj */
--#if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX)
-+#if defined(TARGET_EXECUTABLE_SUFFIX)
- #define HAVE_TARGET_EXECUTABLE_SUFFIX
- #endif
diff --git a/cygwin-gcc.spec b/cygwin-gcc.spec
index 83dfa98..3f0a253 100644
--- a/cygwin-gcc.spec
+++ b/cygwin-gcc.spec
@@ -1,9 +1,9 @@
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
-%global gcc_version 7.4.0
+%global gcc_version 9.3.0
# 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 2
+%global gcc_release 1
Name: cygwin-gcc
Version: %{gcc_version}
@@ -20,19 +20,17 @@ BuildRequires: cygwin32-filesystem
BuildRequires: cygwin32-binutils
BuildRequires: cygwin32-w32api-headers
BuildRequires: cygwin32-w32api-runtime
-BuildRequires: cygwin32 >= 2.10.0
+BuildRequires: cygwin32 >= 3.0.0
BuildRequires: cygwin64-filesystem
BuildRequires: cygwin64-binutils
BuildRequires: cygwin64-w32api-headers
BuildRequires: cygwin64-w32api-runtime
-BuildRequires: cygwin64 >= 2.10.0
+BuildRequires: cygwin64 >= 3.0.0
BuildRequires: gmp-devel
BuildRequires: mpfr-devel
BuildRequires: libmpc-devel
-%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: libstdc++-static
-%endif
-%if 0%{?fedora}
+%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: isl-devel >= 0.14
%endif
BuildRequires: zlib-devel
@@ -42,35 +40,29 @@ BuildRequires: gettext
Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.xz
# Cygwin patches
-Patch1: 0001-share-mingw-fset-stack-executable-with-cygwin.patch
-#Patch2: 0002-boehm-gc-for-cygwin.patch
Patch7: 0007-Avoid-installing-libffi-V2.patch
-#Patch8: 0008-libitm-libtool-fixes-for-Cygwin.patch
-Patch9: 0009-Cygwin-uses-sysv-ABI-on-x86_64-V2.patch
Patch10: 0010-Do-not-version-lto-plugin-on-cygwin-mingw.patch
Patch11: 0011-add-dummy-pthread-tsaware-and-large-address-aware-fo.patch
Patch12: 0012-handle-dllimport-properly-in-medium-model-V2.patch
Patch13: 0013-skip-test-for-cygwin-mingw.patch
-Patch14: 0014-64bit-Cygwin-uses-SEH.patch
-Patch15: 0015-define-RTS_CONTROL_ENABLE-and-DTR_CONTROL_ENABLE-for.patch
Patch16: 0016-fix-some-implicit-declaration-warnings.patch
Patch17: 0017-__cxa-atexit-for-Cygwin.patch
-Patch18: 0018-prevent-modules-from-being-unloaded-before-their-dto.patch
-Patch20: 0020-cygwin-uses-cyg-lib-prefix-v3.patch
Patch22: 0022-libgomp-soname-cygwin-mingw.patch
#Patch23: 0023-glibcxx-use-c99.patch
-Patch24: 0024-libitm-weak-symbols.patch
#Patch26: 0026-g++-gnu-source.patch
Patch28: 0028-g++-time.patch
Patch30: 0030-newlib-ftm.patch
Patch31: 0031-define_std-unix.patch
+Patch32: 0032-libstdc-use-lt_host_flags-for-libstdc-.la.patch
+Patch33: 0033-libstdc-regenerate-src-Makefile.in-for-lt_host_flags.patch
+Patch34: 0034-libstdc-use-a-link-test-to-test-for-Wl-z-relro.patch
+Patch35: 0035-libstdc-regenerate-configure.patch
# Fedora-specific patches
-Patch1000: 1000-cross-exe-suffix.patch
Patch1001: 1001-textdomain.patch
# Upstream patches
-Patch2001: pr47030.patch
+#Patch2001: pr47030.patch
%description
Cygwin cross-compiler (GCC) suite.
@@ -91,7 +83,7 @@ Requires: cygwin32-filesystem
Requires: cygwin32-binutils
Requires: cygwin32-default-manifest
Requires: cygwin32-w32api-runtime
-Requires: cygwin32 >= 2.10.0
+Requires: cygwin32 >= 3.0.0
Requires: cygwin32-cpp = %{version}-%{release}
# We don't run the automatic dependency scripts which would
# normally detect and provide the following DLL:
@@ -138,7 +130,7 @@ Group: Development/Languages
Requires: cygwin32-gcc = %{version}-%{release}
# We don't run the automatic dependency scripts which would
# normally detect and provide the following DLL:
-Provides: cygwin32(cyggfortran-4.dll)
+Provides: cygwin32(cyggfortran-5.dll)
%description -n cygwin32-gcc-gfortran
Cygwin cross-compiler for FORTRAN.
@@ -152,7 +144,7 @@ Requires: cygwin64-filesystem
Requires: cygwin64-binutils
Requires: cygwin64-default-manifest
Requires: cygwin64-w32api-runtime
-Requires: cygwin64 >= 2.10.0
+Requires: cygwin64 >= 3.0.0
Requires: cygwin64-cpp = %{version}-%{release}
# We don't run the automatic dependency scripts which would
# normally detect and provide the following DLLs:
@@ -196,41 +188,14 @@ 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-4.dll)
+Provides: cygwin64(cyggfortran-5.dll)
%description -n cygwin64-gcc-gfortran
Cygwin x86_64 cross-compiler for FORTRAN.
%prep
-%setup -q -n gcc-%{gcc_version}
-%patch1 -p1
-#patch2 -p1
-%patch7 -p1
-#patch8 -p1
-%patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-%patch15 -p1
-%patch16 -p1
-%patch17 -p1
-%patch18 -p1
-%patch20 -p1
-%patch22 -p1
-#patch23 -p2
-%patch24 -p1
-#patch26 -p2
-%patch28 -p2
-%patch30 -p2
-%patch31 -p2
-
-%patch1000 -p1
-%patch1001 -p1
-
-%patch2001 -p2
+%autosetup -n gcc-%{gcc_version} -p1
echo %{gcc_version} > gcc/BASE-VER
echo 'Fedora Cygwin %{gcc_version}-%{gcc_release}' > gcc/DEV-PHASE
@@ -276,7 +241,6 @@ CC="%{__cc} ${RPM_OPT_FLAGS}" \
--disable-symvers \
--enable-libatomic \
--enable-libgomp \
- --enable-libitm \
--disable-libssp \
--enable-libquadmath --enable-libquadmath-support \
--enable-libstdcxx-filesystem-ts \
@@ -317,7 +281,6 @@ CC="%{__cc} ${RPM_OPT_FLAGS}" \
--disable-symvers \
--enable-libatomic \
--enable-libgomp \
- --enable-libitm \
--disable-libssp \
--enable-libquadmath --enable-libquadmath-support \
--enable-libstdcxx-filesystem-ts \
@@ -416,8 +379,6 @@ cat cygwin-cpplib.lang >> cygwin-gcc.lang
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/libgomp.a
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/libgomp.dll.a
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/libgomp.spec
-%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/libitm.a
-%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/libitm.spec
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/libquadmath.a
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/libquadmath.dll.a
%dir %{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/include
@@ -475,7 +436,7 @@ cat cygwin-cpplib.lang >> cygwin-gcc.lang
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/finclude/ieee_*
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/finclude/omp_lib*
%{_prefix}/lib/gcc/%{cygwin32_target}/%{version}/finclude/openacc*
-%{cygwin32_bindir}/cyggfortran-4.dll
+%{cygwin32_bindir}/cyggfortran-5.dll
%files -n cygwin64-gcc
@@ -506,8 +467,6 @@ cat cygwin-cpplib.lang >> cygwin-gcc.lang
%{_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}/libitm.a
-%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libitm.spec
%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libquadmath.a
%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/libquadmath.dll.a
%dir %{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/include
@@ -565,12 +524,12 @@ cat cygwin-cpplib.lang >> cygwin-gcc.lang
%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/finclude/ieee_*
%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/finclude/omp_lib*
%{_prefix}/lib/gcc/%{cygwin64_target}/%{version}/finclude/openacc*
-%{cygwin64_bindir}/cyggfortran-4.dll
+%{cygwin64_bindir}/cyggfortran-5.dll
%changelog
-* Wed Apr 01 2020 Yaakov Selkowitz <yselkowi@redhat.com> - 7.4.0-2
-- Rebuilt for Fedora 32
+* Wed Apr 01 2020 Yaakov Selkowitz <yselkowi@redhat.com> - 9.3.0-1
+- new version
* Sun Dec 30 2018 Yaakov Selkowitz <yselkowi@redhat.com> - 7.4.0-1
- new version
diff --git a/sources b/sources
index 0940243..611c3fe 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6e9d754638ff03d2e9b2aff55aed82b4 gcc-7.4.0.tar.xz
+SHA512 (gcc-9.3.0.tar.xz) = 4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de