Accepting request 177943 from mozilla:Factory

- prevent xpc-shell crashing on powerpc
  ppc-xpcshell.patch (forwarded request 177615 from k0da)

OBS-URL: https://build.opensuse.org/request/show/177943
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/MozillaThunderbird?expand=0&rev=119
This commit is contained in:
Stephan Kulow 2013-06-07 08:05:16 +00:00 committed by Git OBS Bridge
commit 2c3d728c05
3 changed files with 79 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jun 4 20:41:42 UTC 2013 - dvaleev@suse.com
- prevent xpc-shell crashing on powerpc
ppc-xpcshell.patch
-------------------------------------------------------------------
Sat May 11 08:46:37 UTC 2013 - wr@rosenauer.org

View File

@ -76,6 +76,7 @@ Patch3: mozilla-nongnome-proxies.patch
Patch4: mozilla-kde.patch
Patch5: mozilla-arm-disable-edsp.patch
Patch7: mozilla-ppc.patch
Patch8: ppc-xpcshell.patch
# SLE11 patches
Patch10: mozilla-gcc43-enums.patch
Patch11: mozilla-gcc43-template_hacks.patch
@ -208,6 +209,7 @@ pushd mozilla
%endif
%patch5 -p1
%patch7 -p1
%patch8 -p1
# SLE patches
%if %suse_version <= 1110
%patch10 -p1

71
ppc-xpcshell.patch Normal file
View File

@ -0,0 +1,71 @@
Index: mozilla/js/src/gc/Heap.h
===================================================================
--- mozilla.orig/js/src/gc/Heap.h
+++ mozilla/js/src/gc/Heap.h
@@ -110,19 +110,22 @@ struct Cell
*/
#if defined(SOLARIS) && (defined(__sparc) || defined(__sparcv9))
const size_t PageShift = 13;
+const size_t ArenaShift = PageShift;
+#elif defined(__powerpc__)
+const size_t PageShift = 16;
+const size_t ArenaShift = 12;
#else
const size_t PageShift = 12;
+const size_t ArenaShift = PageShift;
#endif
const size_t PageSize = size_t(1) << PageShift;
+const size_t ArenaSize = size_t(1) << ArenaShift;
+const size_t ArenaMask = ArenaSize - 1;
const size_t ChunkShift = 20;
const size_t ChunkSize = size_t(1) << ChunkShift;
const size_t ChunkMask = ChunkSize - 1;
-const size_t ArenaShift = PageShift;
-const size_t ArenaSize = PageSize;
-const size_t ArenaMask = ArenaSize - 1;
-
/*
* This is the maximum number of arenas we allow in the FreeCommitted state
* before we trigger a GC_SHRINK to release free arenas to the OS.
Index: mozilla/js/src/gc/Memory.cpp
===================================================================
--- mozilla.orig/js/src/gc/Memory.cpp
+++ mozilla/js/src/gc/Memory.cpp
@@ -15,6 +15,15 @@
namespace js {
namespace gc {
+/* Unused memory decommiting requires the arena size match the page size. */
+extern const size_t PageSize;
+extern const size_t ArenaSize;
+static bool
+DecommitEnabled()
+{
+ return PageSize == ArenaSize;
+}
+
#if defined(XP_WIN)
#include "jswin.h"
#include <psapi.h>
@@ -83,6 +92,9 @@ UnmapPages(void *p, size_t size)
bool
MarkPagesUnused(void *p, size_t size)
{
+ if (!DecommitEnabled())
+ return false;
+
JS_ASSERT(uintptr_t(p) % PageSize == 0);
LPVOID p2 = VirtualAlloc(p, size, MEM_RESET, PAGE_READWRITE);
return p2 == p;
@@ -352,6 +364,9 @@ UnmapPages(void *p, size_t size)
bool
MarkPagesUnused(void *p, size_t size)
{
+ if (!DecommitEnabled())
+ return false;
+
JS_ASSERT(uintptr_t(p) % PageSize == 0);
int result = madvise(p, size, MADV_DONTNEED);
return result != -1;