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-mozjs52"] then + if _OPTIONS["with-system-mozjs"] then if not _OPTIONS["android"] then - pkgconfig.add_includes("mozjs-52") + pkgconfig.add_includes("mozjs-60") end else if os.istarget("windows") then @@ -554,21 +554,17 @@ end end, link_settings = function() - if _OPTIONS["with-system-mozjs52"] then + if _OPTIONS["with-system-mozjs"] then if _OPTIONS["android"] then - links { "mozjs-52" } + links { "mozjs-60" } else - pkgconfig.add_links("mozjs-52") + pkgconfig.add_links("mozjs-60") end else - filter { "Debug", "action:vs2015" } - links { "mozjs52-ps-debug-vc140" } - filter { "Release", "action:vs2015" } - links { "mozjs52-ps-release-vc140" } - filter { "Debug", "action:not vs*" } - links { "mozjs52-ps-debug" } - filter { "Release", "action:not vs*" } - links { "mozjs52-ps-release" } + filter { "Debug" } + links { "mozjs60-ps-debug" } + filter { "Release" } + links { "mozjs60-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-mozjs52", description = "Search standard paths for libmozjs52, instead of using bundled copy" } +newoption { trigger = "with-system-mozjs", description = "Search standard paths for libmozjs60, 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: build/workspaces/clean-workspaces.sh =================================================================== --- build/workspaces/clean-workspaces.sh +++ build/workspaces/clean-workspaces.sh @@ -33,11 +33,17 @@ (cd ../../libraries/source/fcollada/src && rm -rf ./output) (cd ../../libraries/source/nvtt/src && rm -rf ./build) (cd ../../libraries/source/spidermonkey && rm -f .already-built) - (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-45.0.2) + (cd ../../libraries/source/spidermonkey && rm -rf ./lib) + (cd ../../libraries/source/spidermonkey && rm -rf ./include-unix-debug) + (cd ../../libraries/source/spidermonkey && rm -rf ./include-unix-release) + (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-62.9.1) fi # Still delete the directory of previous SpiderMonkey versions to # avoid wasting disk space if people clean workspaces after updating. +(cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-52.9.1pre1) +(cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-45.0.2) +(cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-38.0.0) (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-38.0.0) (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs31) (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs24) Index: build/workspaces/update-workspaces.sh =================================================================== --- build/workspaces/update-workspaces.sh +++ build/workspaces/update-workspaces.sh @@ -41,7 +41,7 @@ with_system_premake5=false without_nvtt=false with_system_nvtt=false -with_system_mozjs52=false +with_system_mozjs=false enable_atlas=true for i in "$@" @@ -50,7 +50,7 @@ --with-system-premake5 ) with_system_premake5=true ;; --without-nvtt ) without_nvtt=true; premake_args="${premake_args} --without-nvtt" ;; --with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;; - --with-system-mozjs52 ) with_system_mozjs52=true; premake_args="${premake_args} --with-system-mozjs52" ;; + --with-system-mozjs ) with_system_mozjs=true; premake_args="${premake_args} --with-system-mozjs" ;; --enable-atlas ) enable_atlas=true ;; --disable-atlas ) enable_atlas=false ;; -j* ) JOBS=$i ;; @@ -87,7 +87,7 @@ # Build/update bundled external libraries (cd ../../libraries/source/fcollada/src && ${MAKE} ${JOBS}) || die "FCollada build failed" echo - if [ "$with_system_mozjs52" = "false" ]; then + if [ "$with_system_mozjs" = "false" ]; then (cd ../../libraries/source/spidermonkey && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed" fi echo Index: libraries/source/spidermonkey/FixMSVCBuild.diff =================================================================== --- libraries/source/spidermonkey/FixMSVCBuild.diff +++ /dev/null @@ -1,447 +0,0 @@ - -# 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 =================================================================== --- libraries/source/spidermonkey/FixMozglue.diff +++ libraries/source/spidermonkey/FixMozglue.diff @@ -1,70 +1,12 @@ -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 +index 53758485ac3d..3b5ce063ebb4 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. +@@ -9,6 +9,7 @@ # 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'): + if CONFIG['JS_STANDALONE'] and not CONFIG['MOZ_MEMORY']: + Library('mozglue') ++ FINAL_LIBRARY = 'js' + elif CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'): SharedLibrary('mozglue') else: - Library('mozglue') Index: libraries/source/spidermonkey/FixPersistentRootedSymbol.diff =================================================================== --- libraries/source/spidermonkey/FixPersistentRootedSymbol.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h -index 4e925cba04..06d2a95440 100644 ---- a/js/public/RootingAPI.h -+++ b/js/public/RootingAPI.h -@@ -1019,6 +1019,7 @@ class PersistentRooted : public js::PersistentRootedBase, - MOZ_ASSERT(kind == js::THING_ROOT_OBJECT || - kind == js::THING_ROOT_SCRIPT || - kind == js::THING_ROOT_STRING || -+ kind == js::THING_ROOT_SYMBOL || - kind == js::THING_ROOT_ID || - kind == js::THING_ROOT_VALUE || - kind == js::THING_ROOT_TRACEABLE); - Index: libraries/source/spidermonkey/FixSharedArray.diff =================================================================== --- /dev/null +++ libraries/source/spidermonkey/FixSharedArray.diff @@ -0,0 +1,11 @@ +--- a/js/public/StructuredClone.h ++++ b/js/public/StructuredClone.h +@@ -328,7 +328,7 @@ + namespace js { + class SharedArrayRawBuffer; + +-class SharedArrayRawBufferRefs { ++class JS_PUBLIC_API SharedArrayRawBufferRefs { + public: + SharedArrayRawBufferRefs() = default; + SharedArrayRawBufferRefs(SharedArrayRawBufferRefs&& other) = default; \ No newline at end of file Index: libraries/source/spidermonkey/FixpsutilFreeBSD.diff =================================================================== --- libraries/source/spidermonkey/FixpsutilFreeBSD.diff +++ /dev/null @@ -1,50 +0,0 @@ ---- python/psutil/psutil/_psutil_bsd.c -+++ python/psutil/psutil/_psutil_bsd.c -@@ -957,11 +957,19 @@ psutil_sockaddr_matches(int family, int port, void *pc - psutil_sockaddr_addrlen(family)) == 0); - } - -+#if __FreeBSD_version >= 1200026 -+static struct xtcpcb * -+psutil_search_tcplist(char *buf, struct kinfo_file *kif) -+{ -+ struct xtcpcb *tp; -+ struct xinpcb *inp; -+#else - static struct tcpcb * - psutil_search_tcplist(char *buf, struct kinfo_file *kif) - { - struct tcpcb *tp; - struct inpcb *inp; -+#endif - struct xinpgen *xig, *oxig; - struct xsocket *so; - -@@ -969,9 +977,15 @@ psutil_search_tcplist(char *buf, struct kinfo_file *ki - for (xig = (struct xinpgen *)((char *)xig + xig->xig_len); - xig->xig_len > sizeof(struct xinpgen); - xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { -+#if __FreeBSD_version >= 1200026 -+ tp = (struct xtcpcb *)xig; -+ inp = &tp->xt_inp; -+ so = &inp->xi_socket; -+#else - tp = &((struct xtcpcb *)xig)->xt_tp; - inp = &((struct xtcpcb *)xig)->xt_inp; - so = &((struct xtcpcb *)xig)->xt_socket; -+#endif - - if (so->so_type != kif->kf_sock_type || - so->xso_family != kif->kf_sock_domain || -@@ -1019,7 +1033,11 @@ psutil_proc_connections(PyObject *self, PyObject *args - struct kinfo_file *freep = NULL; - struct kinfo_file *kif; - char *tcplist = NULL; -+#if __FreeBSD_version >= 1200026 -+ struct xtcpcb *tcp; -+#else - struct tcpcb *tcp; -+#endif - - PyObject *retList = PyList_New(0); - PyObject *tuple = NULL; Index: libraries/source/spidermonkey/README.txt =================================================================== --- libraries/source/spidermonkey/README.txt +++ libraries/source/spidermonkey/README.txt @@ -1,8 +1,5 @@ Important notice: ----------------- -This version of SpiderMonkey comes from -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 cause subtle bugs or network out-of-sync errors. @@ -32,26 +29,7 @@ If you still need to build on Windows, here's a short guide. 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.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 2.x (start-shell-msvc2015.bat) -3. Extract nspr to libraries/source/spidermonkey - 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#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 3.x (start-shell.bat) and run ./build.sh. - - +1. Go to https://firefox-source-docs.mozilla.org/setup/windows_build.html#mozillabuild +2. Download the latest mozbuild package and install it to C:/mozilla-build (default). +3. Run MozillaBuild 3.x (start-shell.bat) +4. cd to the build.sh directory and run ./build.sh Index: libraries/source/spidermonkey/build.sh =================================================================== --- libraries/source/spidermonkey/build.sh +++ libraries/source/spidermonkey/build.sh @@ -3,10 +3,10 @@ set -e # This should match the version in config/milestone.txt -FOLDER="mozjs-52.9.1pre1" +FOLDER="mozjs-60.9.1" # If same-version changes are needed, increment this. -LIB_VERSION="52.9.1pre1+2" -LIB_NAME="mozjs52-ps" +LIB_VERSION="60.9.1+0" +LIB_NAME="mozjs60-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. @@ -36,14 +36,14 @@ --disable-jemalloc --disable-js-shell --without-intl-api - --enable-shared-js" # We're linking statically but JS has quirks with static-only compilation. + --enable-shared-js" # NSPR is needed on Windows for POSIX emulation. # If you want to build on Windows, check README.txt and edit the absolute paths # to match your environment. if [ "${OS}" = "Windows_NT" ] then - CONF_OPTS="${CONF_OPTS} --with-nspr-prefix="D:/nspr-4.21/nspr/"" + CONF_OPTS="${CONF_OPTS} --enable-nspr-build --with-visual-studio-version=2015" else CONF_OPTS="${CONF_OPTS} --enable-posix-nspr-emulation" fi @@ -86,7 +86,7 @@ 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" + $download "https://github.com/wraitii/spidermonkey-tarballs/releases/download/v60.9.1/${FOLDER}.tar.bz2" fi tar xjf "${FOLDER}.tar.bz2" @@ -148,10 +148,10 @@ # 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}/build-release/dist/include" - rm mozzconf.h zconf.h zlib.h + rm -f mozzconf.h zconf.h zlib.h popd pushd "${FOLDER}/build-debug/dist/include" - rm mozzconf.h zconf.h zlib.h + rm -f mozzconf.h zconf.h zlib.h popd fi @@ -163,29 +163,36 @@ cp -R -L "${FOLDER}"/build-release/dist/include/* "${INCLUDE_DIR_RELEASE}/" cp -R -L "${FOLDER}"/build-debug/dist/include/* "${INCLUDE_DIR_DEBUG}/" +# These align the ligns below, making it easier to check for mistakes. +DEB="debug" +REL="release" + mkdir -p lib/ if [ "`uname -s`" = "Darwin" ] then - # On MacOS, copy the static library. - 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}" -else - cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}${LIB_NAME}-debug${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-debug${LIB_SUFFIX}" - cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}${LIB_NAME}-debug${LIB_SUFFIX}" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-debug${LIB_SUFFIX}" - cp -L "${FOLDER}/build-release/js/src/${LIB_PREFIX}${LIB_NAME}-release${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-release${LIB_SUFFIX}" - cp -L "${FOLDER}/build-release/js/src/${LIB_PREFIX}${LIB_NAME}-release${LIB_SUFFIX}" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-release${LIB_SUFFIX}" -fi - -if [ "${OS}" = "Windows_NT" ] + # On MacOS, copy the static libraries only. + cp -L "${FOLDER}/build-${DEB}/js/src/build/${LIB_PREFIX}js_static${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" + cp -L "${FOLDER}/build-${REL}/js/src/build/${LIB_PREFIX}js_static${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-${REL}${LIB_SUFFIX}" +elif [ "${OS}" = "Windows_NT" ] then - # On Windows, copy also auxiliary libraries. - cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}nspr4.dll" "../../../binaries/system/${LIB_PREFIX}nspr4.dll" - cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}plc4.dll" "../../../binaries/system/${LIB_PREFIX}plc4.dll" - cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}plds4.dll" "../../../binaries/system/${LIB_PREFIX}plds4.dll" - cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}mozjs-52-debug.dll" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-debug.dll" - cp -L "${FOLDER}/build-release/js/src/${LIB_PREFIX}mozjs-52-release.dll" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-release.dll" - cp -L "${FOLDER}/build-debug/js/src/${LIB_PREFIX}mozjs-52-debug.pdb" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-debug.pdb" - cp -L "${FOLDER}/build-release/js/src/${LIB_PREFIX}mozjs-52-release.pdb" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-release.pdb" + # Windows needs DLLs to binaries/, static stubs to lib/ and debug symbols + cp -L "${FOLDER}/build-${DEB}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" + cp -L "${FOLDER}/build-${REL}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${REL}${LIB_SUFFIX}" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-${REL}${LIB_SUFFIX}" + cp -L "${FOLDER}/build-${DEB}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${DEB}.lib" "lib/${LIB_PREFIX}${LIB_NAME}-${DEB}.lib" + cp -L "${FOLDER}/build-${REL}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${REL}.lib" "lib/${LIB_PREFIX}${LIB_NAME}-${REL}.lib" + # Copy debug symbols as well. + cp -L "${FOLDER}/build-${DEB}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${DEB}.pdb" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-${DEB}.pdb" + cp -L "${FOLDER}/build-${REL}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${REL}.pdb" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-${REL}.pdb" + # Windows need some additional libraries for posix emulation. + cp -L "${FOLDER}/build-release/dist/bin/${LIB_PREFIX}nspr4.dll" "../../../binaries/system/${LIB_PREFIX}nspr4.dll" + cp -L "${FOLDER}/build-release/dist/bin/${LIB_PREFIX}plc4.dll" "../../../binaries/system/${LIB_PREFIX}plc4.dll" + cp -L "${FOLDER}/build-release/dist/bin/${LIB_PREFIX}plds4.dll" "../../../binaries/system/${LIB_PREFIX}plds4.dll" +else + # Copy shared libs to both lib/ and binaries/ so the compiler and executable (resp.) can find them. + cp -L "${FOLDER}/build-${DEB}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" + cp -L "${FOLDER}/build-${REL}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${REL}${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-${REL}${LIB_SUFFIX}" + cp -L "${FOLDER}/build-${DEB}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" + cp -L "${FOLDER}/build-${REL}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${REL}${LIB_SUFFIX}" "../../../binaries/system/${LIB_PREFIX}${LIB_NAME}-${REL}${LIB_SUFFIX}" fi # Flag that it's already been built successfully so we can skip it next time Index: libraries/source/spidermonkey/patch.sh =================================================================== --- libraries/source/spidermonkey/patch.sh +++ libraries/source/spidermonkey/patch.sh @@ -1,31 +1,15 @@ #!/bin/sh # Apply patches if needed -# This script gets called from build-osx-libs.sh and build.sh. +# This script gets called from build.sh. -# 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 - -# 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. +# Mozglue symbols need to be linked against static builds. # https://bugzilla.mozilla.org/show_bug.cgi?id=1588340 patch -p1 < ../FixMozglue.diff # Update library names to have separate debug/release libraries. patch -p1 < ../RenameLibs.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 - -# GCC 9 and 10 fail to build with -Werror=format, so disable it. -# https://bugs.gentoo.org/693556 -patch -p1 < ../DisableGCC9WerrorFormat.diff - +# Fix ~SharedArrayRawBufferRefs symbol not found. +# See https://bugzilla.mozilla.org/show_bug.cgi?id=1644600 +# Many thanks to bellaz89 for finding this and reporting it +patch -p1 < ../FixSharedArray.diff Index: source/scriptinterface/ScriptTypes.h =================================================================== --- source/scriptinterface/ScriptTypes.h +++ source/scriptinterface/ScriptTypes.h @@ -73,7 +73,7 @@ # pragma GCC diagnostic pop #endif -#if MOZJS_MAJOR_VERSION != 52 +#if MOZJS_MAJOR_VERSION != 60 #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 \