summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik M. Bray <erik.bray@lri.fr>2017-03-17 20:08:17 +0100
committerErik M. Bray <erik.bray@lri.fr>2017-03-17 20:12:15 +0100
commit48b762121bc08048dc269732d7c72561b4f34978 (patch)
tree7b74629483e9bf08809aa2a0b88b72bacfce3333
parentUpdated SageMath version to 7.6.rc0 (diff)
Add patch to Pari (on top of prot_none_1.patch) that restores use of MAP_NORESERVE on Cygwin
Seems to fix https://trac.sagemath.org/ticket/22633
-rw-r--r--build/pkgs/pari/package-version.txt2
-rw-r--r--build/pkgs/pari/patches/prot_none_4.patch35
2 files changed, 36 insertions, 1 deletions
diff --git a/build/pkgs/pari/package-version.txt b/build/pkgs/pari/package-version.txt
index c457e4f..fb3a232 100644
--- a/build/pkgs/pari/package-version.txt
+++ b/build/pkgs/pari/package-version.txt
@@ -1 +1 @@
-2.9.1.p2
+2.9.1.p3
diff --git a/build/pkgs/pari/patches/prot_none_4.patch b/build/pkgs/pari/patches/prot_none_4.patch
new file mode 100644
index 00000000..8941030
--- /dev/null
+++ b/build/pkgs/pari/patches/prot_none_4.patch
@@ -0,0 +1,35 @@
+Fix mmap usage on Cygwin; see https://trac.sagemath.org/ticket/22633
+diff --git a/src/language/init.c b/src/language/init.c
+index c2bd218..70543ba 100644
+--- a/src/language/init.c
++++ b/src/language/init.c
+@@ -594,14 +594,18 @@ pari_add_defaults_module(entree *ep)
+
+ #ifdef HAS_MMAP
+ #define PARI_STACK_ALIGN (sysconf(_SC_PAGE_SIZE))
++#ifdef __CYGWIN__
++#define PARI_MMAP_FLAGS MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE
++#else
++#define PARI_MMAP_FLAGS MAP_PRIVATE | MAP_ANONYMOUS
++#endif
+ #ifndef MAP_ANONYMOUS
+ #define MAP_ANONYMOUS MAP_ANON
+ #endif
+ static void *
+ pari_mainstack_malloc(size_t size)
+ {
+- void *b = mmap(NULL, size, PROT_READ|PROT_WRITE,
+- MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
++ void *b = mmap(NULL, size, PROT_READ|PROT_WRITE, PARI_MMAP_FLAGS, -1, 0);
+ return (b == MAP_FAILED) ? NULL: b;
+ }
+
+@@ -628,7 +632,7 @@ static void
+ pari_mainstack_mreset(pari_sp from, pari_sp to)
+ {
+ size_t s = to - from;
+- mmap((void*)from, s, PROT_NONE, MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
++ mmap((void*)from, s, PROT_NONE, PARI_MMAP_FLAGS | MAP_FIXED, -1, 0);
+ }
+
+ /* Commit (make available) the virtual memory mapped between the