Hello community,

here is the log from the commit of package mozjs38 for openSUSE:Factory checked 
in at 2016-06-14 23:08:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mozjs38 (Old)
 and      /work/SRC/openSUSE:Factory/.mozjs38.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mozjs38"

Changes:
--------
--- /work/SRC/openSUSE:Factory/mozjs38/mozjs38.changes  2015-12-03 
13:30:24.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.mozjs38.new/mozjs38.changes     2016-06-14 
23:08:49.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Jun 13 17:13:12 UTC 2016 - [email protected]
+
+- Fix 48 virtual address space systems like upstream (bsc#984126)
+  (mozjs-support-48bit-va.patch)
+
+-------------------------------------------------------------------

New:
----
  mozjs-support-48bit-va.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mozjs38.spec ++++++
--- /var/tmp/diff_new_pack.vcBVkv/_old  2016-06-14 23:08:50.000000000 +0200
+++ /var/tmp/diff_new_pack.vcBVkv/_new  2016-06-14 23:08:50.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package mozjs38
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #               2014 Wolfgang Rosenauer
 #
 # All modifications and additions to the file contributed by third parties
@@ -32,6 +32,7 @@
 Patch1:                mozjs38_missing_zlib_moz_build.patch
 Patch2:                mozjs38_missing_python_before_milestone_call.patch
 Patch3:                mozjs38_avoid_strncat_warning_inline.patch
+Patch4:         mozjs-support-48bit-va.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  autoconf213
 BuildRequires:  gcc-c++
@@ -74,6 +75,7 @@
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 # no need to add build time to binaries

++++++ mozjs-support-48bit-va.patch ++++++

# HG changeset patch
# User Zheng Xu <[email protected]>
# Date 1464657720 -7200
# Node ID dfaafbaaa2919a033c4c0abdd5830f4ea413bed6
# Parent  499f16ca85ec48d1896a1633730715f32bd62140
Bug 1143022 - Manually mmap on arm64 to ensure high 17 bits are clear. 
r=ehoogeveen

There might be 48-bit VA on arm64 depending on kernel configuration.
Manually mmap heap memory to align with the assumption made by JS engine.

Index: mozjs-38.0.0/js/src/gc/Memory.cpp
===================================================================
--- mozjs-38.0.0.orig/js/src/gc/Memory.cpp
+++ mozjs-38.0.0/js/src/gc/Memory.cpp
@@ -379,7 +379,7 @@ static inline void*
 MapMemoryAt(void* desired, size_t length, int prot = PROT_READ | PROT_WRITE,
             int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0)
 {
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
+#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || 
defined(__aarch64__)
     MOZ_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0);
 #endif
     void* region = mmap(desired, length, prot, flags, fd, offset);
@@ -429,6 +429,38 @@ MapMemory(size_t length, int prot = PROT
         return nullptr;
     }
     return region;
+#elif defined(__aarch64__)
+   /*
+    * There might be similar virtual address issue on arm64 which depends on
+    * hardware and kernel configurations. But the work around is slightly
+    * different due to the different mmap behavior.
+    */
+    const uintptr_t start = UINT64_C(0x0000070000000000);
+    const uintptr_t end   = UINT64_C(0x0000800000000000);
+    const uintptr_t step  = ChunkSize;
+   /*
+    * Optimization options if there are too many retries in practice:
+    * 1. Examine /proc/self/maps to find an available address. This file is
+    *    not always available, however. In addition, even if we examine
+    *    /proc/self/maps, we may still need to retry several times due to
+    *    racing with other threads.
+    * 2. Use a global/static variable with lock to track the addresses we have
+    *    allocated or tried.
+    */
+    uintptr_t hint;
+    void* region = MAP_FAILED;
+    for (hint = start; region == MAP_FAILED && hint + length <= end; hint += 
step) {
+        region = mmap((void*)hint, length, prot, flags, fd, offset);
+        if (region != MAP_FAILED) {
+            if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
+                if (munmap(region, length)) {
+                    MOZ_ASSERT(errno == ENOMEM);
+                }
+                region = MAP_FAILED;
+            }
+        }
+    }
+    return region == MAP_FAILED ? nullptr : region;
 #else
     void* region = MozTaggedAnonymousMmap(nullptr, length, prot, flags, fd, 
offset, "js-gc-heap");
     if (region == MAP_FAILED)

Reply via email to