$OpenBSD: patch-gcc_config_i386_openbsd_h,v 1.8 2004/01/31 15:23:58 espie Exp $
--- gcc/config/i386/openbsd.h.orig	2002-10-21 00:37:10.000000000 +0200
+++ gcc/config/i386/openbsd.h	2003-11-11 15:33:52.000000000 +0100
@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
+    	OPENBSD_OS_CPP_BUILTINS_COMMON();	\
 	builtin_define ("__unix__");		\
 	builtin_define ("__OpenBSD__");		\
 	builtin_assert ("system=unix");		\
@@ -101,3 +102,19 @@ Boston, MA 02111-1307, USA.  */
 
 /* OpenBSD gas currently does not support quad, so do not use it.  */
 #undef ASM_QUAD
+
+#define TRANSFER_FROM_TRAMPOLINE					\
+extern void __enable_execute_stack (void *);				\
+void									\
+__enable_execute_stack (addr)						\
+     void *addr;							\
+{									\
+  long size = getpagesize ();						\
+  long mask = ~(size-1);						\
+  char *page = (char *) (((long) addr) & mask); 			\
+  char *end  = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+								      \
+  /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ 			\
+  if (mprotect (page, end - page, 7) < 0)				\
+    perror ("mprotect of trampoline code");				\
+}
