Index: build/premake/extern_libs5.lua =================================================================== --- build/premake/extern_libs5.lua +++ build/premake/extern_libs5.lua @@ -534,9 +534,9 @@ }, spidermonkey = { compile_settings = function() - if _OPTIONS["with-system-mozjs45"] then + if _OPTIONS["with-system-mozjs52"] then if not _OPTIONS["android"] then - pkgconfig.add_includes("mozjs-45") + pkgconfig.add_includes("mozjs-52") end else if os.istarget("windows") then @@ -554,21 +554,21 @@ end end, link_settings = function() - if _OPTIONS["with-system-mozjs45"] then + if _OPTIONS["with-system-mozjs52"] then if _OPTIONS["android"] then - links { "mozjs-45" } + links { "mozjs-52" } else - pkgconfig.add_links("mozjs-45") + pkgconfig.add_links("mozjs-52") end else filter { "Debug", "action:vs2015" } - links { "mozjs45-ps-debug-vc140" } + links { "mozjs52-ps-debug-vc140" } filter { "Release", "action:vs2015" } - links { "mozjs45-ps-release-vc140" } + links { "mozjs52-ps-release-vc140" } filter { "Debug", "action:not vs*" } - links { "mozjs45-ps-debug" } + links { "mozjs52-ps-debug" } filter { "Release", "action:not vs*" } - links { "mozjs45-ps-release" } + links { "mozjs52-ps-release" } filter { } add_source_lib_paths("spidermonkey") end Index: build/premake/premake5.lua =================================================================== --- build/premake/premake5.lua +++ build/premake/premake5.lua @@ -6,7 +6,7 @@ newoption { trigger = "jenkins-tests", description = "Configure CxxTest to use the XmlPrinter runner which produces Jenkins-compatible output" } newoption { trigger = "minimal-flags", description = "Only set compiler/linker flags that are really needed. Has no effect on Windows builds" } newoption { trigger = "outpath", description = "Location for generated project files" } -newoption { trigger = "with-system-mozjs45", description = "Search standard paths for libmozjs45, instead of using bundled copy" } +newoption { trigger = "with-system-mozjs52", description = "Search standard paths for libmozjs52, 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 = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" } newoption { trigger = "without-lobby", description = "Disable the use of gloox and the multiplayer lobby" } Index: libraries/osx/build-osx-libs.sh =================================================================== --- libraries/osx/build-osx-libs.sh +++ libraries/osx/build-osx-libs.sh @@ -48,12 +48,11 @@ SODIUM_VERSION="libsodium-1.0.18" # -------------------------------------------------------------- # Bundled with the game: -# * SpiderMonkey 45 +# * SpiderMonkey # * NVTT # * FCollada # -------------------------------------------------------------- # We use suffixes here in order to force rebuilding when patching these libs -SPIDERMONKEY_VERSION="mozjs-45.0.2+wildfiregames.2" NVTT_VERSION="nvtt-2.1.1+wildfiregames.1" FCOLLADA_VERSION="fcollada-3.05+wildfiregames.1" # -------------------------------------------------------------- @@ -911,88 +910,17 @@ # be customized, so we build and install them from bundled sources # -------------------------------------------------------------------- # SpiderMonkey - bundled, no download -echo -e "Building SpiderMonkey..." - -LIB_VERSION="${SPIDERMONKEY_VERSION}" -LIB_DIRECTORY="mozjs-45.0.2" -LIB_ARCHIVE="$LIB_DIRECTORY.tar.bz2" - pushd ../source/spidermonkey/ > /dev/null -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] +if [[ "$force_rebuild" = "true" ]] then - INSTALL_DIR="$(pwd)" - INCLUDE_DIR_DEBUG=$INSTALL_DIR/include-unix-debug - INCLUDE_DIR_RELEASE=$INSTALL_DIR/include-unix-release - rm -f .already-built - rm -f lib/*.a - rm -rf $LIB_DIRECTORY $INCLUDE_DIR_DEBUG $INCLUDE_DIR_RELEASE - tar -xf $LIB_ARCHIVE - - # Apply patches - pushd $LIB_DIRECTORY - . ../patch.sh - popd - - pushd $LIB_DIRECTORY/js/src - - CONF_OPTS="--target=$ARCH-apple-darwin - --prefix=${INSTALL_DIR} - --enable-posix-nspr-emulation - --with-system-zlib=${ZLIB_DIR} - --disable-tests - --disable-shared-js - --disable-jemalloc - --without-intl-api" - # Change the default location where the tracelogger should store its output, which is /tmp/ on OSX. - TLCXXFLAGS='-DTRACE_LOG_DIR="\"../../source/tools/tracelogger/\""' - if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then - CONF_OPTS="$CONF_OPTS --enable-macos-target=$MIN_OSX_VERSION" - fi - if [[ $SYSROOT && ${SYSROOT-_} ]]; then - CONF_OPTS="$CONF_OPTS --with-macosx-sdk=$SYSROOT" - fi - - # We want separate debug/release versions of the library, so change their install name in the Makefile - perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1'\''mozjs45-ps-debug'\''/' moz.build - mkdir -p build-debug - pushd build-debug - (CC="clang" CXX="clang++" CXXFLAGS="${TLCXXFLAGS}" AR=ar CROSS_COMPILE=1 \ - ../configure $CONF_OPTS \ - --enable-debug \ - --disable-optimize \ - --enable-js-diagnostics \ - --enable-gczeal \ - && make ${JOBS}) || die "SpiderMonkey build failed" - # js-config.h is different for debug and release builds, so we need different include directories for both - mkdir -p $INCLUDE_DIR_DEBUG - cp -R -L dist/include/* $INCLUDE_DIR_DEBUG/ - cp dist/sdk/lib/*.a $INSTALL_DIR/lib - cp js/src/*.a $INSTALL_DIR/lib - popd - mv moz.build.bak moz.build - - perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1'\''mozjs45-ps-release'\''/' moz.build - mkdir -p build-release - pushd build-release - (CC="clang" CXX="clang++" CXXFLAGS="${TLCXXFLAGS}" AR=ar CROSS_COMPILE=1 \ - ../configure $CONF_OPTS \ - --enable-optimize \ - && make ${JOBS}) || die "SpiderMonkey build failed" - # js-config.h is different for debug and release builds, so we need different include directories for both - mkdir -p $INCLUDE_DIR_RELEASE - cp -R -L dist/include/* $INCLUDE_DIR_RELEASE/ - cp dist/sdk/lib/*.a $INSTALL_DIR/lib - cp js/src/*.a $INSTALL_DIR/lib - popd - mv moz.build.bak moz.build - - popd - echo "$LIB_VERSION" > .already-built -else - already_built fi + +# Use the regular build script for SM. +export ZLIB_DIR="$ZLIB_DIR" +JOBS="$JOBS" ./build.sh + popd > /dev/null # -------------------------------------------------------------- Index: libraries/source/spidermonkey/DisableGCC9WerrorFormat.diff =================================================================== --- /dev/null +++ libraries/source/spidermonkey/DisableGCC9WerrorFormat.diff @@ -0,0 +1,26 @@ +diff --git a/js/src/moz.build b/js/src/moz.build +--- a/js/src/moz.build 2020-07-16 11:42:39.578932510 +0200 ++++ b/js/src/moz.build 2020-07-16 11:45:18.937079912 +0200 +@@ -785,7 +785,7 @@ + DEFINES['FFI_BUILDING'] = True + + if CONFIG['GNU_CXX']: +- CXXFLAGS += ['-Wno-shadow', '-Werror=format'] ++ CXXFLAGS += ['-Wno-shadow'] + + # Suppress warnings in third-party code. + if CONFIG['CLANG_CXX']: +diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build +--- a/js/src/shell/moz.build 2020-07-16 11:46:16.786621311 +0200 ++++ b/js/src/shell/moz.build 2020-07-16 11:46:35.616493037 +0200 +@@ -51,7 +51,7 @@ + ] + + if CONFIG['GNU_CXX']: +- CXXFLAGS += ['-Wno-shadow', '-Werror=format'] ++ CXXFLAGS += ['-Wno-shadow'] + + # This is intended as a temporary workaround to enable VS2015. + if CONFIG['_MSC_VER']: + + Index: libraries/source/spidermonkey/ExportJSPropertyDescriptor.diff =================================================================== --- libraries/source/spidermonkey/ExportJSPropertyDescriptor.diff +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/js/src/jsapi.h b/js/src/jsapi.h -index 29406243..2370457f 100644 ---- a/js/src/jsapi.h -+++ b/js/src/jsapi.h -@@ -2399,7 +2399,7 @@ JS_FreezeObject(JSContext* cx, JS::Handle obj); - - /*** Property descriptors ************************************************************************/ - --struct JSPropertyDescriptor : public JS::Traceable { -+struct JS_PUBLIC_API(JSPropertyDescriptor) : public JS::Traceable { - JSObject* obj; - unsigned attrs; - JSGetterOp getter; -diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h -index ba592525..3c185527 100644 ---- a/js/src/jspubtd.h -+++ b/js/src/jspubtd.h -@@ -97,7 +97,7 @@ struct JSFunctionSpec; - struct JSLocaleCallbacks; - struct JSObjectMap; - struct JSPrincipals; --struct JSPropertyDescriptor; -+struct JS_PUBLIC_API(JSPropertyDescriptor); - struct JSPropertyName; - struct JSPropertySpec; - struct JSRuntime; Index: libraries/source/spidermonkey/FixLinking.diff =================================================================== --- libraries/source/spidermonkey/FixLinking.diff +++ /dev/null @@ -1,49 +0,0 @@ -From dcf520da15d940c900d7e8ffd5a9b05427c54dc8 Mon Sep 17 00:00:00 2001 -From: Philip Chimento -Date: Wed, 5 Jul 2017 22:47:44 -0700 -Subject: [PATCH 4/9] headers: Fix symbols visibility - -Some symbols that need to be public are not marked as such. ---- - js/public/Utility.h | 2 +- - js/src/jsalloc.h | 4 +++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/js/public/Utility.h b/js/public/Utility.h -index 75214c32..f50fd8dd 100644 ---- a/js/public/Utility.h -+++ b/js/public/Utility.h -@@ -77,7 +77,7 @@ enum ThreadType { - # if defined(DEBUG) || defined(JS_OOM_BREAKPOINT) - extern bool InitThreadType(void); - extern void SetThreadType(ThreadType); --extern uint32_t GetThreadType(void); -+extern JS_FRIEND_API(uint32_t) GetThreadType(void); - # else - inline bool InitThreadType(void) { return true; } - inline void SetThreadType(ThreadType t) {}; -diff --git a/js/src/jsalloc.h b/js/src/jsalloc.h -index b9ae5190..234ea9dc 100644 ---- a/js/src/jsalloc.h -+++ b/js/src/jsalloc.h -@@ -17,6 +17,8 @@ - #include "js/TypeDecls.h" - #include "js/Utility.h" - -+extern JS_PUBLIC_API(void) JS_ReportOutOfMemory(JSContext* cx); -+ - namespace js { - - enum class AllocFunction { -@@ -130,7 +132,7 @@ class TempAllocPolicy - - bool checkSimulatedOOM() const { - if (js::oom::ShouldFailWithOOM()) { -- js::ReportOutOfMemory(reinterpret_cast(cx_)); -+ JS_ReportOutOfMemory(reinterpret_cast(cx_)); - return false; - } - --- -2.11.0 (Apple Git-81) - Index: libraries/source/spidermonkey/FixMSVCBuild.diff =================================================================== --- /dev/null +++ libraries/source/spidermonkey/FixMSVCBuild.diff @@ -0,0 +1,447 @@ + +# HG changeset patch +# User Vladimir Vukicevic +# Date 1479240485 21600 +# Node ID 9822e0525b82bcca19078eab6532c8972977a156 +# Parent 07fa89dfac8390c8529181cbf818b6e5c1a75bf1 +Bug 1300925 - Change Intl.cpp stubs to an anonymous namespace. r=Waldo + +MozReview-Commit-ID: 9Ed1gglWsby + +diff --git a/js/src/builtin/Intl.cpp b/js/src/builtin/Intl.cpp +--- a/js/src/builtin/Intl.cpp ++++ b/js/src/builtin/Intl.cpp +@@ -69,26 +69,28 @@ using mozilla::PodCopy; + * against ICU. However, we still want to compile this code in order to prevent + * bit rot. The following stub implementations for ICU functions make this + * possible. The functions using them should never be called, so they assert + * and return error codes. Signatures adapted from ICU header files locid.h, + * numsys.h, ucal.h, ucol.h, udat.h, udatpg.h, uenum.h, unum.h; see the ICU + * directory for license. + */ + ++namespace { ++ + typedef bool UBool; + typedef char16_t UChar; + typedef double UDate; + + enum UErrorCode { + U_ZERO_ERROR, + U_BUFFER_OVERFLOW_ERROR, + }; + +-static inline UBool ++inline UBool + U_FAILURE(UErrorCode code) + { + MOZ_CRASH("U_FAILURE: Intl API disabled"); + } + + inline const UChar* + Char16ToUChar(const char16_t* chars) + { +@@ -96,37 +98,37 @@ Char16ToUChar(const char16_t* chars) + } + + inline UChar* + Char16ToUChar(char16_t* chars) + { + MOZ_CRASH("Char16ToUChar: Intl API disabled"); + } + +-static int32_t ++int32_t + u_strlen(const UChar* s) + { + MOZ_CRASH("u_strlen: Intl API disabled"); + } + + struct UEnumeration; + +-static int32_t ++int32_t + uenum_count(UEnumeration* en, UErrorCode* status) + { + MOZ_CRASH("uenum_count: Intl API disabled"); + } + +-static const char* ++const char* + uenum_next(UEnumeration* en, int32_t* resultLength, UErrorCode* status) + { + MOZ_CRASH("uenum_next: Intl API disabled"); + } + +-static void ++void + uenum_close(UEnumeration* en) + { + MOZ_CRASH("uenum_close: Intl API disabled"); + } + + struct UCollator; + + enum UColAttribute { +@@ -151,54 +153,54 @@ enum UColAttributeValue { + }; + + enum UCollationResult { + UCOL_EQUAL = 0, + UCOL_GREATER = 1, + UCOL_LESS = -1 + }; + +-static int32_t ++int32_t + ucol_countAvailable() + { + MOZ_CRASH("ucol_countAvailable: Intl API disabled"); + } + +-static const char* ++const char* + ucol_getAvailable(int32_t localeIndex) + { + MOZ_CRASH("ucol_getAvailable: Intl API disabled"); + } + +-static UCollator* ++UCollator* + ucol_open(const char* loc, UErrorCode* status) + { + MOZ_CRASH("ucol_open: Intl API disabled"); + } + +-static void ++void + ucol_setAttribute(UCollator* coll, UColAttribute attr, UColAttributeValue value, UErrorCode* status) + { + MOZ_CRASH("ucol_setAttribute: Intl API disabled"); + } + +-static UCollationResult ++UCollationResult + ucol_strcoll(const UCollator* coll, const UChar* source, int32_t sourceLength, + const UChar* target, int32_t targetLength) + { + MOZ_CRASH("ucol_strcoll: Intl API disabled"); + } + +-static void ++void + ucol_close(UCollator* coll) + { + MOZ_CRASH("ucol_close: Intl API disabled"); + } + +-static UEnumeration* ++UEnumeration* + ucol_getKeywordValuesForLocale(const char* key, const char* locale, UBool commonlyUsed, + UErrorCode* status) + { + MOZ_CRASH("ucol_getKeywordValuesForLocale: Intl API disabled"); + } + + struct UParseError; + struct UFieldPosition; +@@ -227,76 +229,76 @@ enum UNumberFormatAttribute { + UNUM_MIN_SIGNIFICANT_DIGITS, + UNUM_MAX_SIGNIFICANT_DIGITS, + }; + + enum UNumberFormatTextAttribute { + UNUM_CURRENCY_CODE, + }; + +-static int32_t ++int32_t + unum_countAvailable() + { + MOZ_CRASH("unum_countAvailable: Intl API disabled"); + } + +-static const char* ++const char* + unum_getAvailable(int32_t localeIndex) + { + MOZ_CRASH("unum_getAvailable: Intl API disabled"); + } + +-static UNumberFormat* ++UNumberFormat* + unum_open(UNumberFormatStyle style, const UChar* pattern, int32_t patternLength, + const char* locale, UParseError* parseErr, UErrorCode* status) + { + MOZ_CRASH("unum_open: Intl API disabled"); + } + +-static void ++void + unum_setAttribute(UNumberFormat* fmt, UNumberFormatAttribute attr, int32_t newValue) + { + MOZ_CRASH("unum_setAttribute: Intl API disabled"); + } + +-static int32_t ++int32_t + unum_formatDouble(const UNumberFormat* fmt, double number, UChar* result, + int32_t resultLength, UFieldPosition* pos, UErrorCode* status) + { + MOZ_CRASH("unum_formatDouble: Intl API disabled"); + } + +-static void ++void + unum_close(UNumberFormat* fmt) + { + MOZ_CRASH("unum_close: Intl API disabled"); + } + +-static void ++void + unum_setTextAttribute(UNumberFormat* fmt, UNumberFormatTextAttribute tag, const UChar* newValue, + int32_t newValueLength, UErrorCode* status) + { + MOZ_CRASH("unum_setTextAttribute: Intl API disabled"); + } + + typedef void* UNumberingSystem; + +-static UNumberingSystem* ++UNumberingSystem* + unumsys_open(const char* locale, UErrorCode* status) + { + MOZ_CRASH("unumsys_open: Intl API disabled"); + } + +-static const char* ++const char* + unumsys_getName(const UNumberingSystem* unumsys) + { + MOZ_CRASH("unumsys_getName: Intl API disabled"); + } + +-static void ++void + unumsys_close(UNumberingSystem* unumsys) + { + MOZ_CRASH("unumsys_close: Intl API disabled"); + } + + typedef void* UCalendar; + + enum UCalendarType { +@@ -350,97 +352,97 @@ enum UCalendarDateFields { + UCAL_EXTENDED_YEAR, + UCAL_JULIAN_DAY, + UCAL_MILLISECONDS_IN_DAY, + UCAL_IS_LEAP_MONTH, + UCAL_FIELD_COUNT, + UCAL_DAY_OF_MONTH = UCAL_DATE + }; + +-static UCalendar* ++UCalendar* + ucal_open(const UChar* zoneID, int32_t len, const char* locale, + UCalendarType type, UErrorCode* status) + { + MOZ_CRASH("ucal_open: Intl API disabled"); + } + +-static const char* ++const char* + ucal_getType(const UCalendar* cal, UErrorCode* status) + { + MOZ_CRASH("ucal_getType: Intl API disabled"); + } + +-static UEnumeration* ++UEnumeration* + ucal_getKeywordValuesForLocale(const char* key, const char* locale, + UBool commonlyUsed, UErrorCode* status) + { + MOZ_CRASH("ucal_getKeywordValuesForLocale: Intl API disabled"); + } + +-static void ++void + ucal_close(UCalendar* cal) + { + MOZ_CRASH("ucal_close: Intl API disabled"); + } + +-static UCalendarWeekdayType ++UCalendarWeekdayType + ucal_getDayOfWeekType(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode* status) + { + MOZ_CRASH("ucal_getDayOfWeekType: Intl API disabled"); + } + +-static int32_t ++int32_t + ucal_getAttribute(const UCalendar* cal, + UCalendarAttribute attr) + { + MOZ_CRASH("ucal_getAttribute: Intl API disabled"); + } + +-static int32_t ++int32_t + ucal_get(const UCalendar *cal, UCalendarDateFields field, UErrorCode *status) + { + MOZ_CRASH("ucal_get: Intl API disabled"); + } + +-static UEnumeration* ++UEnumeration* + ucal_openTimeZones(UErrorCode* status) + { + MOZ_CRASH("ucal_openTimeZones: Intl API disabled"); + } + +-static int32_t ++int32_t + ucal_getCanonicalTimeZoneID(const UChar* id, int32_t len, UChar* result, int32_t resultCapacity, + UBool* isSystemID, UErrorCode* status) + { + MOZ_CRASH("ucal_getCanonicalTimeZoneID: Intl API disabled"); + } + +-static int32_t ++int32_t + ucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* status) + { + MOZ_CRASH("ucal_getDefaultTimeZone: Intl API disabled"); + } + + typedef void* UDateTimePatternGenerator; + +-static UDateTimePatternGenerator* ++UDateTimePatternGenerator* + udatpg_open(const char* locale, UErrorCode* pErrorCode) + { + MOZ_CRASH("udatpg_open: Intl API disabled"); + } + +-static int32_t ++int32_t + udatpg_getBestPattern(UDateTimePatternGenerator* dtpg, const UChar* skeleton, + int32_t length, UChar* bestPattern, int32_t capacity, + UErrorCode* pErrorCode) + { + MOZ_CRASH("udatpg_getBestPattern: Intl API disabled"); + } + +-static void ++void + udatpg_close(UDateTimePatternGenerator* dtpg) + { + MOZ_CRASH("udatpg_close: Intl API disabled"); + } + + typedef void* UCalendar; + typedef void* UDateFormat; + +@@ -486,87 +488,89 @@ enum UDateFormatField { + UDAT_FIELD_COUNT = 38 + }; + + enum UDateFormatStyle { + UDAT_PATTERN = -2, + UDAT_IGNORE = UDAT_PATTERN + }; + +-static int32_t ++int32_t + udat_countAvailable() + { + MOZ_CRASH("udat_countAvailable: Intl API disabled"); + } + +-static const char* ++const char* + udat_getAvailable(int32_t localeIndex) + { + MOZ_CRASH("udat_getAvailable: Intl API disabled"); + } + +-static UDateFormat* ++UDateFormat* + udat_open(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const char* locale, + const UChar* tzID, int32_t tzIDLength, const UChar* pattern, + int32_t patternLength, UErrorCode* status) + { + MOZ_CRASH("udat_open: Intl API disabled"); + } + +-static const UCalendar* ++const UCalendar* + udat_getCalendar(const UDateFormat* fmt) + { + MOZ_CRASH("udat_getCalendar: Intl API disabled"); + } + +-static void ++void + ucal_setGregorianChange(UCalendar* cal, UDate date, UErrorCode* pErrorCode) + { + MOZ_CRASH("ucal_setGregorianChange: Intl API disabled"); + } + +-static int32_t ++int32_t + udat_format(const UDateFormat* format, UDate dateToFormat, UChar* result, + int32_t resultLength, UFieldPosition* position, UErrorCode* status) + { + MOZ_CRASH("udat_format: Intl API disabled"); + } + +-static int32_t ++int32_t + udat_formatForFields(const UDateFormat* format, UDate dateToFormat, + UChar* result, int32_t resultLength, UFieldPositionIterator* fpositer, + UErrorCode* status) + { + MOZ_CRASH("udat_formatForFields: Intl API disabled"); + } + +-static UFieldPositionIterator* ++UFieldPositionIterator* + ufieldpositer_open(UErrorCode* status) + { + MOZ_CRASH("ufieldpositer_open: Intl API disabled"); + } + +-static void ++void + ufieldpositer_close(UFieldPositionIterator* fpositer) + { + MOZ_CRASH("ufieldpositer_close: Intl API disabled"); + } + +-static int32_t ++int32_t + ufieldpositer_next(UFieldPositionIterator* fpositer, int32_t* beginIndex, int32_t* endIndex) + { + MOZ_CRASH("ufieldpositer_next: Intl API disabled"); + } + +-static void ++void + udat_close(UDateFormat* format) + { + MOZ_CRASH("udat_close: Intl API disabled"); + } + ++} // anonymous namespace ++ + #endif + + + /******************** Common to Intl constructors ********************/ + + static bool + IntlInitialize(JSContext* cx, HandleObject obj, Handle initializer, + HandleValue locales, HandleValue options) + Index: libraries/source/spidermonkey/FixMozglue.diff =================================================================== --- /dev/null +++ libraries/source/spidermonkey/FixMozglue.diff @@ -0,0 +1,70 @@ +From 4de4b45ff25690aabd5797928b66005555379ffa Mon Sep 17 00:00:00 2001 +From: Till Schneidereit +Date: Thu, 1 Oct 2015 12:59:09 +0200 +Subject: [PATCH 5/9] Disable MOZ_GLUE_IN_PROGRAM in stand-alone builds on all + platforms + +Otherwise, build fails not being able to find HashBytes. + +Patch ported forward to mozjs52 by Philip Chimento +. + +https://bugzilla.mozilla.org/show_bug.cgi?id=1176787 +--- + js/src/old-configure.in | 23 ++++++++++++++--------- + mozglue/build/moz.build | 2 +- + 2 files changed, 15 insertions(+), 10 deletions(-) + +diff --git a/js/src/old-configure.in b/js/src/old-configure.in +index c40eb962..336e1aa7 100644 +--- a/js/src/old-configure.in ++++ b/js/src/old-configure.in +@@ -1620,16 +1620,21 @@ dnl ======================================================== + dnl = Enable jemalloc + dnl ======================================================== + +-case "${OS_TARGET}" in +-Android|WINNT|Darwin) ++dnl In stand-alone builds we always only want to link executables against mozglue. ++if test "$JS_STANDALONE"; then + MOZ_GLUE_IN_PROGRAM= +- ;; +-*) +- dnl On !Android !Windows !OSX, we only want to link executables against mozglue +- MOZ_GLUE_IN_PROGRAM=1 +- AC_DEFINE(MOZ_GLUE_IN_PROGRAM) +- ;; +-esac ++else ++ case "${OS_TARGET}" in ++ Android|WINNT|Darwin) ++ MOZ_GLUE_IN_PROGRAM= ++ ;; ++ *) ++ dnl On !Android !Windows !OSX, we only want to link executables against mozglue ++ MOZ_GLUE_IN_PROGRAM=1 ++ AC_DEFINE(MOZ_GLUE_IN_PROGRAM) ++ ;; ++ esac ++fi + + if test "$MOZ_MEMORY"; then + if test "x$MOZ_DEBUG" = "x1"; then +diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build +index d289747785a1..fd1e78a543ed 100644 +--- a/mozglue/build/moz.build ++++ b/mozglue/build/moz.build +@@ -4,9 +4,12 @@ + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + ++if CONFIG['JS_STANDALONE']: ++ Library('mozglue') ++ FINAL_LIBRARY = 'js' + # Build mozglue as a shared lib on Windows, OSX and Android. + # If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in +-if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'): ++elif CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'): + SharedLibrary('mozglue') + else: + Library('mozglue') Index: libraries/source/spidermonkey/FixMozglueStatic.diff =================================================================== --- libraries/source/spidermonkey/FixMozglueStatic.diff +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build -index 58e2db6..1cfb504 100644 ---- a/mozglue/build/moz.build -+++ b/mozglue/build/moz.build -@@ -4,12 +4,9 @@ - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - --# Build mozglue as a shared lib on Windows, OSX and Android. --# If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in --if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'): -- SharedLibrary('mozglue') --else: -- Library('mozglue') -+# Build mozglue as a static lib into js for 0 A.D. -+Library('mozglue') -+FINAL_LIBRARY = 'js' - - if not CONFIG['MOZ_CRT']: - SDK_LIBRARY = True Index: libraries/source/spidermonkey/FixNonx86.diff =================================================================== --- libraries/source/spidermonkey/FixNonx86.diff +++ /dev/null @@ -1,229 +0,0 @@ -diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp ---- a/js/src/gc/Memory.cpp -+++ b/js/src/gc/Memory.cpp -@@ -430,17 +430,17 @@ InitMemorySubsystem() - if (pageSize == 0) - pageSize = allocGranularity = size_t(sysconf(_SC_PAGESIZE)); - } - - static inline void* - MapMemoryAt(void* desired, size_t length, int prot = PROT_READ | PROT_WRITE, - int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0) - { --#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) -+#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__) - MOZ_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0); - #endif - void* region = mmap(desired, length, prot, flags, fd, offset); - if (region == MAP_FAILED) - return nullptr; - /* - * mmap treats the given address as a hint unless the MAP_FIXED flag is - * used (which isn't usually what you want, as this overrides existing -@@ -480,16 +480,51 @@ MapMemory(size_t length, int prot = PROT - * as out of memory. - */ - if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) { - if (munmap(region, length)) - MOZ_ASSERT(errno == ENOMEM); - return nullptr; - } - return region; -+#elif defined(__aarch64__) -+ /* -+ * There might be similar virtual address issue on arm64 which depends on -+ * hardware and kernel configurations. But the work around is slightly -+ * different due to the different mmap behavior. -+ * -+ * TODO: Merge with the above code block if this implementation works for -+ * ia64 and sparc64. -+ */ -+ const uintptr_t start = UINT64_C(0x0000070000000000); -+ const uintptr_t end = UINT64_C(0x0000800000000000); -+ const uintptr_t step = js::gc::ChunkSize; -+ /* -+ * Optimization options if there are too many retries in practice: -+ * 1. Examine /proc/self/maps to find an available address. This file is -+ * not always available, however. In addition, even if we examine -+ * /proc/self/maps, we may still need to retry several times due to -+ * racing with other threads. -+ * 2. Use a global/static variable with lock to track the addresses we have -+ * allocated or tried. -+ */ -+ uintptr_t hint; -+ void* region = MAP_FAILED; -+ for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) { -+ region = mmap((void*)hint, length, prot, flags, fd, offset); -+ if (region != MAP_FAILED) { -+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) { -+ if (munmap(region, length)) { -+ MOZ_ASSERT(errno == ENOMEM); -+ } -+ region = MAP_FAILED; -+ } -+ } -+ } -+ return region == MAP_FAILED ? nullptr : region; - #else - void* region = MozTaggedAnonymousMmap(nullptr, length, prot, flags, fd, offset, "js-gc-heap"); - if (region == MAP_FAILED) - return nullptr; - return region; - #endif - } - -diff --git a/js/src/jit/none/MacroAssembler-none.h b/js/src/jit/none/MacroAssembler-none.h ---- a/js/src/jit/none/MacroAssembler-none.h -+++ b/js/src/jit/none/MacroAssembler-none.h -@@ -254,16 +254,18 @@ class MacroAssemblerNone : public Assemb - template void branchSub32(Condition, T, S, Label*) { MOZ_CRASH(); } - template void branchPtr(Condition, T, S, Label*) { MOZ_CRASH(); } - template void branchTestPtr(Condition, T, S, Label*) { MOZ_CRASH(); } - template void branchDouble(DoubleCondition, T, S, Label*) { MOZ_CRASH(); } - template void branchFloat(DoubleCondition, T, S, Label*) { MOZ_CRASH(); } - template void branchPrivatePtr(Condition, T, S, Label*) { MOZ_CRASH(); } - template void decBranchPtr(Condition, T, S, Label*) { MOZ_CRASH(); } - template void branchTest64(Condition, T, T, S, Label*) { MOZ_CRASH(); } -+ template void branch64(Condition, T, S, Label*) { MOZ_CRASH(); } -+ template void branch64(Condition, T, T, S, Label*) { MOZ_CRASH(); } - template void mov(T, S) { MOZ_CRASH(); } - template void movq(T, S) { MOZ_CRASH(); } - template void movePtr(T, S) { MOZ_CRASH(); } - template void move32(T, S) { MOZ_CRASH(); } - template void moveFloat32(T, S) { MOZ_CRASH(); } - template void moveDouble(T, S) { MOZ_CRASH(); } - template void move64(T, S) { MOZ_CRASH(); } - template CodeOffset movWithPatch(T, Register) { MOZ_CRASH(); } - -diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp ---- a/js/src/jsapi-tests/testGCAllocator.cpp -+++ b/js/src/jsapi-tests/testGCAllocator.cpp -@@ -307,48 +307,72 @@ void* mapMemoryAt(void* desired, size_t - void* mapMemory(size_t length) { return nullptr; } - void unmapPages(void* p, size_t size) { } - - #elif defined(XP_UNIX) - - void* - mapMemoryAt(void* desired, size_t length) - { --#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) -+#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__) - MOZ_RELEASE_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0); - #endif - void* region = mmap(desired, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); - if (region == MAP_FAILED) - return nullptr; - if (region != desired) { - if (munmap(region, length)) - MOZ_RELEASE_ASSERT(errno == ENOMEM); - return nullptr; - } - return region; - } - - void* - mapMemory(size_t length) - { -- void* hint = nullptr; -+ int prot = PROT_READ | PROT_WRITE; -+ int flags = MAP_PRIVATE | MAP_ANON; -+ int fd = -1; -+ off_t offset = 0; -+ // The test code must be aligned with the implementation in gc/Memory.cpp. - #if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) -- hint = (void*)0x0000070000000000ULL; --#endif -- void* region = mmap(hint, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); -+ void* region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset); - if (region == MAP_FAILED) - return nullptr; --#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) -- if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000ULL) { -+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) { - if (munmap(region, length)) - MOZ_RELEASE_ASSERT(errno == ENOMEM); - return nullptr; - } -+ return region; -+#elif defined(__aarch64__) -+ const uintptr_t start = UINT64_C(0x0000070000000000); -+ const uintptr_t end = UINT64_C(0x0000800000000000); -+ const uintptr_t step = js::gc::ChunkSize; -+ uintptr_t hint; -+ void* region = MAP_FAILED; -+ for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) { -+ region = mmap((void*)hint, length, prot, flags, fd, offset); -+ if (region != MAP_FAILED) { -+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) { -+ if (munmap(region, length)) { -+ MOZ_RELEASE_ASSERT(errno == ENOMEM); -+ } -+ region = MAP_FAILED; -+ } -+ } -+ } -+ return region == MAP_FAILED ? nullptr : region; -+#else -+ void* region = mmap(nullptr, length, prot, flags, fd, offset); -+ if (region == MAP_FAILED) -+ return nullptr; -+ return region; - #endif -- return region; - } - - void - unmapPages(void* p, size_t size) - { - if (munmap(p, size)) - MOZ_RELEASE_ASSERT(errno == ENOMEM); - } - -diff --git a/js/src/jit/AtomicOperations.h b/js/src/jit/AtomicOperations.h -index 8606a18..60af775 100644 ---- a/js/src/jit/AtomicOperations.h -+++ b/js/src/jit/AtomicOperations.h -@@ -302,7 +302,9 @@ AtomicOperations::isLockfree(int32_t size) - # include "jit/mips-shared/AtomicOperations-mips-shared.h" - #elif defined(__ppc64__) || defined(__PPC64_) \ - || defined(__ppc64le__) || defined(__PPC64LE__) \ -- || defined(__ppc__) || defined(__PPC__) -+ || defined(__ppc__) || defined(__PPC__) \ -+ || defined(__aarch64__) || defined(__arm__) \ -+ || defined(__s390x__) || defined(__mips__) - # include "jit/none/AtomicOperations-ppc.h" - #elif defined(JS_CODEGEN_NONE) - # include "jit/none/AtomicOperations-none.h" - -diff --git a/js/src/tests/js1_5/Array/regress-157652.js b/js/src/tests/js1_5/Array/regress-157652.js -index 0bdba8f..9d77802 100644 ---- a/js/src/tests/js1_5/Array/regress-157652.js -+++ b/js/src/tests/js1_5/Array/regress-157652.js -@@ -1,4 +1,4 @@ --// |reftest| skip-if(xulRuntime.XPCOMABI.match(/x86_64/)||Android) -- No test results -+// |reftest| skip-if(xulRuntime.XPCOMABI.match(/x86_64|aarch64|ppc64|ppc64le|s390x/)||Android) -- No test results - /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this -diff --git a/js/src/tests/js1_5/Array/regress-330812.js b/js/src/tests/js1_5/Array/regress-330812.js -index 3a39297..c48f4c8 100644 ---- a/js/src/tests/js1_5/Array/regress-330812.js -+++ b/js/src/tests/js1_5/Array/regress-330812.js -@@ -1,4 +1,4 @@ --// |reftest| skip-if(xulRuntime.XPCOMABI.match(/x86_64/)||Android) -- No test results -+// |reftest| skip-if(xulRuntime.XPCOMABI.match(/x86_64|aarch64|ppc64|ppc64le|s390x/)||Android) -- No test results - /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this -diff --git a/js/src/tests/js1_5/Regress/regress-422348.js b/js/src/tests/js1_5/Regress/regress-422348.js -index f2443c2..7ae83f4 100644 ---- a/js/src/tests/js1_5/Regress/regress-422348.js -+++ b/js/src/tests/js1_5/Regress/regress-422348.js -@@ -1,4 +1,4 @@ --// |reftest| skip-if(xulRuntime.XPCOMABI.match(/x86_64/)) -- On 64-bit, takes forever rather than throwing -+// |reftest| skip-if(xulRuntime.XPCOMABI.match(/x86_64|aarch64|ppc64|ppc64le|s390x/)) -- On 64-bit, takes forever rather than throwing - /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - Index: libraries/source/spidermonkey/FixTracelogger.diff =================================================================== --- libraries/source/spidermonkey/FixTracelogger.diff +++ /dev/null @@ -1,223 +0,0 @@ -diff --git a/js/src/jit-test/tests/tracelogger/bug1266649.js b/js/src/jit-test/tests/tracelogger/bug1266649.js -new file mode 100644 -index 0000000..2878e0c ---- /dev/null -+++ b/js/src/jit-test/tests/tracelogger/bug1266649.js -@@ -0,0 +1,8 @@ -+ -+var du = new Debugger(); -+if (typeof du.setupTraceLogger === "function") { -+ du.setupTraceLogger({ -+ Scripts: true -+ }) -+ oomTest(() => function(){}); -+} -diff --git a/js/src/vm/TraceLogging.cpp b/js/src/vm/TraceLogging.cpp -index ce7acc6..8f8aca4 100644 ---- a/js/src/vm/TraceLogging.cpp -+++ b/js/src/vm/TraceLogging.cpp -@@ -393,14 +393,14 @@ TraceLoggerThread::getOrCreateEventPayload(const char* text) - return nullptr; - } - -- if (!pointerMap.add(p, text, payload)) -- return nullptr; -- - if (graph.get()) - graph->addTextId(textId, str); - - nextTextId++; - -+ if (!pointerMap.add(p, text, payload)) -+ return nullptr; -+ - return payload; - } - -@@ -420,10 +420,13 @@ TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type, const char* f - if (!traceLoggerState->isTextIdEnabled(type)) - return getOrCreateEventPayload(type); - -- PointerHashMap::AddPtr p = pointerMap.lookupForAdd(ptr); -- if (p) { -- MOZ_ASSERT(p->value()->textId() < nextTextId); // Sanity check. -- return p->value(); -+ PointerHashMap::AddPtr p; -+ if (ptr) { -+ p = pointerMap.lookupForAdd(ptr); -+ if (p) { -+ MOZ_ASSERT(p->value()->textId() < nextTextId); // Sanity check. -+ return p->value(); -+ } - } - - // Compute the length of the string to create. -@@ -455,14 +458,16 @@ TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type, const char* f - return nullptr; - } - -- if (!pointerMap.add(p, ptr, payload)) -- return nullptr; -- - if (graph.get()) - graph->addTextId(textId, str); - - nextTextId++; - -+ if (ptr) { -+ if (!pointerMap.add(p, ptr, payload)) -+ return nullptr; -+ } -+ - return payload; - } - -@@ -477,7 +482,7 @@ TraceLoggerEventPayload* - TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type, - const JS::ReadOnlyCompileOptions& script) - { -- return getOrCreateEventPayload(type, script.filename(), script.lineno, script.column, &script); -+ return getOrCreateEventPayload(type, script.filename(), script.lineno, script.column, nullptr); - } - - void -@@ -550,19 +555,42 @@ TraceLoggerThread::log(uint32_t id) - return; - - MOZ_ASSERT(traceLoggerState); -- if (!events.ensureSpaceBeforeAdd()) { -+ if (!events.hasSpaceForAdd(3)) { - uint64_t start = rdtsc() - traceLoggerState->startupTime; - -- if (graph.get()) -- graph->log(events); -+ if (!events.ensureSpaceBeforeAdd(3)) { -+ if (graph.get()) -+ graph->log(events); - -- iteration_++; -- events.clear(); -+ iteration_++; -+ events.clear(); -+ -+ // Remove the item in the pointerMap for which the payloads -+ // have no uses anymore -+ for (PointerHashMap::Enum e(pointerMap); !e.empty(); e.popFront()) { -+ if (e.front().value()->uses() != 0) -+ continue; -+ -+ TextIdHashMap::Ptr p = textIdPayloads.lookup(e.front().value()->textId()); -+ MOZ_ASSERT(p); -+ textIdPayloads.remove(p); -+ -+ e.removeFront(); -+ } -+ -+ // Free all payloads that have no uses anymore. -+ for (TextIdHashMap::Enum e(textIdPayloads); !e.empty(); e.popFront()) { -+ if (e.front().value()->uses() == 0) { -+ js_delete(e.front().value()); -+ e.removeFront(); -+ } -+ } -+ } - - // Log the time it took to flush the events as being from the - // Tracelogger. - if (graph.get()) { -- MOZ_ASSERT(events.capacity() > 2); -+ MOZ_ASSERT(events.capacity() - events.size() > 2); - EventEntry& entryStart = events.pushUninitialized(); - entryStart.time = start; - entryStart.textId = TraceLogger_Internal; -@@ -572,26 +600,6 @@ TraceLoggerThread::log(uint32_t id) - entryStop.textId = TraceLogger_Stop; - } - -- // Remove the item in the pointerMap for which the payloads -- // have no uses anymore -- for (PointerHashMap::Enum e(pointerMap); !e.empty(); e.popFront()) { -- if (e.front().value()->uses() != 0) -- continue; -- -- TextIdHashMap::Ptr p = textIdPayloads.lookup(e.front().value()->textId()); -- MOZ_ASSERT(p); -- textIdPayloads.remove(p); -- -- e.removeFront(); -- } -- -- // Free all payloads that have no uses anymore. -- for (TextIdHashMap::Enum e(textIdPayloads); !e.empty(); e.popFront()) { -- if (e.front().value()->uses() == 0) { -- js_delete(e.front().value()); -- e.removeFront(); -- } -- } - } - - uint64_t time = rdtsc() - traceLoggerState->startupTime; -diff --git a/js/src/vm/TraceLogging.h b/js/src/vm/TraceLogging.h -index 270478c..313950e 100644 ---- a/js/src/vm/TraceLogging.h -+++ b/js/src/vm/TraceLogging.h -@@ -242,7 +242,7 @@ class TraceLoggerThread - - // If we are in a consecutive iteration we are only sure we didn't lose any events, - // when the lastSize equals the maximum size 'events' can get. -- if (lastIteration == iteration_ - 1 && lastSize == CONTINUOUSSPACE_LIMIT) -+ if (lastIteration == iteration_ - 1 && lastSize == events.max_items()) - return false; - - return true; -diff --git a/js/src/vm/TraceLoggingTypes.h b/js/src/vm/TraceLoggingTypes.h -index bb8ccc7..1d98bf6 100644 ---- a/js/src/vm/TraceLoggingTypes.h -+++ b/js/src/vm/TraceLoggingTypes.h -@@ -130,15 +130,15 @@ TLTextIdIsTreeEvent(uint32_t id) - id >= TraceLogger_Last; - } - --// The maximum amount of ram memory a continuous space structure can take (in bytes). --static const uint32_t CONTINUOUSSPACE_LIMIT = 200 * 1024 * 1024; -- - template - class ContinuousSpace { - T* data_; - uint32_t size_; - uint32_t capacity_; - -+ // The maximum amount of ram memory a continuous space structure can take (in bytes). -+ static const uint32_t LIMIT = 200 * 1024 * 1024; -+ - public: - ContinuousSpace () - : data_(nullptr) -@@ -160,6 +160,10 @@ class ContinuousSpace { - data_ = nullptr; - } - -+ uint32_t max_items() { -+ return LIMIT / sizeof(T); -+ } -+ - T* data() { - return data_; - } -@@ -197,11 +201,14 @@ class ContinuousSpace { - return true; - - uint32_t nCapacity = capacity_ * 2; -- if (size_ + count > nCapacity || nCapacity * sizeof(T) > CONTINUOUSSPACE_LIMIT) { -+ if (size_ + count > nCapacity) - nCapacity = size_ + count; - -+ if (nCapacity > max_items()) { -+ nCapacity = max_items(); -+ - // Limit the size of a continuous buffer. -- if (nCapacity * sizeof(T) > CONTINUOUSSPACE_LIMIT) -+ if (size_ + count > nCapacity) - return false; - } - Index: libraries/source/spidermonkey/FixZLibMozBuild.diff =================================================================== --- libraries/source/spidermonkey/FixZLibMozBuild.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- a/config/external/zlib/moz.build -+++ b/config/external/zlib/moz.build -@@ -15,7 +15,7 @@ - # USE_LIBS += [ - # 'mozglue' - # ] - pass - DIRS += [ -- '../../../modules/zlib', -+ '../../../modules/src', - ] Index: libraries/source/spidermonkey/README.txt =================================================================== --- libraries/source/spidermonkey/README.txt +++ libraries/source/spidermonkey/README.txt @@ -1,15 +1,15 @@ Important notice: ----------------- This version of SpiderMonkey comes from -https://ftp.mozilla.org/pub/spidermonkey/releases/45.0.2/mozjs-45.0.2.tar.bz2 +https://ftp.mozilla.org/pub/spidermonkey/prereleases/52/pre1/mozjs-52.9.1pre1.tar.bz2 -The game must be compiled with precisely this version since SpiderMonkey -does not guarantee API stability and may have behavioural changes that +The game must be compiled with precisely this version since SpiderMonkey +does not guarantee API stability and may have behavioural changes that cause subtle bugs or network out-of-sync errors. A standard system-provided version of the library may only be used if it's -exactly the same version or if it's another minor release that does not +exactly the same version or if it's another minor release that does not change the behaviour of the scripts executed by SpiderMonkey. Also it's -crucial that "--enable-gcgenerational" was used for building the system +crucial that "--enable-gcgenerational" was used for building the system provided libraries and that exact stack rooting was not disabled. Using different settings for compiling SpiderMonkey and 0 A.D. causes incompatibilities on the ABI (binary) level and can lead to @@ -33,23 +33,25 @@ Setting up the build environment: 1. Get https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites#MozillaBuild +2. Download both an older version (2.x) which uses the old Mozilla build system, for NSPR; and the latest version to build + SpiderMonkey. Install them to different locations. Building NSPR: -1. Get nspr. We are using nspr-4.12 which was the newest version when SM45.0.2 was out. +1. Get nspr. We are using nspr-4.26 which was the newest version when this was written. Newer versions should probably work too. Download link: https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/ -2. Run mozillabuild (start-shell-msvc2015.bat) as administrator +2. Run MozillaBuild 2.x (start-shell-msvc2015.bat) 3. Extract nspr to libraries/source/spidermonkey - tar -xzvf nspr-4.12.tar.gz - cd nspr-4.12 + tar -xzvf nspr-4.26.tar.gz + cd nspr-4.26 cd nspr -4. Patch nspr with https://bugzilla.mozilla.org/show_bug.cgi?id=1238154#c7 +4. Patch nspr with https://bugzilla.mozilla.org/show_bug.cgi?id=1238154#c15 5. Call configure. I've used this command: ./configure --disable-debug --enable-optimize --enable-win32-target=WIN95 6. Call make Building SpiderMonkey: 1. Adjust the absolute paths to nspr in the build.sh file to match your environment. -2. Run mozillabuild (start-shell-msvc2015.bat) as administrator and run ./build.sh. +2. Run MozillaBuild 3.x (start-shell.bat) and run ./build.sh. Index: libraries/source/spidermonkey/RemoveNSPRDependency.diff =================================================================== --- libraries/source/spidermonkey/RemoveNSPRDependency.diff +++ /dev/null @@ -1,51 +0,0 @@ - -# HG changeset patch -# User Philip Chimento -# Date 1501017350 25200 -# Node ID 5d95b2833b30582ab3df4e28373d749ddbf7c04e -# Parent c24e6fc9f689aeb32de0bf7916b1d0098d4a2bb9 -Bug 1379539 - Remove unnecessary NSPR dependency. r=glandium, a=jcristau - -diff --git a/build/autoconf/nspr-build.m4 b/build/autoconf/nspr-build.m4 -index 970e1e7..66d96b1 100644 ---- a/build/autoconf/nspr-build.m4 -+++ b/build/autoconf/nspr-build.m4 -@@ -167,11 +167,8 @@ fi - - AC_SUBST_LIST(NSPR_CFLAGS) - --NSPR_PKGCONF_CHECK="nspr" -+PKGCONF_REQUIRES_PRIVATE="Requires.private: nspr" - if test -n "$MOZ_NATIVE_NSPR"; then -- # piggy back on $MOZ_NATIVE_NSPR to set a variable for the nspr check for js.pc -- NSPR_PKGCONF_CHECK="nspr >= $NSPR_MINVER" -- - _SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $NSPR_CFLAGS" - AC_TRY_COMPILE([#include "prlog.h"], -@@ -181,8 +178,12 @@ if test -n "$MOZ_NATIVE_NSPR"; then - , - AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT])) - CFLAGS=$_SAVE_CFLAGS -+ # piggy back on $MOZ_NATIVE_NSPR to set a variable for the nspr check for js.pc -+ PKGCONF_REQUIRES_PRIVATE="Requires.private: nspr >= $NSPR_MINVER" -+elif test -n "$JS_POSIX_NSPR"; then -+ PKGCONF_REQUIRES_PRIVATE= - fi --AC_SUBST(NSPR_PKGCONF_CHECK) -+AC_SUBST([PKGCONF_REQUIRES_PRIVATE]) - - fi # _IS_OUTER_CONFIGURE - -diff --git a/js/src/js.pc.in b/js/src/js.pc.in -index 1efea33..2eae393 100644 ---- a/js/src/js.pc.in -+++ b/js/src/js.pc.in -@@ -6,6 +6,6 @@ includedir=@includedir@ - Name: SpiderMonkey @MOZILLA_VERSION@ - Description: The Mozilla library for JavaScript - Version: @MOZILLA_VERSION@ --Requires.private: @NSPR_PKGCONF_CHECK@ -+@PKGCONF_REQUIRES_PRIVATE@ - Libs: -L${libdir} -l@JS_LIBRARY_NAME@ - Cflags: -include ${includedir}/@JS_LIBRARY_NAME@/js/RequiredDefines.h -I${includedir}/@JS_LIBRARY_NAME@ Index: libraries/source/spidermonkey/RenameLibs.diff =================================================================== --- /dev/null +++ libraries/source/spidermonkey/RenameLibs.diff @@ -0,0 +1,20 @@ +diff --git a/js/src/old-configure b/js/src/old-configure +index 7d621b52ce..85e2934fa9 100644 +--- a/js/src/old-configure ++++ b/js/src/old-configure +@@ -10469,12 +10469,12 @@ done + + + +-if test -n "$JS_STANDALONE"; then + MOZ_APP_NAME="mozjs" + MOZ_APP_VERSION="$MOZILLA_SYMBOLVERSION" +-JS_LIBRARY_NAME="mozjs-$MOZILLA_SYMBOLVERSION" ++if test -n "$MOZ_DEBUG"; then ++JS_LIBRARY_NAME="mozjs$MOZILLA_SYMBOLVERSION-ps-debug" + else +-JS_LIBRARY_NAME="mozjs" ++JS_LIBRARY_NAME="mozjs$MOZILLA_SYMBOLVERSION-ps-release" + fi + JS_CONFIG_LIBS="$NSPR_LIBS $LIBS" + if test -n "$GNU_CC"; then Index: libraries/source/spidermonkey/build.sh =================================================================== --- libraries/source/spidermonkey/build.sh +++ libraries/source/spidermonkey/build.sh @@ -1,14 +1,18 @@ #!/bin/sh - +# This script is called by update-workspaces.sh / build-osx-libraries.sh set -e +# This should match the version in config/milestone.txt +FOLDER="mozjs-52.9.1pre1" +# If same-version changes are needed, increment this. +LIB_VERSION="52.9.1pre1+0" +LIB_NAME="mozjs52-ps" + # Since this script is called by update-workspaces.sh, we want to quickly # avoid doing any work if SpiderMonkey is already built and up-to-date. # Running SM's Makefile is a bit slow and noisy, so instead we'll make a -# special file and only rebuild if it's older than SVN. -# README.txt should be updated whenever we update SM, so use that as -# a time comparison. -if [ -e .already-built -a .already-built -nt README.txt ] +# special file and only rebuild if the build.sh version differs. +if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ] then echo "SpiderMonkey is already up to date" exit @@ -27,37 +31,34 @@ MAKE_OPTS="${JOBS}" -# jemalloc is outdated on SM45, do not use it -CONF_OPTS="--disable-tests --disable-jemalloc --enable-shared-js --without-intl-api" - -# Bug 1269319 -# When compiled with GCC 6 (or later), SpiderMonkey 45 (and versions up to 49) is -# subject to segfaults. Disabling a few optimizations fixes that. -# See also #4053 -if [ "${OS}" != "Windows_NT" ] -then - if [ "`${CXX:=g++} -dumpversion | cut -f1 -d.`" -ge "6" ] - then - CXXFLAGS="${CXXFLAGS} -fno-schedule-insns2 -fno-delete-null-pointer-checks" - fi -fi - -# Change the default location where the tracelogger should store its output. -# The default location is . on Windows and /tmp/ on *nix. -TLCXXFLAGS='-DTRACE_LOG_DIR="\"../../source/tools/tracelogger/\""' +# Standalone SpiderMonkey can not use jemalloc (see https://bugzilla.mozilla.org/show_bug.cgi?id=1465038) +CONF_OPTS="--disable-tests + --disable-jemalloc + --disable-js-shell + --without-intl-api + --enable-shared-js" # We're linking statically but JS has quirks with static-only compilation. # NSPR is needed on Windows for POSIX emulation. -# If you want to build on Windows, check README.txt and edit the absolute paths +# If you want to build on Windows, check README.txt and edit the absolute paths # to match your environment. if [ "${OS}" = "Windows_NT" ] then - NSPR_INCLUDES="-ID:/nspr-4.12/nspr/dist/include/nspr" - NSPR_LIBS=" \ - D:/nspr-4.12/nspr/dist/lib/nspr4 \ - D:/nspr-4.12/nspr/dist/lib/plds4 \ - D:/nspr-4.12/nspr/dist/lib/plc4" + CONF_OPTS="${CONF_OPTS} --with-nspr-prefix="D:/nspr-4.21/nspr/"" else - CONF_OPTS="${CONF_OPTS} --enable-posix-nspr-emulation" + CONF_OPTS="${CONF_OPTS} --enable-posix-nspr-emulation" +fi + +if [ "`uname -s`" = "Darwin" ] +then + # Link to custom-built zlib + CONF_OPTS="${CONF_OPTS} --with-system-zlib=${ZLIB_DIR}" + # Specify target versions and SDK + if [ "${MIN_OSX_VERSION}" ] && [ "${MIN_OSX_VERSION-_}" ]; then + CONF_OPTS="${CONF_OPTS} --enable-macos-target=$MIN_OSX_VERSION" + fi + if [ "${SYSROOT}" ] && [ "${SYSROOT-_}" ]; then + CONF_OPTS="${CONF_OPTS} --with-macosx-sdk=${SYSROOT}" + fi fi # If Valgrind looks like it's installed, then set up SM to support it @@ -74,98 +75,64 @@ ${CTARGET:+--target=${CTARGET}}" echo "SpiderMonkey build options: ${CONF_OPTS}" -echo ${CONF_OPTS} -FOLDER=mozjs-45.0.2 +# It can occasionally be useful to not rebuild everything, but don't do this by default. +REBUILD=true +if $REBUILD = true; +then + # Delete the existing directory to avoid conflicts and extract the tarball + rm -rf "$FOLDER" + if [ ! -e "${FOLDER}.tar.bz2" ]; + then + # The tarball is committed to svn, but it's useful to let jenkins download it (when testing upgrade scripts). + download="$(command -v wget || echo "curl -L -o "${FOLDER}.tar.bz2"")" + $download "https://github.com/wraitii/spidermonkey-tarballs/releases/download/v52.9.1/${FOLDER}.tar.bz2" + fi + tar xjf "${FOLDER}.tar.bz2" + + # Clean up header files that may be left over by earlier versions of SpiderMonkey + rm -rf include-unix-debug + rm -rf include-unix-release + + # Apply patches + cd "$FOLDER" + . ../patch.sh + # Prevent complaining that configure is outdated. + touch ./js/src/configure +else + cd "$FOLDER" +fi -# Delete the existing directory to avoid conflicts and extract the tarball -rm -rf $FOLDER -tar xjf mozjs-45.0.2.tar.bz2 - -# Clean up header files that may be left over by earlier versions of SpiderMonkey -rm -rf include-unix-* - -cd $FOLDER - -# Apply patches -. ../patch.sh - -cd js/src - -# Clean up data generated by previous builds that could cause problems -rm -rf build-debug -rm -rf build-release - -# We want separate debug/release versions of the library, so we have to change -# the LIBRARY_NAME for each build. -# (We use perl instead of sed so that it works with MozillaBuild on Windows, -# which has an ancient sed.) -perl -i.bak -pe 's/(SHARED_LIBRARY_NAME\s+=).*/$1 '\''mozjs45-ps-debug'\''/' moz.build mkdir -p build-debug cd build-debug -if [ "${OS}" = "Windows_NT" ] -then - CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} \ - --with-nspr-cflags="${NSPR_INCLUDES}" --with-nspr-libs="${NSPR_LIBS}" \ - --enable-debug \ - --disable-optimize \ - --enable-js-diagnostics \ - --enable-gczeal -else - CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} \ - --enable-debug \ - --disable-optimize \ - --enable-js-diagnostics \ - --enable-gczeal -fi +# SM build scripts check for autoconf, but it isn't actually needed, so just pass something. +CXXFLAGS="${CXXFLAGS}" ../js/src/configure AUTOCONF="false" ${CONF_OPTS} \ + --enable-debug \ + --disable-optimize \ + --enable-gczeal ${MAKE} ${MAKE_OPTS} cd .. -perl -i.bak -pe 's/(SHARED_LIBRARY_NAME\s+=).*/$1 '\''mozjs45-ps-release'\''/' moz.build mkdir -p build-release cd build-release -if [ "${OS}" = "Windows_NT" ] -then - CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} \ - --with-nspr-cflags="${NSPR_INCLUDES}" --with-nspr-libs="${NSPR_LIBS}" \ - --enable-optimize \ - #--enable-gczeal \ - #--enable-debug-symbols -else - CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} \ - --enable-optimize \ - #--enable-gczeal \ - #--enable-debug-symbols -fi +CXXFLAGS="${CXXFLAGS}" ../js/src/configure AUTOCONF="false" ${CONF_OPTS} \ + --enable-optimize ${MAKE} ${MAKE_OPTS} -cd .. +cd ../ -cd ../../.. +cd ../ if [ "${OS}" = "Windows_NT" ] then INCLUDE_DIR_DEBUG=include-win32-debug INCLUDE_DIR_RELEASE=include-win32-release - DLL_SRC_SUFFIX=.dll - DLL_DST_SUFFIX=.dll LIB_PREFIX= - LIB_SRC_SUFFIX=.lib - LIB_DST_SUFFIX=.lib + LIB_SUFFIX=.lib else INCLUDE_DIR_DEBUG=include-unix-debug INCLUDE_DIR_RELEASE=include-unix-release - DLL_SRC_SUFFIX=.so - DLL_DST_SUFFIX=.so LIB_PREFIX=lib - LIB_SRC_SUFFIX=.so - LIB_DST_SUFFIX=.so - if [ "`uname -s`" = "OpenBSD" ] - then - DLL_SRC_SUFFIX=.so.1.0 - DLL_DST_SUFFIX=.so.1.0 - LIB_SRC_SUFFIX=.so.1.0 - LIB_DST_SUFFIX=:so.1.0 - fi + LIB_SUFFIX=.a fi if [ "${OS}" = "Windows_NT" ] @@ -173,10 +140,10 @@ # Bug #776126 # SpiderMonkey uses a tweaked zlib when building, and it wrongly copies its own files to include dirs # afterwards, so we have to remove them to not have them conflicting with the regular zlib - pushd ${FOLDER}/js/src/build-release/dist/include + pushd "${FOLDER}/build-release/dist/include" rm mozzconf.h zconf.h zlib.h popd - pushd ${FOLDER}/js/src/build-debug/dist/include + pushd "${FOLDER}/build-debug/dist/include" rm mozzconf.h zconf.h zlib.h popd fi @@ -184,23 +151,21 @@ # Copy files into the necessary locations for building and running the game # js-config.h is different for debug and release builds, so we need different include directories for both -mkdir -p ${INCLUDE_DIR_DEBUG} -mkdir -p ${INCLUDE_DIR_RELEASE} -cp -R -L ${FOLDER}/js/src/build-release/dist/include/* ${INCLUDE_DIR_RELEASE}/ -cp -R -L ${FOLDER}/js/src/build-debug/dist/include/* ${INCLUDE_DIR_DEBUG}/ +mkdir -p "${INCLUDE_DIR_DEBUG}" +mkdir -p "${INCLUDE_DIR_RELEASE}" +cp -R -L "${FOLDER}"/build-release/dist/include/* "${INCLUDE_DIR_RELEASE}/" +cp -R -L "${FOLDER}"/build-debug/dist/include/* "${INCLUDE_DIR_DEBUG}/" mkdir -p lib/ -cp -L ${FOLDER}/js/src/build-debug/dist/sdk/lib/${LIB_PREFIX}mozjs45-ps-debug${LIB_SRC_SUFFIX} lib/${LIB_PREFIX}mozjs45-ps-debug${LIB_DST_SUFFIX} -cp -L ${FOLDER}/js/src/build-release/dist/sdk/lib/${LIB_PREFIX}mozjs45-ps-release${LIB_SRC_SUFFIX} lib/${LIB_PREFIX}mozjs45-ps-release${LIB_DST_SUFFIX} -cp -L ${FOLDER}/js/src/build-debug/dist/bin/${LIB_PREFIX}mozjs45-ps-debug${DLL_SRC_SUFFIX} ../../../binaries/system/${LIB_PREFIX}mozjs45-ps-debug${DLL_DST_SUFFIX} -cp -L ${FOLDER}/js/src/build-release/dist/bin/${LIB_PREFIX}mozjs45-ps-release${DLL_SRC_SUFFIX} ../../../binaries/system/${LIB_PREFIX}mozjs45-ps-release${DLL_DST_SUFFIX} +cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}js_static${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-debug${LIB_SUFFIX}" +cp -L "${FOLDER}/build-release/js/src/${LIB_PREFIX}js_static${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-release${LIB_SUFFIX}" # On Windows, also copy debugging symbols files if [ "${OS}" = "Windows_NT" ] then - cp -L ${FOLDER}/js/src/build-debug/js/src/${LIB_PREFIX}mozjs45-ps-debug-vc140.pdb ../../../binaries/system/${LIB_PREFIX}mozjs45-ps-debug-vc140.pdb - cp -L ${FOLDER}/js/src/build-release/js/src/${LIB_PREFIX}mozjs45-ps-release-vc140.pdb ../../../binaries/system/${LIB_PREFIX}mozjs45-ps-release-vc140.pdb + cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}mozjs-52.pdb" "binaries/system/${LIB_PREFIX}${LIB_NAME}-debug.pdb" + cp -L "${FOLDER}/build-release/js/src/${LIB_PREFIX}mozjs-52-.pdb" "binaries/system/${LIB_PREFIX}${LIB_NAME}-release.pdb" fi # Flag that it's already been built successfully so we can skip it next time -touch .already-built +echo "${LIB_VERSION}" > .already-built Index: libraries/source/spidermonkey/patch.sh =================================================================== --- libraries/source/spidermonkey/patch.sh +++ libraries/source/spidermonkey/patch.sh @@ -2,59 +2,30 @@ # Apply patches if needed # This script gets called from build-osx-libs.sh and build.sh. -# Remove the unnecessary NSPR dependency. -# Will be included in SM52. -# https://bugzilla.mozilla.org/show_bug.cgi?id=1379539 -patch -p1 < ../RemoveNSPRDependency.diff - -# Fix the path to the moz.build file in the zlib module -patch -p1 < ../FixZLibMozBuild.diff - -# === Fix the SM45 tracelogger === -# This patch is a squashed version of several patches that were adapted -# to fix failing hunks. -# -# Applied in the following order, they are: -# * https://bugzilla.mozilla.org/show_bug.cgi?id=1266649 -# Handle failing to add to pointermap gracefully. -# * https://bugzilla.mozilla.org/show_bug.cgi?id=1280648 -# Don't cache based on pointers to movable GC things. -# * https://bugzilla.mozilla.org/show_bug.cgi?id=1255766 -# Also mark resizing of memory. -# * https://bugzilla.mozilla.org/show_bug.cgi?id=1259403 -# Only increase capacity by multiples of 2. -# Always make sure there are 3 free slots for events. -# === -patch -p1 < ../FixTracelogger.diff - # Patch embedded python psutil to work with FreeBSD 12 after revision 315662 # Based on: https://svnweb.freebsd.org/ports/head/sysutils/py-psutil121/files/patch-_psutil_bsd.c?revision=436575&view=markup # psutil will be upgraded in SM60: https://bugzilla.mozilla.org/show_bug.cgi?id=1436857 patch -p0 < ../FixpsutilFreeBSD.diff -# Patch some parts of the code to support extra processor architectures -# Includes: -# * https://bugzilla.mozilla.org/show_bug.cgi?id=1143022 (for arm64) -# * https://bugzilla.mozilla.org/show_bug.cgi?id=1277742 (for aarch64) -# * https://bugzilla.mozilla.org/show_bug.cgi?id=1266366 (for ppc64) -patch -p1 < ../FixNonx86.diff +# Static builds have a few issues. +# First, mozglue symbols need to be linked against. This is partly fixed in SM60+, party still there in SM78. +# (see https://bugzilla.mozilla.org/show_bug.cgi?id=1176787 ). +# Secondly, the SDK_LIBRARY flag isn't set. This is still an issue in SM78. +# https://bugzilla.mozilla.org/show_bug.cgi?id=1588340 +patch -p1 < ../FixMozglue.diff -# Always link mozglue into the shared library when building standalone. -# Will be included in SM60. Custom version of the patch for SM45, which doesn't have the same build system. -# https://bugzilla.mozilla.org/show_bug.cgi?id=1176787 -patch -p1 < ../FixMozglueStatic.diff +# Update library names to have separate debug/release libraries. +patch -p1 < ../RenameLibs.diff -# JSPropertyDescriptor is not public in SM45. -# Will be fixed in SM52. -# https://bugzilla.mozilla.org/show_bug.cgi?id=1316079 -patch -p1 < ../ExportJSPropertyDescriptor.diff +# After https://bugzilla.mozilla.org/show_bug.cgi?id=1289934 landed in +# Firefox 51, MSVC compilation has been broken due to bug +# https://developercommunity.visualstudio.com/content/problem/25334/error-code-c2971-when-specifying-a-function-as-the.html +# (resolved in Visual Studio 2017). The following fix was applied +# to not drop compiler support and will be included in SM 60. +# https://bugzilla.mozilla.org/show_bug.cgi?id=1300925 +patch -p1 < ../FixMSVCBuild.diff -# When trying to link pyrogenesis, js::oom::GetThreadType() and js::ReportOutOfMemory() -# are marked as unresolved symbols. -# Will be included in SM52. -# https://bugzilla.mozilla.org/show_bug.cgi?id=1379538 -patch -p1 < ../FixLinking.diff +# GCC 9 and 10 fail to build with -Werror=format, so disable it. +# https://bugs.gentoo.org/693556 +patch -p1 < ../DisableGCC9WerrorFormat.diff -# Allow the use of JS::PersistentRootedSymbol in debug builds. -# This check will be removed in SM52. -patch -p1 < ../FixPersistentRootedSymbol.diff Index: source/scriptinterface/ScriptTypes.h =================================================================== --- source/scriptinterface/ScriptTypes.h +++ source/scriptinterface/ScriptTypes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -71,7 +71,7 @@ # pragma GCC diagnostic pop #endif -#if MOZJS_MAJOR_VERSION != 45 +#if MOZJS_MAJOR_VERSION != 52 #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 \ @@ -79,7 +79,7 @@ include paths. #endif -#if MOZJS_MINOR_VERSION != 0 +#if MOZJS_MINOR_VERSION != 9 #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 \ Index: source/tools/tracelogger/tracelogger_options.sh =================================================================== --- source/tools/tracelogger/tracelogger_options.sh +++ source/tools/tracelogger/tracelogger_options.sh @@ -9,13 +9,15 @@ # The last tested version of the tool is 1c67e97e794b5039d0cae95f72ea0c76e4aa4696, # it can be used if more recent versions cause trouble. +export TLDIR="$(dirname $(realpath $0))" + # Use semicolons to separate values on Windows. # If that produces bogus output, you can try with commas instead. if [ "${OS}" = "Windows_NT" ] then - export TLLOG="Defaults;IonCompiler" + export TLLOG="Default;IonCompiler" export TLOPTIONS="EnableMainThread;EnableOffThread;EnableGraph" else - export TLLOG=Defaults,IonCompiler + export TLLOG=Default,IonCompiler export TLOPTIONS=EnableMainThread,EnableOffThread,EnableGraph fi