From f9b41461c03b30c9e4fe8d20606a7c22bfed0ec1 Mon Sep 17 00:00:00 2001 From: ludwig Date: Fri, 6 Jan 2006 19:11:05 +0000 Subject: make memory for generated opcodes executable so the program works with enabled NX feature. git-svn-id: svn://svn.icculus.org/quake3/trunk@466 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/vm_x86_64.c | 5 ++--- code/unix/Makefile | 7 ------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/code/qcommon/vm_x86_64.c b/code/qcommon/vm_x86_64.c index f90b7ff..2111f4e 100644 --- a/code/qcommon/vm_x86_64.c +++ b/code/qcommon/vm_x86_64.c @@ -385,12 +385,11 @@ static int doas(char* in, char* out, unsigned char** compiledcode) if((*compiledcode = (unsigned char*)buf)) { -#ifdef VM_X86_64_STANDALONE // no idea why - if(mprotect(buf, allocsize, PROT_READ|PROT_EXEC) == -1) + // need to be able to exec code + if(mprotect(buf, allocsize, PROT_READ|PROT_WRITE|PROT_EXEC) == -1) { Com_Error(ERR_FATAL, "mprotect failed on %p+%x: %s\n", buf, allocsize, strerror(errno)); } -#endif return size; } diff --git a/code/unix/Makefile b/code/unix/Makefile index d196661..4c4a42d 100644 --- a/code/unix/Makefile +++ b/code/unix/Makefile @@ -870,13 +870,6 @@ ifeq ($(ARCH),x86) endif ifeq ($(ARCH),x86_64) Q3OBJ += $(B)/client/vm_x86_64.o - - #FIXME: why do these need to be here? - Q3OBJ += \ - $(B)/client/snd_mixa.o \ - $(B)/client/matha.o \ - $(B)/client/ftola.o \ - $(B)/client/snapvectora.o endif ifeq ($(ARCH),ppc) -- cgit v1.2.3