--- configure.ac (revision 14) +++ configure.ac (local) @@ -188,6 +188,7 @@ AC_CHECK_HEADERS(\ linux/joystick.h \ linux/major.h \ linux/param.h \ + linux/personality.h \ linux/serial.h \ linux/ucdrom.h \ machine/cpu.h \ --- libs/wine/loader.c (revision 14) +++ libs/wine/loader.c (local) @@ -41,6 +41,11 @@ #include "winbase.h" #include "wine/library.h" +#ifdef HAVE_LINUX_PERSONALITY_H +#include +#include +#endif + #ifdef __APPLE__ #include #define environ (*_NSGetEnviron()) @@ -515,6 +520,22 @@ static void debug_usage(void) /*********************************************************************** + * linux_personality_init + * + * Sets the "please unbreak me" mmap flag to disable things like + * flex-mmap. Note that this will also disable exec-shield + * randomization for any ELF DLLs loaded after this point but the + * initial libraries (libc etc) linked in automatically will be + * randomized. + */ +static void linux_personality_init(void) +{ +#if defined(HAVE_LINUX_PERSONALITY_H) && defined(__i386__) + syscall(SYS_personality, PER_LINUX32 | 0x0200000 /* ADDR_COMPAT_LAYOUT */); +#endif +} + +/*********************************************************************** * wine_init * * Main Wine initialisation. @@ -526,6 +547,7 @@ void wine_init( int argc, char *argv[], void *ntdll; void (*init_func)(void); + linux_personality_init(); build_dll_path(); wine_init_argv0_path( argv[0] ); __wine_main_argc = argc;