diff -Naur gcc-4.9.2-orig/gcc/config/i386/cygming.opt gcc-4.9.2/gcc/config/i386/cygming.opt --- gcc-4.9.2-orig/gcc/config/i386/cygming.opt 2014-01-03 01:23:26.000000000 +0300 +++ gcc-4.9.2/gcc/config/i386/cygming.opt 2014-11-03 23:37:32.836600000 +0300 @@ -50,6 +50,10 @@ 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 -Naur gcc-4.9.2-orig/gcc/config/i386/cygwin.h gcc-4.9.2/gcc/config/i386/cygwin.h --- gcc-4.9.2-orig/gcc/config/i386/cygwin.h 2014-04-23 12:46:13.000000000 +0300 +++ gcc-4.9.2/gcc/config/i386/cygwin.h 2014-11-03 23:37:32.867800000 +0300 @@ -145,3 +145,7 @@ /* We should find a way to not have to update this manually. */ #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 diff -Naur gcc-4.9.2-orig/gcc/config/i386/mingw.opt gcc-4.9.2/gcc/config/i386/mingw.opt --- gcc-4.9.2-orig/gcc/config/i386/mingw.opt 2014-01-03 01:23:26.000000000 +0300 +++ gcc-4.9.2/gcc/config/i386/mingw.opt 2014-11-03 23:37:32.914600000 +0300 @@ -28,8 +28,4 @@ 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 -Naur gcc-4.9.2-orig/libgcc/config.host gcc-4.9.2/libgcc/config.host --- gcc-4.9.2-orig/libgcc/config.host 2014-03-27 18:40:31.000000000 +0300 +++ gcc-4.9.2/libgcc/config.host 2014-11-03 23:37:32.930200000 +0300 @@ -308,6 +308,9 @@ 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; ;;