Share mingw fset-stack-executable with cygwin
authorJonathan Yong <10walls@gmail.com>
Mon, 7 Aug 2017 11:40:08 +0000 (11:40 +0000)
committerJonathan Yong <jyong@gcc.gnu.org>
Mon, 7 Aug 2017 11:40:08 +0000 (11:40 +0000)
This patch is in use by Cygwin for years, upstream to GCC.

* gcc/config/i386/mingw.opt (fset-stack-executable): Removed.
* gcc/config/i386/cygming.opt (fset-stack-executable): Moved
from mingw.opt.
* gcc/config/i386/cygwin.h: Define CHECK_EXECUTE_STACK_ENABLED.
* ligcc/config.host (*-cygwin): Include file from mingw
config/i386/enable-execute-stack-mingw32.c

From-SVN: r250914

gcc/ChangeLog
gcc/config/i386/cygming.opt
gcc/config/i386/cygwin.h
gcc/config/i386/mingw.opt
libgcc/ChangeLog
libgcc/config.host

index 1b6c5ff31a17a8e4e5ea05ae1edcaef5a486f332..440f6dac03b0bd065dc2d4e103cb09131aaa2f72 100644 (file)
@@ -1,3 +1,10 @@
+2017-08-07  Jonathan Yong  <10walls@gmail.com>
+
+       * config/i386/mingw.opt (fset-stack-executable): Removed.
+       * config/i386/cygming.opt (fset-stack-executable): Moved
+       from mingw.opt.
+       * config/i386/cygwin.h: Define CHECK_EXECUTE_STACK_ENABLED.
+
 2017-08-07  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * print-rtl.c (print_exp): Print NOT as "~" instead of as "!".
index 2d7c7d2b674963d174ce201a25de836f7ed3f378..abe59321040712573b4cc92440232012252bbdb3 100644 (file)
@@ -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
 
index a4683b4662e7fae94f8122a92d41dd7b35cfdde2..7e34bb799c336893df5edd4a28b4abd3ea208bfb 100644 (file)
@@ -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
index 210c14f549eb02452904d1b9b419f054d147ef78..97a9baa6d7a4f0b5857e571b9fabb9869fee42c1 100644 (file)
@@ -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.
index 14aed0b495ed2f0799db3a10dd63c8afad6a00af..14d20fbfac8a00c52dd71043da767c1da851c7ba 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-07  Jonathan Yong  <10walls@gmail.com>
+
+       * config.host (*-cygwin): Include file from mingw
+       config/i386/enable-execute-stack-mingw32.c
+
 2017-08-01  Jerome Lambourg  <lambourg@adacore.com>
             Doug Rupp  <rupp@adacore.com>
             Olivier Hainque  <hainque@adacore.com>
index 9556c77cddebf85a85ee06368a98148411ab5691..546b12b59713d97f4b72bef8043f14ea9ee3f02b 100644 (file)
@@ -324,6 +324,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;
   ;;