File: ia64-support.patch

package info (click to toggle)
mozjs128 128.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,132,528 kB
  • sloc: javascript: 2,181,430; cpp: 1,371,420; python: 776,651; ansic: 641,398; xml: 117,736; sh: 17,537; asm: 13,468; makefile: 11,191; yacc: 4,504; perl: 2,221; lex: 1,414; ruby: 1,032; exp: 756; java: 185; sql: 66; sed: 18
file content (40 lines) | stat: -rw-r--r-- 1,342 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Jason Duerstock <jason.duerstock@gmail.com>
Date: Sun, 29 Apr 2018 09:16:20 -0400
Subject: On ia64, retry failed mmap without address hint

[smcv: Move the #endif so we still return a defined value on non-ia64]
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897178
Last-Updated: 2018-07-10
---
 js/src/jit/ProcessExecutableMemory.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp
index 0c00b17..86c9d76 100644
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -521,12 +521,24 @@ static void* ReserveProcessExecutableMemory(size_t bytes) {
 #  endif
   void* p = MozTaggedAnonymousMmap(randomAddr, bytes, protection, flags, -1, 0,
                                    "js-executable-memory");
+
+#ifndef __ia64__
   if (p == MAP_FAILED) {
     return nullptr;
   }
 #  if defined(XP_DARWIN)
   DecommitPages(p, bytes);
 #  endif
+#else
+  if (p == MAP_FAILED) {
+    // the comment above appears to be incorrect on ia64, so retry without the hint
+    p = MozTaggedAnonymousMmap(NULL, bytes, PROT_NONE, MAP_PRIVATE | MAP_ANON,
+                               -1, 0, "js-executable-memory");
+    if (p == MAP_FAILED) {
+      return nullptr;
+    }
+  }
+#endif
   return p;
 }