summaryrefslogtreecommitdiffstats
path: root/gcc47-execstack.patch
blob: abfe82839f1a6c76396fcb34988ab703d442b845 (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
--- 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
@@ -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
 
--- 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,11 @@ along with GCC; see the file COPYING3.
 /* We should find a way to not have to update this manually.  */
 #define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-13.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
+
+#ifdef IN_LIBGCC2
+#include <windows.h>
+#endif
--- 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
@@ -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.
--- 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
 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;
   ;;