This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Let gcc bootstrap again on OpenBSD


> + /* Stack is explicitly denied execution rights on OpenBSD platforms.  */
> + #define ENABLE_EXECUTE_STACK						\
> + 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); \ + 								      \
> +   if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) <
> 0) \ +     perror ("mprotect of trampoline code");				\
> + }

Use ISO C prototypes on mainline and 3.4 branch.

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]