1
0
forked from mirrors/0ad

Upgrade SpiderMonkey to ESR 115

This commit is contained in:
Itms
2024-10-25 10:22:43 +02:00
parent cc72142205
commit 0de5f2fb25
19 changed files with 103 additions and 147 deletions
+2 -2
View File
@@ -27,8 +27,8 @@ pipeline {
agent {
node {
label 'macOSAgent'
customWorkspace 'workspace/clang10'
label 'macOSAgentVentura'
customWorkspace 'workspace/clang13'
}
}
+6 -6
View File
@@ -639,7 +639,7 @@ extern_lib_defs = {
compile_settings = function()
if _OPTIONS["with-system-mozjs"] then
if not _OPTIONS["android"] then
pkgconfig.add_includes_after("mozjs-102")
pkgconfig.add_includes_after("mozjs-115")
end
else
filter "Debug"
@@ -661,17 +661,17 @@ extern_lib_defs = {
link_settings = function()
if _OPTIONS["with-system-mozjs"] then
if _OPTIONS["android"] then
links { "mozjs-102" }
links { "mozjs-115" }
else
pkgconfig.add_links("mozjs-102")
pkgconfig.add_links("mozjs-115")
end
else
filter { "Debug" }
links { "mozjs102-debug" }
links { "mozjs115-debug" }
filter { "Release" }
links { "mozjs102-release" }
links { "mozjs115-release" }
filter { }
links { "mozjs102-rust" }
links { "mozjs115-rust" }
add_source_lib_paths("spidermonkey")
end
end,
+2 -2
View File
@@ -8,7 +8,7 @@ newoption { trigger = "minimal-flags", description = "Only set compiler/linker f
newoption { trigger = "outpath", description = "Location for generated project files", default="../workspaces/default" }
newoption { trigger = "with-system-cxxtest", description = "Search standard paths for cxxtest, instead of using bundled copy" }
newoption { trigger = "with-lto", description = "Enable Link Time Optimization (LTO)" }
newoption { trigger = "with-system-mozjs", description = "Search standard paths for libmozjs102, instead of using bundled copy" }
newoption { trigger = "with-system-mozjs", description = "Search standard paths for libmozjs115, instead of using bundled copy" }
newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" }
newoption { trigger = "with-valgrind", description = "Enable Valgrind support (non-Windows only)" }
newoption { trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" }
@@ -121,7 +121,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-102 --cflags) ./tests/mozdebug.c -o /dev/null")
local _, errorCode = os.outputof(cc .. " $(pkg-config mozjs-115 --cflags) ./tests/mozdebug.c -o /dev/null")
if errorCode ~= 0 then
mozjs_is_debug_build = true
end
+2 -2
View File
@@ -2,7 +2,7 @@ rem **Download sources and binaries of libraries**
rem **SVN revision to checkout for windows-libs**
rem **Update this line when you commit an update to windows-libs**
set "svnrev=28234"
set "svnrev=28235"
svn co https://svn.wildfiregames.com/public/windows-libs/trunk@%svnrev% win32
@@ -24,4 +24,4 @@ for %%d in (%TOOLCHAIN_DIR_LIST%) do (
if exist win32\%%d\bin\ (
copy /y win32\%%d\bin\* ..\build\bin\
)
)
)
+4 -4
View File
@@ -4,10 +4,10 @@ set -e
cd "$(dirname "$0")"
# This should match the version in config/milestone.txt
FOLDER="mozjs-102.15.1"
FOLDER="mozjs-115.16.1"
# If same-version changes are needed, increment this.
LIB_VERSION="102.15.1+0"
LIB_NAME="mozjs102"
LIB_VERSION="115.16.1+0"
LIB_NAME="mozjs115"
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "Spidermonkey is already up to date."
@@ -17,7 +17,7 @@ fi
OS="${OS:=$(uname -s)}"
# fetch
# This tarball is built from https://ftp.mozilla.org/pub/firefox/releases/102.15.1esr/source
# This tarball is built from https://ftp.mozilla.org/pub/firefox/releases/115.16.1esr/source/
# by running js/src/make-source-package.py
if [ ! -e "${FOLDER}.tar.xz" ]; then
curl -fLo "${FOLDER}.tar.xz" \
@@ -0,0 +1,45 @@
# HG changeset patch
# User Mike Hommey <mh+mozilla@glandium.org>
# Date 1714550740 0
# Node ID 223087fdc29f18678f6174e9807b8780e439acf6
# Parent dbf00dfdc037f79df923fbb6681de64bc74c5a8e
Bug 1894423 - Remove unused ExclusiveData move constructor. r=spidermonkey-reviewers,jonco
Because the constructor is actually not used, the compiler used to not
complain about it being broken. Recent changes on clang trunk made it
catch this problem without the constructor being used.
As Mutex doesn't have a move constructor, it's also not only a matter of
adding the missing underscore to lock.
As the constructor is never used, just remove it.
Differential Revision: https://phabricator.services.mozilla.com/D209108
diff --git a/js/src/threading/ExclusiveData.h b/js/src/threading/ExclusiveData.h
--- a/js/src/threading/ExclusiveData.h
+++ b/js/src/threading/ExclusiveData.h
@@ -104,21 +104,16 @@ class ExclusiveData {
/**
* Create a new `ExclusiveData`, constructing the protected value in place.
*/
template <typename... Args>
explicit ExclusiveData(const MutexId& id, Args&&... args)
: lock_(id), value_(std::forward<Args>(args)...) {}
- ExclusiveData(ExclusiveData&& rhs)
- : lock_(std::move(rhs.lock)), value_(std::move(rhs.value_)) {
- MOZ_ASSERT(&rhs != this, "self-move disallowed!");
- }
-
ExclusiveData& operator=(ExclusiveData&& rhs) {
this->~ExclusiveData();
new (mozilla::KnownNotNull, this) ExclusiveData(std::move(rhs));
return *this;
}
/**
* An RAII class that provides exclusive access to a `ExclusiveData<T>`'s
@@ -1,35 +0,0 @@
# HG changeset patch
# User Mike Hommey <mh+mozilla@glandium.org>
# Date 1684789421 0
# Node ID 888d869b7f7534934ec2d0f63beeb4cb55860661
# Parent b15de32be05d9c1ef2e783b468e6e0c3601217ff
Bug 1751561 - Don't include DllMain when mozglue is linked statically. r=jandem
mozglue has its own DllMain, which conflicts with this one.
Differential Revision: https://phabricator.services.mozilla.com/D178410
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -4224,17 +4224,17 @@ #else
*valueOut = 0;
#endif
return true;
}
/************************************************************************/
#if !defined(STATIC_EXPORTABLE_JS_API) && !defined(STATIC_JS_API) && \
- defined(XP_WIN)
+ defined(XP_WIN) && (defined(MOZ_MEMORY) || !defined(JS_STANDALONE))
# include "util/WindowsWrapper.h"
/*
* Initialization routine for the JS DLL.
*/
BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved) {
return TRUE;
@@ -0,0 +1,17 @@
diff --git a/build/moz.configure/pkg.configure b/build/moz.configure/pkg.configure
--- a/build/moz.configure/pkg.configure
+++ b/build/moz.configure/pkg.configure
@@ -14,11 +14,11 @@
"PKG_CONFIG",
pkg_config,
bootstrap=depends(when=target_sysroot.bootstrapped)(lambda: "pkgconf"),
allow_missing=True,
when=compile_environment
- & depends(target.os)(lambda os: os not in ("WINNT", "OSX", "Android")),
+ & depends(target.os)(lambda os: os not in ("WINNT", "Android")),
)
@depends_if(pkg_config)
@checking("for pkg-config version")
@@ -1,36 +0,0 @@
# HG changeset patch
# User Mike Hommey <mh+mozilla@glandium.org>
# Date 1663730995 0
# Node ID 8e4ceab106b12c3816163829494ac5e7938a6be6
# Parent ef44d7041454440fdd144b79c115c8d6439ec31a
Bug 1790540 - Gracefully handle when topobjdir is not set in MozbuildObject.mozconfig. r=firefox-build-system-reviewers,nalexander
This is a condition that happens when going through the js/src code path
in build/moz.configure/init.configure:mozconfig.
Differential Revision: https://phabricator.services.mozilla.com/D157769
diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -193,17 +193,17 @@ class MozbuildObject(ProcessExecutionMix
# If we can't resolve topobjdir, oh well. We'll figure out when we need
# one.
return cls(
topsrcdir, None, None, topobjdir=topobjdir, mozconfig=mozconfig, **kwargs
)
def resolve_mozconfig_topobjdir(self, default=None):
- topobjdir = self.mozconfig["topobjdir"] or default
+ topobjdir = self.mozconfig.get("topobjdir") or default
if not topobjdir:
return None
if "@CONFIG_GUESS@" in topobjdir:
topobjdir = topobjdir.replace("@CONFIG_GUESS@", self.resolve_config_guess())
if not os.path.isabs(topobjdir):
topobjdir = os.path.abspath(os.path.join(self.topsrcdir, topobjdir))
@@ -1,41 +0,0 @@
# HG changeset patch
# User Mike Hommey <mh+mozilla@glandium.org>
# Date 1684810882 0
# Node ID 9c84e12328a105874d1769800bb132e78befc8b2
# Parent 1e6bdb2d359480234077ac0ec5592dced8184921
Bug 1802675 - Don't build winheap.cpp when mozglue is a static library. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D163383
diff --git a/memory/mozalloc/moz.build b/memory/mozalloc/moz.build
--- a/memory/mozalloc/moz.build
+++ b/memory/mozalloc/moz.build
@@ -17,20 +17,22 @@ if CONFIG["WRAP_STL_INCLUDES"]:
EXPORTS.mozilla += ["throw_gcc.h"]
elif CONFIG["CC_TYPE"] == "clang-cl":
DEFINES["_HAS_EXCEPTIONS"] = 0
SOURCES += [
"msvc_raise_wrappers.cpp",
]
if CONFIG["OS_TARGET"] == "WINNT":
- # Keep this file separate to avoid #include'ing windows.h everywhere.
- SOURCES += [
- "winheap.cpp",
- ]
+ # Don't build winheap.cpp when mozglue is a static library.
+ if CONFIG["MOZ_MEMORY"] or not CONFIG["JS_STANDALONE"]:
+ # Keep this file separate to avoid #include'ing windows.h everywhere.
+ SOURCES += [
+ "winheap.cpp",
+ ]
UNIFIED_SOURCES += [
"mozalloc.cpp",
"mozalloc_abort.cpp",
"mozalloc_oom.cpp",
]
if CONFIG["MOZ_MEMORY"]:
+11 -11
View File
@@ -14,17 +14,12 @@ patch -p1 <"${PATCHES}"/FixRustLinkage.diff
# Differentiate debug/release library names.
patch -p1 <"${PATCHES}"/FixLibNames.diff
# Fix Windows build environment under MozillaBuild 4, fixed in ESR 115
# https://bugzilla.mozilla.org/show_bug.cgi?id=1790540
patch -p1 <"${PATCHES}"/FixMozillaBuild4.diff
# Fix Windows build, fixed in ESR 115
# https://bugzilla.mozilla.org/show_bug.cgi?id=1802675
patch -p1 <"${PATCHES}"/FixWinHeap.diff
# Fix linking on Windows with mozglue, fixed in ESR 115
# https://bugzilla.mozilla.org/show_bug.cgi?id=1751561
patch -p1 <"${PATCHES}"/FixDllMain.diff
# On macOS, embedded build is broken due to a faulty check for pkg-config
# https://bugzilla.mozilla.org/show_bug.cgi?id=1776255
# The fix above is included in ESR 128, but does not apply to 115
# Instead, require pkg-config on macOS even though it's not needed here
# (from https://bugzilla.mozilla.org/show_bug.cgi?id=1783570)
patch -p1 <"${PATCHES}"/FixMacOSPkgConfig.diff
# There is an issue on 32-bit linux builds sometimes.
# NB: the patch here is Comment 21 modified by Comment 25
@@ -34,3 +29,8 @@ patch -p1 <"${PATCHES}"/FixDllMain.diff
if [ "$(uname -m)" = "i686" ] && [ "${OS}" != "Windows_NT" ]; then
patch -p1 <"${PATCHES}"/FixFpNormIssue.diff
fi
# Fix build with clang19
# https://bugzilla.mozilla.org/show_bug.cgi?id=1894423
# Fixed in ESR 128
patch -p1 <"${PATCHES}"/FixClang19.diff
+1 -1
View File
@@ -470,7 +470,7 @@ void CGUI::SetGlobalHotkey(const CStr& hotkeyTag, const CStr& eventName, JS::Han
return;
}
if (!function.isObject() || !JS_ObjectIsFunction(&function.toObject()))
if (!function.isObject() || !JS::IsCallable(&function.toObject()))
{
ScriptException::Raise(rq, "Cannot assign non-function value to global hotkey '%s'", hotkeyTag.c_str());
return;
@@ -269,7 +269,7 @@ bool JSI_GUIProxy<T>::set(JSContext* cx, JS::HandleObject proxy, JS::HandleId id
// Use onWhatever to set event handlers
if (propName.substr(0, 2) == "on")
{
if (vp.isPrimitive() || vp.isNull() || !JS_ObjectIsFunction(&vp.toObject()))
if (vp.isPrimitive() || vp.isNull() || !JS::IsCallable(&vp.toObject()))
{
LOGERROR("on- event-handlers must be functions");
return result.fail(JSMSG_NOT_FUNCTION);
+1
View File
@@ -20,6 +20,7 @@
#if MSC_VERSION
# pragma warning(push, 1)
# pragma warning(disable: 4068)
#endif
#include "js/Promise.h"
#if MSC_VERSION
@@ -38,6 +38,8 @@
#if MSC_VERSION
// reduce the warning level for the SpiderMonkey headers
# pragma warning(push, 1)
// ignore C4291 in <mozilla/Maybe.h>
# pragma warning(disable: 4291)
#endif
// Redefine signbit to fix build error in GCC
+1
View File
@@ -31,6 +31,7 @@
#if MSC_VERSION
# pragma warning(push, 1)
# pragma warning(disable: 4100)
# pragma warning(disable: 4068)
#endif
+2 -2
View File
@@ -496,8 +496,8 @@ void ScriptInterface::DefineCustomObjectType(JSClass *clasp, JSNative constructo
}
JS::RootedObject global(rq.cx, rq.glob);
JS::RootedObject obj(rq.cx, JS_InitClass(rq.cx, global, nullptr,
clasp,
JS::RootedObject obj(rq.cx, JS_InitClass(rq.cx, global,
clasp, nullptr, clasp->name,
constructor, minArgs, // Constructor, min args
ps, fs, // Properties, methods
static_ps, static_fs)); // Constructor properties, methods
+4 -2
View File
@@ -61,6 +61,8 @@
# pragma warning(push, 1)
// ignore C4291 in <mozilla/Vector.h>
# pragma warning(disable: 4291)
// ignore C4068 in <mozilla/Casting.h>
# pragma warning(disable: 4068)
#endif
#include "jspubtd.h"
@@ -77,7 +79,7 @@
# pragma GCC diagnostic pop
#endif
#if MOZJS_MAJOR_VERSION != 102
#if MOZJS_MAJOR_VERSION != 115
#error Your compiler is trying to use an incorrect major version of the \
SpiderMonkey library. The only version that works is the one in the \
libraries/spidermonkey/ directory, and it will not work with a typical \
@@ -85,7 +87,7 @@ system-installed version. Make sure you have got all the right files and \
include paths.
#endif
#if MOZJS_MINOR_VERSION != 15
#if MOZJS_MINOR_VERSION != 16
#error Your compiler is trying to use an untested minor version of the \
SpiderMonkey library. If you are a package maintainer, please make sure \
to check very carefully that this version does not change the behaviour \
@@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -94,7 +94,7 @@ private:
const ScriptInterface& m_ScriptInterface;
ISerializer& m_Serializer;
using ObjectTagMap = JS::GCHashMap<JS::Heap<JSObject*>, u32, js::MovableCellHasher<JSObject*>, js::SystemAllocPolicy>;
using ObjectTagMap = JS::GCHashMap<JS::Heap<JSObject*>, u32, js::StableCellHasher<JSObject*>, js::SystemAllocPolicy>;
ObjectTagMap m_ScriptBackrefTags;
u32 m_ScriptBackrefsNext;
u32 GetScriptBackrefTag(JS::HandleObject obj);