summaryrefslogtreecommitdiffstats
path: root/0001-share-mingw-fset-stack-executable-with-cygwin.patch
blob: ae86c1a71489dcea792d76801c1d928cf54f6d6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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