mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Update SpiderMonkey to ESR 140.1
This commit is contained in:
parent
865ca4cd55
commit
3d5c59f2c9
10 changed files with 7707 additions and 122 deletions
|
|
@ -51,12 +51,12 @@ RUN apt-get -qqy update \
|
|||
zlib1g-dev \
|
||||
&& apt-get clean
|
||||
|
||||
# Install rust and Cargo via rustup, available in Debian12 1.63, need 1.76
|
||||
# Install rust and Cargo via rustup, available in Debian12 1.63, need 1.82
|
||||
ENV RUSTUP_HOME=/usr/local/rust
|
||||
ENV CARGO_HOME=/usr/local/rust
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.76.0 -y
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.82.0 -y
|
||||
# Install cbindgen for building SpiderMonkey
|
||||
RUN /usr/local/rust/bin/cargo install --locked cbindgen@0.29.0
|
||||
RUN /usr/local/rust/bin/cargo install --locked cbindgen@0.29.4
|
||||
|
||||
ENV PATH="${RUSTUP_HOME}/bin:${PATH}"
|
||||
ENV SHELL=/bin/bash
|
||||
|
|
|
|||
|
|
@ -660,7 +660,7 @@ extern_lib_defs = {
|
|||
|
||||
if _OPTIONS["with-system-mozjs"] then
|
||||
if not _OPTIONS["android"] then
|
||||
pkgconfig.add_includes_after("mozjs-128")
|
||||
pkgconfig.add_includes_after("mozjs-140")
|
||||
end
|
||||
else
|
||||
filter "Debug"
|
||||
|
|
@ -674,17 +674,17 @@ extern_lib_defs = {
|
|||
link_settings = function()
|
||||
if _OPTIONS["with-system-mozjs"] then
|
||||
if _OPTIONS["android"] then
|
||||
links { "mozjs-128" }
|
||||
links { "mozjs-140" }
|
||||
else
|
||||
pkgconfig.add_links("mozjs-128")
|
||||
pkgconfig.add_links("mozjs-140")
|
||||
end
|
||||
else
|
||||
filter { "Debug" }
|
||||
links { "mozjs128-debug" }
|
||||
links { "mozjs-140-debug" }
|
||||
filter { "Release" }
|
||||
links { "mozjs128-release" }
|
||||
links { "mozjs-140-release" }
|
||||
filter { }
|
||||
links { "mozjs128-rust" }
|
||||
links { "mozjs-140-rust" }
|
||||
add_source_lib_paths("spidermonkey")
|
||||
end
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ newoption { category = "Pyrogenesis", trigger = "strip-binaries", description =
|
|||
newoption { category = "Pyrogenesis", trigger = "with-system-cpp-httplib", description = "Search standard paths for cpp-httplib, instead of using bundled copy" }
|
||||
newoption { category = "Pyrogenesis", trigger = "with-system-cxxtest", description = "Search standard paths for cxxtest, instead of using bundled copy" }
|
||||
newoption { category = "Pyrogenesis", trigger = "with-lto", description = "Enable Link Time Optimization (LTO)" }
|
||||
newoption { category = "Pyrogenesis", trigger = "with-system-mozjs", description = "Search standard paths for libmozjs128, instead of using bundled copy" }
|
||||
newoption { category = "Pyrogenesis", trigger = "with-system-mozjs", description = "Search standard paths for libmozjs140, instead of using bundled copy" }
|
||||
newoption { category = "Pyrogenesis", trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" }
|
||||
newoption { category = "Pyrogenesis", trigger = "with-valgrind", description = "Enable Valgrind support (non-Windows only)" }
|
||||
newoption { category = "Pyrogenesis", trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" }
|
||||
|
|
@ -170,7 +170,7 @@ end
|
|||
-- The pc file doesn't specify the required -DDEBUG needed in that case
|
||||
local mozjs_is_debug_build = false
|
||||
if _OPTIONS["with-system-mozjs"] then
|
||||
local _, errorCode = os.outputof(cc .. " $(pkg-config mozjs-128 --cflags) ./tests/mozdebug.c -o /dev/null")
|
||||
local _, errorCode = os.outputof(cc .. " $(pkg-config mozjs-140 --cflags) ./tests/mozdebug.c -o /dev/null")
|
||||
if errorCode ~= 0 then
|
||||
mozjs_is_debug_build = true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ set -e
|
|||
cd "$(dirname "$0")"
|
||||
|
||||
# This should match the version in config/milestone.txt
|
||||
PV=128.13.0
|
||||
PV=140.13.0
|
||||
FOLDER="mozjs-${PV}"
|
||||
# If same-version changes are needed, increment this.
|
||||
LIB_VERSION="${PV}+wfg5"
|
||||
LIB_NAME="mozjs128"
|
||||
LIB_VERSION="${PV}+wfg0"
|
||||
LIB_NAME="mozjs-140"
|
||||
|
||||
build_archive()
|
||||
{
|
||||
|
|
@ -196,6 +196,20 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
# Bug #1987410
|
||||
# SpiderMonkey vendors a patched fmtlib, and it copies it to include dirs, so we have to rename it
|
||||
# to not have it conflicting with the regular fmtlib
|
||||
(
|
||||
cd "${FOLDER}"/build-debug/dist/include
|
||||
mv fmt/ mozfmt/
|
||||
patch -p1 <../../../../patches/StashVendoredLibfmt-FixIncludes.patch
|
||||
)
|
||||
(
|
||||
cd "${FOLDER}"/build-release/dist/include
|
||||
mv fmt/ mozfmt/
|
||||
patch -p1 <../../../../patches/StashVendoredLibfmt-FixIncludes.patch
|
||||
)
|
||||
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
# Bug #776126
|
||||
# SpiderMonkey uses a tweaked zlib when building, and it wrongly copies its own files to include dirs
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
# HG changeset patch
|
||||
# User Itms <itms@wildfiregames.com>
|
||||
# Date 1754863729 0
|
||||
# Node ID 45a4336df6a83fbb6a448fe5ec14b703b38313d9
|
||||
# Parent 1ecdcb55f42515c6542d4f9d4580899d55a6a790
|
||||
Bug 1982134 - Choose specific callback in removeBlackRootsTracer. a=RyanVM
|
||||
|
||||
This fixes a regression introduced in the refactoring at Bug 1846835 / D185307
|
||||
|
||||
Original Revision: https://phabricator.services.mozilla.com/D260541
|
||||
|
||||
Differential Revision: https://phabricator.services.mozilla.com/D260608
|
||||
|
||||
|
||||
diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
|
||||
--- a/js/src/gc/GC.cpp
|
||||
+++ b/js/src/gc/GC.cpp
|
||||
@@ -1559,17 +1559,17 @@ static bool EraseCallback(CallbackVector
|
||||
|
||||
bool GCRuntime::addBlackRootsTracer(JSTraceDataOp traceOp, void* data) {
|
||||
AssertHeapIsIdle();
|
||||
return blackRootTracers.ref().append(Callback<JSTraceDataOp>(traceOp, data));
|
||||
}
|
||||
|
||||
void GCRuntime::removeBlackRootsTracer(JSTraceDataOp traceOp, void* data) {
|
||||
// Can be called from finalizers
|
||||
- MOZ_ALWAYS_TRUE(EraseCallback(blackRootTracers.ref(), traceOp));
|
||||
+ MOZ_ALWAYS_TRUE(EraseCallback(blackRootTracers.ref(), traceOp, data));
|
||||
}
|
||||
|
||||
void GCRuntime::setGrayRootsTracer(JSGrayRootsTracer traceOp, void* data) {
|
||||
AssertHeapIsIdle();
|
||||
grayRootTracer.ref() = {traceOp, data};
|
||||
}
|
||||
|
||||
void GCRuntime::clearBlackAndGrayRootTracers() {
|
||||
|
||||
|
|
@ -1,16 +1,18 @@
|
|||
--- a/js/src/old-configure
|
||||
+++ b/js/src/old-configure
|
||||
@@ -2595,10 +2595,10 @@
|
||||
fi
|
||||
--- a/js/moz.configure
|
||||
+++ b/js/moz.configure
|
||||
@@ -1425,10 +1425,13 @@
|
||||
|
||||
|
||||
-if test -n "$JS_STANDALONE"; then
|
||||
-JS_LIBRARY_NAME="mozjs-$MOZILLA_SYMBOLVERSION"
|
||||
+if test -n "$MOZ_DEBUG"; then
|
||||
+JS_LIBRARY_NAME="mozjs$MOZILLA_SYMBOLVERSION-debug"
|
||||
else
|
||||
-JS_LIBRARY_NAME="mozjs"
|
||||
+JS_LIBRARY_NAME="mozjs$MOZILLA_SYMBOLVERSION-release"
|
||||
fi
|
||||
JS_CONFIG_LIBS="$NSPR_LIBS $LIBS"
|
||||
if test "$CC_TYPE" != clang-cl ; then
|
||||
# JavaScript shell
|
||||
# ==============================================================
|
||||
-@depends(milestone.symbolversion, js_standalone)
|
||||
-def js_library_name(symbolversion, js_standalone):
|
||||
+@depends(milestone.symbolversion, js_standalone, moz_debug)
|
||||
+def js_library_name(symbolversion, js_standalone, moz_debug):
|
||||
if js_standalone:
|
||||
- return f"mozjs-{symbolversion}"
|
||||
+ if moz_debug:
|
||||
+ return f"mozjs-{symbolversion}-debug"
|
||||
+ else:
|
||||
+ return f"mozjs-{symbolversion}-release"
|
||||
else:
|
||||
return "mozjs"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
diff --git a/js/experimental/LoggingInterface.h b/js/experimental/LoggingInterface.h
|
||||
index 6774755..f1039c1 100644
|
||||
--- a/js/experimental/LoggingInterface.h
|
||||
+++ b/js/experimental/LoggingInterface.h
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "mozilla/LoggingCore.h"
|
||||
|
||||
#include "jstypes.h"
|
||||
-#include "fmt/format.h"
|
||||
+#include "mozfmt/format.h"
|
||||
#include "js/GCAPI.h"
|
||||
|
||||
struct JSContext;
|
||||
diff --git a/mozilla/Casting.h b/mozilla/Casting.h
|
||||
index e6b1206..d07d2a8 100644
|
||||
--- a/mozilla/Casting.h
|
||||
+++ b/mozilla/Casting.h
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
|
||||
-#include "fmt/format.h"
|
||||
+#include "mozfmt/format.h"
|
||||
|
||||
#include <cinttypes>
|
||||
#include <cstring>
|
||||
7626
libraries/source/spidermonkey/patches/StashVendoredLibfmt.patch
Normal file
7626
libraries/source/spidermonkey/patches/StashVendoredLibfmt.patch
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,46 +0,0 @@
|
|||
|
||||
# HG changeset patch
|
||||
# User Steve Fink <sfink@mozilla.com>
|
||||
# Date 1746227785 0
|
||||
# Node ID 5c04f022856284273c3f1a0367a599431798bab3
|
||||
# Parent 0a9b2997cbcf9652ce9440ba74cbbb3bf513a937
|
||||
Bug 1953622 - Suppress -Wdangling-pointer warning when storing a Rooted address r=spidermonkey-reviewers,jonco
|
||||
|
||||
Differential Revision: https://phabricator.services.mozilla.com/D241310
|
||||
|
||||
|
||||
diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h
|
||||
--- a/js/public/RootingAPI.h
|
||||
+++ b/js/public/RootingAPI.h
|
||||
@@ -1140,21 +1140,30 @@ using RootedTraits =
|
||||
* function that requires a handle, e.g. Foo(Root<T>(cx, x)).
|
||||
*
|
||||
* If you want to add additional methods to Rooted for a specific
|
||||
* specialization, define a RootedOperations<T> specialization containing them.
|
||||
*/
|
||||
template <typename T>
|
||||
class MOZ_RAII Rooted : public detail::RootedTraits<T>::StackBase,
|
||||
public js::RootedOperations<T, Rooted<T>> {
|
||||
+
|
||||
+ // Intentionally store a pointer into the stack.
|
||||
+#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 12)
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Wdangling-pointer"
|
||||
+#endif
|
||||
inline void registerWithRootLists(RootedListHeads& roots) {
|
||||
this->stack = &roots[JS::MapTypeToRootKind<T>::kind];
|
||||
this->prev = *this->stack;
|
||||
*this->stack = this;
|
||||
}
|
||||
+#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 12)
|
||||
+#pragma GCC diagnostic pop
|
||||
+#endif
|
||||
|
||||
inline RootedListHeads& rootLists(RootingContext* cx) {
|
||||
return cx->stackRoots_;
|
||||
}
|
||||
inline RootedListHeads& rootLists(JSContext* cx) {
|
||||
return rootLists(RootingContext::get(cx));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -18,10 +18,6 @@ patch -p1 <"${PATCHES}"/FixLibNames.diff
|
|||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1935346
|
||||
patch -p1 <"${PATCHES}"/FixPkgConfigDebug.diff
|
||||
|
||||
# Fix a regression in GC tracing, which creates segfaults during GCs
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1982134
|
||||
patch -p1 <"${PATCHES}"/FixExtraGCTracing.diff
|
||||
|
||||
# There is an issue on 32-bit linux builds sometimes.
|
||||
# NB: the patch here is Comment 21 modified by Comment 25
|
||||
# but that seems to imperfectly fix the issue with GCC.
|
||||
|
|
@ -41,12 +37,17 @@ if [ "${OS}" = "Darwin" ]; then
|
|||
patch -p1 <"${PATCHES}"/FixMacOSBuild.diff
|
||||
fi
|
||||
|
||||
# Supress warning on newer GCC compilers.
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1953622
|
||||
patch -p1 <"${PATCHES}"/SuppressDanglingPointerWarning.patch
|
||||
|
||||
# Fix building with python 3.14
|
||||
patch -p1 <"${PATCHES}"/FixPython3_14.diff
|
||||
|
||||
# Fix conflicts between vendored fmtlib in SM and our own use of fmtlib.
|
||||
# This is not upstreamable and can be dropped when we use std::format (can be done in R30 when
|
||||
# we move to ESR153 which requires C++20 anyway).
|
||||
# Note: after building SM, it is still needed to rename the fmt include directory so that our
|
||||
# compiler doesn't mix up the vendored fmtlib headers and the actual ones. The -FixIncludes patch
|
||||
# is applied to dist/include after building.
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1987410
|
||||
patch -p1 <"${PATCHES}"/StashVendoredLibfmt.patch
|
||||
|
||||
# Cherry-pick an upstream commit to allow passing custom flags to ar
|
||||
patch -p1 <"${PATCHES}"/UpstreamCustomARFlags.patch
|
||||
|
|
|
|||
Loading…
Reference in a new issue