MSYS2-packages/gcc/0001-share-mingw-fset-stack-executable-with-cygwin.patch
JPeterMugaas aa64260bff GCC 7.3.0 - https://gcc.gnu.org/gcc-7/
Rekeyed patches for MSYS2
Use Cygwin patches for 7.3.0

Note that this drops gcj, libjava, classlib, and bohem-gcc.
2018-04-16 14:09:52 -04:00

70 lines
2.4 KiB
Diff

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
@@ -156,3 +156,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*/ "-16.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