aboutsummaryrefslogtreecommitdiffstats
path: root/games/iourbanterror
diff options
context:
space:
mode:
authoralepulver <alepulver@FreeBSD.org>2008-03-05 02:17:45 +0800
committeralepulver <alepulver@FreeBSD.org>2008-03-05 02:17:45 +0800
commita8e38ad645da7ae2709ec851c75e69c3408b8c43 (patch)
treeb96ada896961f6b0c3dbc1babad62fa210acc725 /games/iourbanterror
parent5ed0073ee1fcd8f37565865af9b0157281d3d174 (diff)
downloadfreebsd-ports-gnome-a8e38ad645da7ae2709ec851c75e69c3408b8c43.tar.gz
freebsd-ports-gnome-a8e38ad645da7ae2709ec851c75e69c3408b8c43.tar.zst
freebsd-ports-gnome-a8e38ad645da7ae2709ec851c75e69c3408b8c43.zip
- Enable use of mmap() instead of malloc() in the x86 VM.
- Fix building the amd64 VM (MAP_ANONYMOUS -> MAP_ANON) [1]. Reported by: Dominic Fandrey <kamikaze@bsdforen.de> [1]
Diffstat (limited to 'games/iourbanterror')
-rw-r--r--games/iourbanterror/files/patch-Makefile36
-rw-r--r--games/iourbanterror/files/patch-code__qcommon__vm_x86.c20
-rw-r--r--games/iourbanterror/files/patch-code__qcommon__vm_x86_64.c11
3 files changed, 56 insertions, 11 deletions
diff --git a/games/iourbanterror/files/patch-Makefile b/games/iourbanterror/files/patch-Makefile
index 9cebe77b385d..1efcfda57fe6 100644
--- a/games/iourbanterror/files/patch-Makefile
+++ b/games/iourbanterror/files/patch-Makefile
@@ -1,5 +1,5 @@
---- Makefile.orig Sun Dec 16 18:09:18 2007
-+++ Makefile Sun Jan 27 15:36:33 2008
+--- Makefile.orig 2007-12-16 18:09:18.000000000 -0300
++++ Makefile 2008-02-28 11:39:45.000000000 -0300
@@ -27,16 +27,22 @@
endif
endif
@@ -170,7 +170,7 @@
- BASE_CFLAGS += -DNO_VM_COMPILED
+ ifeq ($(USE_SDL_AUDIO),1)
+ BASE_CFLAGS += -DUSE_SDL_SOUND=1
-+ endif
+ endif
+
+ ifeq ($(USE_SDL_VIDEO),1)
+ BASE_CFLAGS += -DUSE_SDL_VIDEO=1
@@ -183,7 +183,7 @@
+ RELEASE_CFLAGS+=-falign-loops=2 -falign-jumps=2 -falign-functions=2 \
+ -fstrength-reduce
+ endif
- endif
++ endif
+
+ ifneq ($(HAVE_VM_COMPILED),true)
+ BASE_CFLAGS += -DNO_VM_COMPILED
@@ -353,7 +353,21 @@
$(echo_cmd) "LD $@"
$(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \
$(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
-@@ -1248,7 +1274,7 @@
+@@ -1240,15 +1266,21 @@
+ ifeq ($(ARCH),x86)
+ Q3DOBJ += $(B)/ded/vm_x86.o
+ endif
++ ifeq ($(ARCH),amd64)
++ Q3DOBJ += $(B)/ded/vm_x86_64.o $(B)/client/vm_x86_64_assembler.o
++ endif
+ ifeq ($(ARCH),x86_64)
+ Q3DOBJ += $(B)/ded/vm_x86_64.o $(B)/client/vm_x86_64_assembler.o
+ endif
++ ifeq ($(ARCH),powerpc)
++ Q3DOBJ += $(B)/ded/vm_ppc.o
++ endif
+ ifeq ($(ARCH),ppc)
+ Q3DOBJ += $(B)/ded/vm_ppc.o
endif
endif
@@ -362,7 +376,7 @@
$(echo_cmd) "LD $@"
$(Q)$(CC) -o $@ $(Q3DOBJ) $(LDFLAGS)
-@@ -1287,7 +1313,7 @@
+@@ -1287,7 +1319,7 @@
Q3CGOBJ = $(Q3CGOBJ_) $(B)/baseq3/cgame/cg_syscalls.o
Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
@@ -371,7 +385,7 @@
$(echo_cmd) "LD $@"
$(Q)$(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
-@@ -1330,7 +1356,7 @@
+@@ -1330,7 +1362,7 @@
MPCGOBJ = $(MPCGOBJ_) $(B)/missionpack/cgame/cg_syscalls.o
MPCGVMOBJ = $(MPCGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm
@@ -380,7 +394,7 @@
$(echo_cmd) "LD $@"
$(Q)$(CC) $(SHLIBLDFLAGS) -o $@ $(MPCGOBJ)
-@@ -1382,7 +1408,7 @@
+@@ -1382,7 +1414,7 @@
Q3GOBJ = $(Q3GOBJ_) $(B)/baseq3/game/g_syscalls.o
Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
@@ -389,7 +403,7 @@
$(echo_cmd) "LD $@"
$(Q)$(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
-@@ -1432,7 +1458,7 @@
+@@ -1432,7 +1464,7 @@
MPGOBJ = $(MPGOBJ_) $(B)/missionpack/game/g_syscalls.o
MPGVMOBJ = $(MPGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm
@@ -398,7 +412,7 @@
$(echo_cmd) "LD $@"
$(Q)$(CC) $(SHLIBLDFLAGS) -o $@ $(MPGOBJ)
-@@ -1494,7 +1520,7 @@
+@@ -1494,7 +1526,7 @@
Q3UIOBJ = $(Q3UIOBJ_) $(B)/missionpack/ui/ui_syscalls.o
Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
@@ -407,7 +421,7 @@
$(echo_cmd) "LD $@"
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
-@@ -1521,7 +1547,7 @@
+@@ -1521,7 +1553,7 @@
MPUIOBJ = $(MPUIOBJ_) $(B)/missionpack/ui/ui_syscalls.o
MPUIVMOBJ = $(MPUIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
diff --git a/games/iourbanterror/files/patch-code__qcommon__vm_x86.c b/games/iourbanterror/files/patch-code__qcommon__vm_x86.c
new file mode 100644
index 000000000000..0614c97804e1
--- /dev/null
+++ b/games/iourbanterror/files/patch-code__qcommon__vm_x86.c
@@ -0,0 +1,20 @@
+--- ./code/qcommon/vm_x86.c.orig 2007-10-09 02:47:22.000000000 -0300
++++ ./code/qcommon/vm_x86.c 2008-03-04 10:45:08.000000000 -0300
+@@ -36,7 +36,7 @@
+
+ /* need this on NX enabled systems (i386 with PAE kernel or
+ * noexec32=on x86_64) */
+-#ifdef __linux__
++#ifdef __unix__
+ #define VM_X86_MMAP
+ #endif
+
+@@ -1081,7 +1081,7 @@
+ // copy to an exact size buffer on the hunk
+ vm->codeLength = compiledOfs;
+ #ifdef VM_X86_MMAP
+- vm->codeBase = mmap(NULL, compiledOfs, PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
++ vm->codeBase = mmap(NULL, compiledOfs, PROT_WRITE, MAP_SHARED|MAP_ANON, -1, 0);
+ if(vm->codeBase == (void*)-1)
+ Com_Error(ERR_DROP, "VM_CompileX86: can't mmap memory");
+ #elif _WIN32
diff --git a/games/iourbanterror/files/patch-code__qcommon__vm_x86_64.c b/games/iourbanterror/files/patch-code__qcommon__vm_x86_64.c
new file mode 100644
index 000000000000..0c1c5b5da16b
--- /dev/null
+++ b/games/iourbanterror/files/patch-code__qcommon__vm_x86_64.c
@@ -0,0 +1,11 @@
+--- ./code/qcommon/vm_x86_64.c.orig 2007-10-09 02:47:22.000000000 -0300
++++ ./code/qcommon/vm_x86_64.c 2008-03-04 10:45:08.000000000 -0300
+@@ -534,7 +534,7 @@
+ {
+ compiledOfs = assembler_get_code_size();
+ vm->codeLength = compiledOfs;
+- vm->codeBase = mmap(NULL, compiledOfs, PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
++ vm->codeBase = mmap(NULL, compiledOfs, PROT_WRITE, MAP_SHARED|MAP_ANON, -1, 0);
+ if(vm->codeBase == (void*)-1)
+ Com_Error(ERR_DROP, "VM_CompileX86: can't mmap memory");
+