diff --git a/SOURCES/0001-Bump-soname-for-API-ABI-change-due-to-aarch64-portin.patch b/SOURCES/0001-Bump-soname-for-API-ABI-change-due-to-aarch64-portin.patch new file mode 100644 index 0000000..feabf46 --- /dev/null +++ b/SOURCES/0001-Bump-soname-for-API-ABI-change-due-to-aarch64-portin.patch @@ -0,0 +1,25 @@ +From 5a001f30574a6265dbf9b480cd0189169f1b121f Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Fri, 27 May 2016 16:14:35 -0400 +Subject: [PATCH] Bump soname for API/ABI change due to aarch64 porting + +--- + js/src/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/js/src/Makefile.in b/js/src/Makefile.in +index 9c58960..1edf9b5 100644 +--- a/js/src/Makefile.in ++++ b/js/src/Makefile.in +@@ -35,7 +35,7 @@ TEST_DIRS += tests + + ifdef JS_STANDALONE + MODULE = js-@MOZJS_MAJOR_VERSION@.@MOZJS_MINOR_VERSION@@MOZJS_ALPHA@ +-LIBRARY_NAME = mozjs-@MOZJS_MAJOR_VERSION@.@MOZJS_MINOR_VERSION@@MOZJS_ALPHA@ ++LIBRARY_NAME = mozjs-@MOZJS_MAJOR_VERSION@.@MOZJS_MINOR_VERSION@@MOZJS_ALPHA@.1 + else + LIBRARY_NAME = mozjs + MODULE = js +-- +1.8.3.1 + diff --git a/SOURCES/mozjs17-aarch64-48bit-va-limits.patch b/SOURCES/mozjs17-aarch64-48bit-va-limits.patch new file mode 100644 index 0000000..5431361 --- /dev/null +++ b/SOURCES/mozjs17-aarch64-48bit-va-limits.patch @@ -0,0 +1,143 @@ +From 6e3895edd5ca6fc875e27b3f1fbc2f9a2a0d42d7 Mon Sep 17 00:00:00 2001 +From: Jon Masters +Date: Mon, 16 May 2016 15:40:24 -0400 +Subject: [[RHEL7.3 TEST PATCH]] mozjs17: support 48-bit VA limits in tagged + pointers on AArch64 + +The 64-bit ARM Architecture (AArch64) provides certain bits of +high order VA (Virtual Address) space for tagged pointers, but +these are limited to above 48 bits. mozjs has can existing +assumption that it can use everything above 47 bits itself. + +This is needed to support a 48-bit VA kernel on RHEL(SA)7. + +The patch is from Zheng Xu + +Signed-off-by: Jon Masters +--- + ...64-support-tagged-pointers-48bit-va-limit.patch | 118 +++++++++++++++++++++ + 1 file changed, 118 insertions(+) + create mode 100644 mozjs17-aarch64-support-tagged-pointers-48bit-va-limit.patch + + +diff -urNp mozjs17.0.0_orig/js/src/jsval.h mozjs17.0.0/js/src/jsval.h +--- mozjs17.0.0_orig/js/src/jsval.h 2016-05-16 15:33:42.400203358 -0400 ++++ mozjs17.0.0/js/src/jsval.h 2016-05-16 15:31:21.350657048 -0400 +@@ -35,7 +35,7 @@ JS_BEGIN_EXTERN_C + #endif + + #if JS_BITS_PER_WORD == 64 +-# define JSVAL_TAG_SHIFT 47 ++# define JSVAL_TAG_SHIFT 48 + #endif + + /* +@@ -94,7 +94,8 @@ JS_STATIC_ASSERT(sizeof(JSValueTag) == 4 + /* Remember to propagate changes to the C defines below. */ + JS_ENUM_HEADER(JSValueTag, uint32_t) + { +- JSVAL_TAG_MAX_DOUBLE = 0x1FFF0, ++ JSVAL_TAG_DUMMY = 0xFFFFFFFF, /* Make sure the enums cannot fit 16-bits. */ ++ JSVAL_TAG_MAX_DOUBLE = 0xFFF8, + JSVAL_TAG_INT32 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32, + JSVAL_TAG_UNDEFINED = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED, + JSVAL_TAG_STRING = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING, +@@ -150,7 +151,7 @@ typedef uint32_t JSValueTag; + #elif JS_BITS_PER_WORD == 64 + + typedef uint32_t JSValueTag; +-#define JSVAL_TAG_MAX_DOUBLE ((uint32_t)(0x1FFF0)) ++#define JSVAL_TAG_MAX_DOUBLE ((uint32_t)(0xFFF8)) + #define JSVAL_TAG_INT32 (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32) + #define JSVAL_TAG_UNDEFINED (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED) + #define JSVAL_TAG_STRING (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING) +@@ -188,8 +189,8 @@ typedef uint64_t JSValueShiftedTag; + + #elif JS_BITS_PER_WORD == 64 + +-#define JSVAL_PAYLOAD_MASK 0x00007FFFFFFFFFFFLL +-#define JSVAL_TAG_MASK 0xFFFF800000000000LL ++#define JSVAL_PAYLOAD_MASK 0x0000FFFFFFFFFFFFLL ++#define JSVAL_TAG_MASK 0xFFFF000000000000LL + #define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type))) + #define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT) + +@@ -251,8 +252,8 @@ typedef union jsval_layout + #if (!defined(_WIN64) && defined(__cplusplus)) + /* MSVC does not pack these correctly :-( */ + struct { +- uint64_t payload47 : 47; +- JSValueTag tag : 17; ++ uint64_t payload48 : 48; ++ JSValueTag tag : 16; + } debugView; + #endif + struct { +@@ -295,8 +296,8 @@ typedef union jsval_layout + { + uint64_t asBits; + struct { +- JSValueTag tag : 17; +- uint64_t payload47 : 47; ++ JSValueTag tag : 16; ++ uint64_t payload48 : 48; + } debugView; + struct { + uint32_t padding; +@@ -788,7 +789,7 @@ JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, j + { + uint64_t lbits = lhs.asBits, rbits = rhs.asBits; + return (lbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE && rbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE) || +- (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0); ++ (((lbits ^ rbits) & 0xFFFF000000000000LL) == 0); + } + + static JS_ALWAYS_INLINE jsval_layout +@@ -810,7 +811,7 @@ JSVAL_TO_PRIVATE_UINT32_IMPL(jsval_layou + static JS_ALWAYS_INLINE JSValueType + JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l) + { +- uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF; ++ uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0x7; + JS_ASSERT(type > JSVAL_TYPE_DOUBLE); + return (JSValueType)type; + } +diff -urNp mozjs17.0.0_orig/js/src/methodjit/MethodJIT.cpp mozjs17.0.0/js/src/methodjit/MethodJIT.cpp +--- mozjs17.0.0_orig/js/src/methodjit/MethodJIT.cpp 2013-02-11 17:33:23.000000000 -0500 ++++ mozjs17.0.0/js/src/methodjit/MethodJIT.cpp 2016-05-16 15:36:35.044096031 -0400 +@@ -238,8 +238,8 @@ JS_STATIC_ASSERT(offsetof(VMFrame, saved + JS_STATIC_ASSERT(offsetof(VMFrame, scratch) == 0x18); + JS_STATIC_ASSERT(VMFrame::offsetOfFp == 0x38); + +-JS_STATIC_ASSERT(JSVAL_TAG_MASK == 0xFFFF800000000000LL); +-JS_STATIC_ASSERT(JSVAL_PAYLOAD_MASK == 0x00007FFFFFFFFFFFLL); ++JS_STATIC_ASSERT(JSVAL_TAG_MASK == 0xFFFF000000000000LL); ++JS_STATIC_ASSERT(JSVAL_PAYLOAD_MASK == 0x0000FFFFFFFFFFFFLL); + + asm ( + ".text\n" +@@ -266,8 +266,8 @@ SYMBOL_STRING(JaegerTrampoline) ":" + CFI(".cfi_offset rbx, -56" "\n") + + /* Load mask registers. */ +- "movq $0xFFFF800000000000, %r13" "\n" +- "movq $0x00007FFFFFFFFFFF, %r14" "\n" ++ "movq $0xFFFF000000000000, %r13" "\n" ++ "movq $0x0000FFFFFFFFFFFF, %r14" "\n" + + /* Build the JIT frame. + * rdi = cx +@@ -947,8 +947,8 @@ extern "C" { + JS_STATIC_ASSERT(offsetof(VMFrame, savedRBX) == 0x68); + JS_STATIC_ASSERT(offsetof(VMFrame, scratch) == 0x18); + JS_STATIC_ASSERT(VMFrame::offsetOfFp == 0x38); +-JS_STATIC_ASSERT(JSVAL_TAG_MASK == 0xFFFF800000000000LL); +-JS_STATIC_ASSERT(JSVAL_PAYLOAD_MASK == 0x00007FFFFFFFFFFFLL); ++JS_STATIC_ASSERT(JSVAL_TAG_MASK == 0xFFFF000000000000LL); ++JS_STATIC_ASSERT(JSVAL_PAYLOAD_MASK == 0x0000FFFFFFFFFFFFLL); + + #endif /* _WIN64 */ + +-- +2.5.5 + diff --git a/SPECS/mozjs17.spec b/SPECS/mozjs17.spec index baea8a0..a6aff11 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: 12%{?dist} +Release: 19%{?dist} License: GPLv2+ or LGPLv2+ or MPLv1.1 Group: Development/Languages URL: http://www.mozilla.org/js/ @@ -19,6 +19,15 @@ 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 +# This changes the API/ABI, which we're currently only doing for aarch64 +# https://bugzilla.redhat.com/show_bug.cgi?id=1324216 +%ifarch aarch64 +%global fortyeightbitva_patch 1 +%else +%global fortyeightbitva_patch 0 +%endif +Patch6: mozjs17-aarch64-48bit-va-limits.patch +Patch7: 0001-Bump-soname-for-API-ABI-change-due-to-aarch64-portin.patch %description JavaScript is the Netscape-developed object scripting language used in millions @@ -47,6 +56,10 @@ rm js/src/ctypes/libffi -rf %patch3 -p1 %patch4 -p1 %patch5 -p1 +%if 0%{fortyeightbitva_patch} +%patch6 -p1 +%patch7 -p1 +%endif %build chmod a+x configure @@ -76,6 +89,13 @@ rm -f %{buildroot}%{_bindir}/js17 # the pkg-config file. rm -f %{buildroot}%{_bindir}/js17-config +# We do not want the full soname embedded in the .pc file since +# that forces consumers to have architecture-dependent source patches +# to find it. All we want is a forced rebuild. +%if 0%{fortyeightbitva_patch} +mv %{buildroot}%{_libdir}/pkgconfig/mozjs-17.0{.1,}.pc +%endif + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -89,6 +109,13 @@ rm -f %{buildroot}%{_bindir}/js17-config %{_includedir}/js-17.0 %changelog +* Thu May 26 2016 Colin Walters - 17.0.0-16 +- Add patch for aarch64 48bit VA limits + This changes the API/ABI only on aarch64, and hence we also bump + the soname solely on those architectures. We do retain the same pkg-config + file name though, so dependencies should only need a rebuild. +- Resolves: #1324216 + * Fri Jul 11 2014 Colin Walters - 17.0.0-12 - Add patch for aarch64 - Fix for aarch64 64k pagesize. BZ#1076181 (Mark Salter )