Compare commits

...

3 Commits

Author SHA1 Message Date
Kalev Lember d2795ed492 Fix multilib conflicts in js-config.h
The multilib header handling is copied verbatim from libjpeg-turbo.
2019-09-10 12:30:43 +02:00
Kalev Lember f00bcf36c0 Backport patches for s390x support 2019-09-07 21:52:31 +02:00
Kalev Lember 02c58cc60b Update to 60.9.0 2019-09-03 16:34:19 +02:00
5 changed files with 236 additions and 2 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@
/firefox-60.7.1esr.source.tar.xz
/firefox-60.7.2esr.source.tar.xz
/firefox-60.8.0esr.source.tar.xz
/firefox-60.9.0esr.source.tar.xz

141
enddianness.patch Normal file
View File

@ -0,0 +1,141 @@
From f66d410f3ba767efb91c6b9545d373267cd975f2 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Sat, 7 Sep 2019 20:43:40 +0200
Subject: [PATCH] enddianness.patch
Bug 1488552 - Ensure proper running on 64-bit and 32-bit BE platforms.
---
js/src/gc/Marking-inl.h | 16 ++++++++++++++++
js/src/gc/RelocationOverlay.h | 13 ++++++++++++-
js/src/jsfriendapi.h | 8 ++++++++
js/src/vm/StringType.h | 13 +++++++++++++
4 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/js/src/gc/Marking-inl.h b/js/src/gc/Marking-inl.h
index 6d2a4c7..c773c21 100644
--- a/js/src/gc/Marking-inl.h
+++ b/js/src/gc/Marking-inl.h
@@ -82,12 +82,28 @@ inline void RelocationOverlay::forwardTo(Cell* cell) {
MOZ_ASSERT(!isForwarded());
// The location of magic_ is important because it must never be valid to see
// the value Relocated there in a GC thing that has not been moved.
+#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32
+ // On 32-bit, the magic_ aliases with whatever comes after the first
+ // pointer; on little-endian 64-bit, the magic_ aliases with the
+ // 32 most significant bits of the pointer, which are the second half.
static_assert(offsetof(RelocationOverlay, magic_) ==
offsetof(JSObject, group_) + sizeof(uint32_t),
"RelocationOverlay::magic_ is in the wrong location");
static_assert(offsetof(RelocationOverlay, magic_) ==
offsetof(js::Shape, base_) + sizeof(uint32_t),
"RelocationOverlay::magic_ is in the wrong location");
+#elif JS_BITS_PER_WORD == 64
+ // On big-endian 64-bit, the magic_ aliases with the 32 most
+ // significant bits of the pointer, but now that's the first half.
+ static_assert(offsetof(RelocationOverlay, magic_) ==
+ offsetof(JSObject, group_),
+ "RelocationOverlay::magic_ is in the wrong location");
+ static_assert(offsetof(RelocationOverlay, magic_) ==
+ offsetof(js::Shape, base_),
+ "RelocationOverlay::magic_ is in the wrong location");
+#else
+# error "Unknown endianness or word size"
+#endif
static_assert(
offsetof(RelocationOverlay, magic_) == offsetof(JSString, d.u1.length),
"RelocationOverlay::magic_ is in the wrong location");
diff --git a/js/src/gc/RelocationOverlay.h b/js/src/gc/RelocationOverlay.h
index a568843..399a541 100644
--- a/js/src/gc/RelocationOverlay.h
+++ b/js/src/gc/RelocationOverlay.h
@@ -33,14 +33,25 @@ class RelocationOverlay {
/* See comment in js/public/HeapAPI.h. */
static const uint32_t Relocated = js::gc::Relocated;
+#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32
/*
- * Keep the low 32 bits untouched. Use them to distinguish strings from
+ * Keep the first 32 bits untouched. Use them to distinguish strings from
* objects in the nursery.
*/
uint32_t preserve_;
/* Set to Relocated when moved. */
uint32_t magic_;
+#elif JS_BITS_PER_WORD == 64
+ /*
+ * On big-endian, we need to reorder to keep preserve_ lined up with the
+ * low 32 bits of the aligned group_ pointer in JSObject.
+ */
+ uint32_t magic_;
+ uint32_t preserve_;
+#else
+# error "Unknown endianness or word size"
+#endif
/* The location |this| was moved to. */
Cell* newLocation_;
diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h
index 4b8d18a..70ce0a1 100644
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -9,6 +9,7 @@
#include "mozilla/Atomics.h"
#include "mozilla/Casting.h"
+#include "mozilla/EndianUtils.h"
#include "mozilla/Maybe.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/UniquePtr.h"
@@ -609,8 +610,15 @@ struct String {
static const uint32_t LATIN1_CHARS_BIT = JS_BIT(6);
static const uint32_t EXTERNAL_FLAGS = LINEAR_BIT | NON_ATOM_BIT | JS_BIT(5);
static const uint32_t TYPE_FLAGS_MASK = JS_BIT(6) - 1;
+#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32
uint32_t flags;
uint32_t length;
+#elif JS_BITS_PER_WORD == 64
+ uint32_t length;
+ uint32_t flags;
+#else
+# error "Unknown endianness or word size"
+#endif
union {
const JS::Latin1Char* nonInlineCharsLatin1;
const char16_t* nonInlineCharsTwoByte;
diff --git a/js/src/vm/StringType.h b/js/src/vm/StringType.h
index cde3427..c3400db 100644
--- a/js/src/vm/StringType.h
+++ b/js/src/vm/StringType.h
@@ -7,6 +7,7 @@
#ifndef vm_StringType_h
#define vm_StringType_h
+#include "mozilla/EndianUtils.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/PodOperations.h"
#include "mozilla/Range.h"
@@ -168,8 +169,20 @@ class JSString : public js::gc::Cell {
struct Data {
union {
struct {
+#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32
uint32_t flags; /* JSString */
uint32_t length; /* JSString */
+#elif JS_BITS_PER_WORD == 64
+ /*
+ * On big-endian, we need to reorder to keep flags lined up
+ * with the low 32 bits of the aligned group_ pointer in
+ * JSObject.
+ */
+ uint32_t length; /* JSString */
+ uint32_t flags; /* JSString */
+#else
+# error "Unknown endianness or word size"
+#endif
};
uintptr_t flattenData; /* JSRope (temporary while flattening) */
} u1;
--
2.23.0

36
jsproperty-endian.patch Normal file
View File

@ -0,0 +1,36 @@
From a95105b7846c29c5bd3868719621ab3679d9932b Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Sat, 7 Sep 2019 21:45:58 +0200
Subject: [PATCH] jsproperty-endian.patch
Bug 1543659 - fix JSPropertySpec::ValueWrapper on 64-bit big-endian platforms
Add some padding to make the union's int32 member correspond to the
low-order bits of the string member. This fixes TypedArray tests on
s390x.
---
js/src/jsapi.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index 0f11787f6..f1c084f6a 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -1581,7 +1581,14 @@ struct JSPropertySpec {
uintptr_t type;
union {
const char* string;
+#if MOZ_BIG_ENDIAN && JS_BITS_PER_WORD == 64
+ struct {
+ uint32_t padding;
+ int32_t int32;
+ };
+#else
int32_t int32;
+#endif
};
};
--
2.23.0

View File

@ -15,7 +15,7 @@
%endif
Name: mozjs%{major}
Version: 60.8.0
Version: 60.9.0
Release: 3%{?dist}
Summary: SpiderMonkey JavaScript library
@ -37,6 +37,12 @@ Patch12: emitter.patch
Patch13: emitter_test.patch
Patch14: init_patch.patch
# s390x fixes:
# https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/enddianness.patch
Patch15: enddianness.patch
# https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/jsproperty-endian.patch
Patch16: jsproperty-endian.patch
# Patches from Fedora firefox package:
Patch26: build-icu-big-endian.patch
@ -89,6 +95,10 @@ pushd ../..
%patch13 -p1
%patch14 -p1
# s390x fixes
%patch15 -p1
%patch16 -p1
# Patch for big endian platforms only
%if 0%{?big_endian}
%patch26 -p1 -b .icu
@ -150,6 +160,43 @@ popd
# Fix permissions
chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
# Avoid multilib conflicts
case `uname -i` in
i386 | ppc | s390 | sparc )
wordsize="32"
;;
x86_64 | ppc64 | s390x | sparc64 )
wordsize="64"
;;
*)
wordsize=""
;;
esac
if test -n "$wordsize"
then
mv %{buildroot}%{_includedir}/mozjs-60/js-config.h \
%{buildroot}%{_includedir}/mozjs-60/js-config-$wordsize.h
cat >%{buildroot}%{_includedir}/mozjs-60/js-config.h <<EOF
#ifndef JS_CONFIG_H_MULTILIB
#define JS_CONFIG_H_MULTILIB
#include <bits/wordsize.h>
#if __WORDSIZE == 32
# include "js-config-32.h"
#elif __WORDSIZE == 64
# include "js-config-64.h"
#else
# error "unexpected value for __WORDSIZE macro"
#endif
#endif
EOF
fi
# Remove unneeded files
rm %{buildroot}%{_bindir}/js%{major}-config
rm %{buildroot}%{_libdir}/libjs_static.ajs
@ -190,6 +237,15 @@ ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
%{_includedir}/mozjs-%{major}/
%changelog
* Tue Sep 10 2019 Kalev Lember <klember@redhat.com> - 60.9.0-3
- Fix multilib conflicts in js-config.h
* Sat Sep 07 2019 Kalev Lember <klember@redhat.com> - 60.9.0-2
- Backport patches for s390x support
* Tue Sep 03 2019 Kalev Lember <klember@redhat.com> - 60.9.0-1
- Update to 60.9.0
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 60.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (firefox-60.8.0esr.source.tar.xz) = 0332b6049b97e488e55a3b9540baad3bd159e297084e9a625b8492497c73f86eb3e144219dabc5e9f2c2e4a27630d83d243c919cd4f86b7f59f47133ed3afc54
SHA512 (firefox-60.9.0esr.source.tar.xz) = 4baea5c9c4eff257834bbaee6d7786f69f7e6bacd24ca13c2705226f4a0d88315ab38c650b2c5e9c76b698f2debc7cea1e5a99cb4dc24e03c48a24df5143a3cf