From f9ffefd9cbdb0398f0f2be1bfbf4753e5e316719 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 19 2015 15:55:18 +0000 Subject: import mozjs17-17.0.0-12.el7 --- diff --git a/SOURCES/mozjs17-aarch64-support-64K-pages.patch b/SOURCES/mozjs17-aarch64-support-64K-pages.patch new file mode 100644 index 0000000..13b512e --- /dev/null +++ b/SOURCES/mozjs17-aarch64-support-64K-pages.patch @@ -0,0 +1,62 @@ +From f17bc0302100c885c84ebd06cd003aad9774cbb4 Mon Sep 17 00:00:00 2001 +From: Mark Salter +Date: Thu, 13 Mar 2014 13:16:27 -0400 +Subject: [PATCH] Fix aarch64 support for 64K pagesize + +A given AArch64 kernel may be using 4K or 64K pagesizes. When running +on a kernel with 64K pagesize, this check causes an intentionally +generated segfault: + + js/src/gc/Memory.cpp: + + void + InitMemorySubsystem() + { + if (size_t(sysconf(_SC_PAGESIZE)) != PageSize) + MOZ_CRASH(); + } + +This happens because PageSize is fixed to 4K at build time. This mess +has been cleaned up in mozjs-24 by eliminating the build-time PageSize +definition. That is too intrusive for mosjs17, so just set PageSize +to 64K at build time and eliminate the check. This will work with both +4K and 64K aarch64 kernels. + +Signed-off-by: Mark Salter +--- + js/src/gc/Heap.h | 2 +- + js/src/gc/Memory.cpp | 3 +++ + 3 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h +index 1cfd269..f4dbcda 100644 +--- a/js/src/gc/Heap.h ++++ b/js/src/gc/Heap.h +@@ -113,7 +113,7 @@ struct Cell + #if defined(SOLARIS) && (defined(__sparc) || defined(__sparcv9)) + const size_t PageShift = 13; + const size_t ArenaShift = PageShift; +-#elif defined(__powerpc__) ++#elif defined(__powerpc__) || defined(__aarch64__) + const size_t PageShift = 16; + const size_t ArenaShift = 12; + #else +diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp +index 5b386a2..e5ad018 100644 +--- a/js/src/gc/Memory.cpp ++++ b/js/src/gc/Memory.cpp +@@ -302,8 +302,11 @@ GetPageFaultCount() + void + InitMemorySubsystem() + { ++ /* aarch64 may have 64KB or 4KB pages */ ++#ifndef __aarch64__ + if (size_t(sysconf(_SC_PAGESIZE)) != PageSize) + MOZ_CRASH(); ++#endif + } + + void * +-- +1.8.5.3 + diff --git a/SOURCES/mozjs17-aarch64.patch b/SOURCES/mozjs17-aarch64.patch new file mode 100644 index 0000000..1965ff6 --- /dev/null +++ b/SOURCES/mozjs17-aarch64.patch @@ -0,0 +1,59 @@ +diff --git a/js/src/assembler/jit/ExecutableAllocator.h b/js/src/assembler/jit/ExecutableAllocator.h +index c071c33..90764c3 100644 +--- a/js/src/assembler/jit/ExecutableAllocator.h ++++ b/js/src/assembler/jit/ExecutableAllocator.h +@@ -382,6 +382,12 @@ public: + { + reprotectRegion(start, size, Executable); + } ++#elif WTF_CPU_AARCH64 && WTF_PLATFORM_LINUX ++ static void cacheFlush(void* code, size_t size) ++ { ++ intptr_t end = reinterpret_cast(code) + size; ++ __builtin___clear_cache(reinterpret_cast(code), reinterpret_cast(end)); ++ } + #else + static void makeWritable(void*, size_t) {} + static void makeExecutable(void*, size_t) {} +diff --git a/js/src/assembler/wtf/Platform.h b/js/src/assembler/wtf/Platform.h +index 0c84896..e8763a7 100644 +--- a/js/src/assembler/wtf/Platform.h ++++ b/js/src/assembler/wtf/Platform.h +@@ -325,6 +325,10 @@ + #define WTF_THUMB_ARCH_VERSION 0 + #endif + ++/* CPU(AArch64) - 64-bit ARM */ ++#if defined(__aarch64__) ++#define WTF_CPU_AARCH64 1 ++#endif + + /* WTF_CPU_ARMV5_OR_LOWER - ARM instruction set v5 or earlier */ + /* On ARMv5 and below the natural alignment is required. +diff --git a/js/src/configure.in b/js/src/configure.in +index 15605b2..19fd704 100644 +--- a/js/src/configure.in ++++ b/js/src/configure.in +@@ -1121,6 +1121,10 @@ arm*) + CPU_ARCH=arm + ;; + ++aarch64) ++ CPU_ARCH=aarch64 ++ ;; ++ + mips|mipsel) + CPU_ARCH="mips" + ;; +diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h +index 0eec2d9..fe26dab 100644 +--- a/mfbt/double-conversion/utils.h ++++ b/mfbt/double-conversion/utils.h +@@ -58,6 +58,7 @@ + defined(__mips__) || defined(__powerpc__) || \ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ + defined(__SH4__) || defined(__alpha__) || \ ++ defined(__aarch64__) || \ + defined(_MIPS_ARCH_MIPS32R2) + #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 + #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) diff --git a/SPECS/mozjs17.spec b/SPECS/mozjs17.spec index bce1522..baea8a0 100644 --- a/SPECS/mozjs17.spec +++ b/SPECS/mozjs17.spec @@ -1,7 +1,7 @@ Summary: JavaScript interpreter and libraries Name: mozjs17 Version: 17.0.0 -Release: 10%{?dist} +Release: 12%{?dist} License: GPLv2+ or LGPLv2+ or MPLv1.1 Group: Development/Languages URL: http://www.mozilla.org/js/ @@ -17,6 +17,8 @@ Patch0: js17-build-fixes.patch Patch1: js17-jsval.patch Patch2: mozbug746112-no-decommit-on-large-pages.patch Patch3: 0001-Move-JS_BYTES_PER_WORD-out-of-config.h.patch +Patch4: mozjs17-aarch64.patch +Patch5: mozjs17-aarch64-support-64K-pages.patch %description JavaScript is the Netscape-developed object scripting language used in millions @@ -42,11 +44,13 @@ rm js/src/ctypes/libffi -rf %patch0 -p1 %patch1 -p1 %patch2 -p1 -chmod a+x configure -(cd js/src && autoconf-2.13) %patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build +chmod a+x configure +(cd js/src && autoconf-2.13) %configure --disable-static --with-system-nspr --enable-threadsafe --enable-readline make %{?_smp_mflags} @@ -85,6 +89,11 @@ rm -f %{buildroot}%{_bindir}/js17-config %{_includedir}/js-17.0 %changelog +* Fri Jul 11 2014 Colin Walters - 17.0.0-12 +- Add patch for aarch64 +- Fix for aarch64 64k pagesize. BZ#1076181 (Mark Salter ) +- Resolves: #1027067 + * Tue Mar 18 2014 Colin Walters - 17.0.0-10 - Add patch to fix multilib conflict with -devel packages - Resolves: #1076420