On Sun, Mar 26, 2017 at 11:37:21AM +1100, Jonathan Gray wrote: > On Sat, Mar 25, 2017 at 06:51:32PM +0100, Hiltjo Posthuma wrote: > > On Sat, Mar 25, 2017 at 05:43:27PM +0200, Giannis Tsaraias wrote: > > > On Sat, Mar 25, 2017 at 03:24:26PM +0100, Benjamin Baier wrote: > > > > Patch to add wxneeded to dosbox. I got a application that otherwise > > > > crashes with the following dosbox error message. > > > > > > > > >Setting excute permission on the code cache has failed > > > > >Exit to error: DRC64:Unhandled memory reference > > > > > > > > > > I saw the W^X violation too and had to do this, but forgot to send the > > > diff. > > > FWIW, OK tsg@ if someone wants to commit. > > > > > > > Hey, > > > > I noticed it too while playing Mortal Kombat 1 :) > > > > Some other games (skiordi, stunts) don't crash. > > Instead of blindly setting USE_WXNEEDED, I'd prefer if someone who has > a case that triggers this can try disabling the various cpu core options > in configure.
As Hiltjo mentioned, there are calls to mprotect asking for both write and execute in ./src/cpu/core_dynrec/cache.h and ./src/cpu/core_dyn_x86/cache.h. Compiling with '--disable-dynamic-core', I tested a few executables on i386 and amd64 without managing to trigger a violation. Didn't notice any performance loss either. No need for wxneeded this way. '--disable-dynrec' is not enough, as I got a violation on i386 using it.