summaryrefslogtreecommitdiff
path: root/emulators/mame/patches
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2021-01-27 17:06:06 +0000
committerwiz <wiz@pkgsrc.org>2021-01-27 17:06:06 +0000
commitb91c9b037edb5062e57789cdd7ca88e43e455ae7 (patch)
tree9a745f560f15edfe2a68495ed4a48b4e1b36a6c2 /emulators/mame/patches
parentabad26e77853179e106150c9dd3aa07bc41e9862 (diff)
downloadpkgsrc-b91c9b037edb5062e57789cdd7ca88e43e455ae7.tar.gz
mame: add patch to fix running mame on NetBSD.
Bump PKGREVISION.
Diffstat (limited to 'emulators/mame/patches')
-rw-r--r--emulators/mame/patches/patch-src_osd_modules_lib_osdlib__unix.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/emulators/mame/patches/patch-src_osd_modules_lib_osdlib__unix.cpp b/emulators/mame/patches/patch-src_osd_modules_lib_osdlib__unix.cpp
new file mode 100644
index 00000000000..68650da0ef7
--- /dev/null
+++ b/emulators/mame/patches/patch-src_osd_modules_lib_osdlib__unix.cpp
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_osd_modules_lib_osdlib__unix.cpp,v 1.1 2021/01/27 17:06:06 wiz Exp $
+
+Prepare mmap'd page for later mprotect().
+https://github.com/mamedev/mame/issues/7712
+
+--- src/osd/modules/lib/osdlib_unix.cpp.orig 2021-01-26 04:43:24.000000000 +0000
++++ src/osd/modules/lib/osdlib_unix.cpp
+@@ -189,7 +189,11 @@ void *virtual_memory_allocation::do_allo
+ // TODO: portable applications are supposed to use -1 for anonymous mappings - detect whatever requires 0 specifically
+ int const fd(0);
+ #endif
++#ifdef __NetBSD__
++ void *const result(mmap(nullptr, s, PROT_MPROTECT(PROT_EXEC|PROT_WRITE|PROT_READ), MAP_ANON | MAP_SHARED, fd, 0));
++#else
+ void *const result(mmap(nullptr, s, PROT_NONE, MAP_ANON | MAP_SHARED, fd, 0));
++#endif
+ if (result == (void *)-1)
+ return nullptr;
+ size = s;