0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-54684 Apply upstream fix for MozJS bug 1442583

Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1442583 for
the upstream bug. The patch applied here was derived from the
following commit:

7371a080ac
This commit is contained in:
Andrew Morrow 2021-02-22 16:37:22 -05:00 committed by Evergreen Agent
parent 35baa2b1e8
commit 25d0ab8436
4 changed files with 41 additions and 0 deletions

View File

@ -221,3 +221,4 @@ patch -p4 < patches/windows-Time.cpp-GetModuleHandle.patch
patch -p4 < patches/JSGCConfig.patch
patch -p4 < patches/struct-hasher.patch
patch -p4 < patches/freebsd-powerpc64le-fix.patch
patch -p4 < patches/moz-bug-1442583.patch

View File

@ -20,6 +20,9 @@
#include "jsutil.h"
#include "gc/Memory.h"
#ifdef JS_CODEGEN_ARM64
# include "jit/arm64/vixl/Cpu-vixl.h"
#endif
#include "threading/LockGuard.h"
#include "threading/Mutex.h"
#include "util/Windows.h"
@ -621,6 +624,10 @@ js::jit::DeallocateExecutableMemory(void* addr, size_t bytes)
bool
js::jit::InitProcessExecutableMemory()
{
#ifdef JS_CODEGEN_ARM64
// Initialize instruction cache flushing.
vixl::CPU::SetUp();
#endif
return execMemory.init();
}

View File

@ -263,6 +263,10 @@ struct AutoSignalHandler
# define EPC_sig(p) ((p)->uc_mcontext.mc_pc)
# define RFP_sig(p) ((p)->uc_mcontext.mc_regs[30])
# endif
# if defined(__FreeBSD__) && defined(__powerpc64__)
# define R01_sig(p) ((p)->uc_mcontext.mc_frame[1])
# define R32_sig(p) ((p)->uc_mcontext.mc_srr0)
# endif
#elif defined(XP_DARWIN)
# define EIP_sig(p) ((p)->uc_mcontext->__ss.__eip)
# define EBP_sig(p) ((p)->uc_mcontext->__ss.__ebp)

View File

@ -0,0 +1,29 @@
# Fix https://jira.mongodb.org/browse/SERVER-54684 by applying upstream changes from ESR 69
# - https://bugzilla.mozilla.org/show_bug.cgi?id=1442583
# - https://github.com/mozilla/gecko-dev/commit/7371a080accd8dfcaf0d24072b787e143846973a
diff --git a/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp b/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp
index e763a9d68d..8a6d50b6a7 100644
--- a/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp
+++ b/src/third_party/mozjs-60/extract/js/src/jit/ProcessExecutableMemory.cpp
@@ -20,6 +20,9 @@
#include "jsutil.h"
#include "gc/Memory.h"
+#ifdef JS_CODEGEN_ARM64
+# include "jit/arm64/vixl/Cpu-vixl.h"
+#endif
#include "threading/LockGuard.h"
#include "threading/Mutex.h"
#include "util/Windows.h"
@@ -621,6 +624,10 @@ js::jit::DeallocateExecutableMemory(void* addr, size_t bytes)
bool
js::jit::InitProcessExecutableMemory()
{
+#ifdef JS_CODEGEN_ARM64
+ // Initialize instruction cache flushing.
+ vixl::CPU::SetUp();
+#endif
return execMemory.init();
}