Index: ps/trunk/libraries/source/spidermonkey/FixFreeBSDCargoChecksum.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixFreeBSDCargoChecksum.diff +++ ps/trunk/libraries/source/spidermonkey/FixFreeBSDCargoChecksum.diff @@ -0,0 +1,9 @@ +diff --git a/third_party/rust/cc/.cargo-checksum.json b/third_party/rust/cc/.cargo-checksum.json +index 417fde7..61d7066 100644 +--- a/third_party/rust/cc/.cargo-checksum.json ++++ b/third_party/rust/cc/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.lock":"3aff5f8b0a7f4d72852b11b0526f0002e6bf55f19f1ebd6470d7f97fbd540e60","Cargo.toml":"6ab10d9b6a9c6f0909074e6698c90c6b6a7223661ec2e83174d2593117cbe7f2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"7184fbdf375a057e673257348f6d7584c0dd11b66318d98f3647f69eb610b097","src/bin/gcc-shim.rs":"b77907875029494b6288841c3aed2e4939ed40708c7f597fca5c9e2570490ca6","src/com.rs":"bcdaf1c28b71e6ef889c6b08d1ce9d7c0761344a677f523bc4c3cd297957f804","src/lib.rs":"4753929dbb7b676c19d7cfa06d0a47e37003554b80c536cbf2b892d591ef61c2","src/registry.rs":"3cc1b5a50879fa751572878ae1d0afbfc960c11665258492754b2c8bccb0ff5d","src/setup_config.rs":"7014103587d3382eac599cb76f016e2609b8140970861b2237982d1db24af265","src/winapi.rs":"ea8b7edbb9ff87957254f465c2334e714c5d6b3b19a8d757c48ea7ca0881c50c","src/windows_registry.rs":"388e79dcf3e84078ae0b086c6cdee9cf9eb7e3ffafdcbf3e2df26163661f5856","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"71620b178583b6e6e5e0d4cac14e2cef6afc62fb6841e0c72ed1784543abf8ac","tests/test.rs":"1605640c9b94a77f48fc92e1dc0485bdf1960da5626e2e00279e4703691656bc"},"package":"aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8"} +\ No newline at end of file ++{"files":{"Cargo.lock":"3aff5f8b0a7f4d72852b11b0526f0002e6bf55f19f1ebd6470d7f97fbd540e60","Cargo.toml":"6ab10d9b6a9c6f0909074e6698c90c6b6a7223661ec2e83174d2593117cbe7f2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"7184fbdf375a057e673257348f6d7584c0dd11b66318d98f3647f69eb610b097","src/bin/gcc-shim.rs":"b77907875029494b6288841c3aed2e4939ed40708c7f597fca5c9e2570490ca6","src/com.rs":"bcdaf1c28b71e6ef889c6b08d1ce9d7c0761344a677f523bc4c3cd297957f804","src/lib.rs":"ba6cf8f55dc05d4ae2ae2dbb46c100abeb12da5dfb354df44ca238951b36ccab","src/registry.rs":"3cc1b5a50879fa751572878ae1d0afbfc960c11665258492754b2c8bccb0ff5d","src/setup_config.rs":"7014103587d3382eac599cb76f016e2609b8140970861b2237982d1db24af265","src/winapi.rs":"ea8b7edbb9ff87957254f465c2334e714c5d6b3b19a8d757c48ea7ca0881c50c","src/windows_registry.rs":"388e79dcf3e84078ae0b086c6cdee9cf9eb7e3ffafdcbf3e2df26163661f5856","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"71620b178583b6e6e5e0d4cac14e2cef6afc62fb6841e0c72ed1784543abf8ac","tests/test.rs":"1605640c9b94a77f48fc92e1dc0485bdf1960da5626e2e00279e4703691656bc"},"package":"aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8"} +\ No newline at end of file Index: ps/trunk/libraries/source/spidermonkey/FixFreeBSDReadlineDetection.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixFreeBSDReadlineDetection.diff +++ ps/trunk/libraries/source/spidermonkey/FixFreeBSDReadlineDetection.diff @@ -0,0 +1,15 @@ +diff --git a/js/moz.configure b/js/moz.configure +index b1c9685..018ffc3 100644 +--- a/js/moz.configure ++++ b/js/moz.configure +@@ -696,8 +696,8 @@ def editline(js_shell, is_windows, compile_environment): + js_option('--enable-readline', help='Link js shell to system readline library', + when=editline) + +-has_readline = check_symbol('readline', flags=['-lreadline'], when='--enable-readline', +- onerror=lambda: die('No system readline library found')) ++has_readline = check_symbol('readline', flags=['-lreadline', '-L%%LOCALBASE%%/lib'], when='--enable-readline', ++ onerror=lambda: die('No system readline library found')) + + set_config('EDITLINE_LIBS', ['-lreadline'], when=has_readline) + Index: ps/trunk/libraries/source/spidermonkey/FixFreeBSDRustThirdPartyOSDetection.diff =================================================================== --- ps/trunk/libraries/source/spidermonkey/FixFreeBSDRustThirdPartyOSDetection.diff +++ ps/trunk/libraries/source/spidermonkey/FixFreeBSDRustThirdPartyOSDetection.diff @@ -0,0 +1,34 @@ +diff --git a/third_party/rust/cc/src/lib.rs b/third_party/rust/cc/src/lib.rs +index 621d31d..4d170f5 100644 +--- a/third_party/rust/cc/src/lib.rs ++++ b/third_party/rust/cc/src/lib.rs +@@ -2344,28 +2344,7 @@ impl Tool { + } + + fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self { +- // Try to detect family of the tool from its name, falling back to Gnu. +- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { +- if fname.contains("clang-cl") { +- ToolFamily::Msvc { clang_cl: true } +- } else if fname.contains("cl") +- && !fname.contains("cloudabi") +- && !fname.contains("uclibc") +- && !fname.contains("clang") +- { +- ToolFamily::Msvc { clang_cl: false } +- } else if fname.contains("clang") { +- match clang_driver { +- Some("cl") => ToolFamily::Msvc { clang_cl: true }, +- _ => ToolFamily::Clang, +- } +- } else { +- ToolFamily::Gnu +- } +- } else { +- ToolFamily::Gnu +- }; +- ++ let family = ToolFamily::Gnu; + Tool { + path: path, + cc_wrapper_path: None, Index: ps/trunk/libraries/source/spidermonkey/build.sh =================================================================== --- ps/trunk/libraries/source/spidermonkey/build.sh +++ ps/trunk/libraries/source/spidermonkey/build.sh @@ -5,7 +5,7 @@ # This should match the version in config/milestone.txt FOLDER="mozjs-78.6.0" # If same-version changes are needed, increment this. -LIB_VERSION="78.6.0+1" +LIB_VERSION="78.6.0+2" LIB_NAME="mozjs78-ps" # Since this script is called by update-workspaces.sh, we want to quickly @@ -113,19 +113,22 @@ cd "$FOLDER" fi -mkdir -p build-debug -cd build-debug -# SM configure checks for autoconf, but we don't actually need it. -# To avoid a dependency, pass something arbitrary (it does need to be an actual program). -# llvm-objdump is searched for with the complete name, not simply 'objdump', account for that. -CXXFLAGS="${CXXFLAGS}" ../js/src/configure AUTOCONF="ls" \ - LLVM_OBJDUMP="${LLVM_OBJDUMP}" \ - ${CONF_OPTS} \ - --enable-debug \ - --disable-optimize \ - --enable-gczeal -${MAKE} ${MAKE_OPTS} -cd .. +# Debug version of SM is broken on FreeBSD. +if [ "$(uname -s)" != "FreeBSD" ]; then + mkdir -p build-debug + cd build-debug + # SM configure checks for autoconf, but we don't actually need it. + # To avoid a dependency, pass something arbitrary (it does need to be an actual program). + # llvm-objdump is searched for with the complete name, not simply 'objdump', account for that. + CXXFLAGS="${CXXFLAGS}" ../js/src/configure AUTOCONF="ls" \ + LLVM_OBJDUMP="${LLVM_OBJDUMP}" \ + ${CONF_OPTS} \ + --enable-debug \ + --disable-optimize \ + --enable-gczeal + ${MAKE} ${MAKE_OPTS} + cd .. +fi mkdir -p build-release cd build-release @@ -176,10 +179,13 @@ # 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}"/build-release/dist/include/* "${INCLUDE_DIR_RELEASE}/" -cp -R -L "${FOLDER}"/build-debug/dist/include/* "${INCLUDE_DIR_DEBUG}/" + +if [ "$(uname -s)" != "FreeBSD" ]; then + mkdir -p "${INCLUDE_DIR_DEBUG}" + cp -R -L "${FOLDER}"/build-debug/dist/include/* "${INCLUDE_DIR_DEBUG}/" +fi # These align the ligns below, making it easier to check for mistakes. DEB="debug" @@ -215,10 +221,12 @@ 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}" + if [ "$(uname -s)" != "FreeBSD" ]; then + 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-${DEB}/js/src/build/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" "lib/${LIB_PREFIX}${LIB_NAME}-${DEB}${LIB_SUFFIX}" + fi fi # Flag that it's already been built successfully so we can skip it next time Index: ps/trunk/libraries/source/spidermonkey/patch.sh =================================================================== --- ps/trunk/libraries/source/spidermonkey/patch.sh +++ ps/trunk/libraries/source/spidermonkey/patch.sh @@ -36,5 +36,16 @@ # Fix FP access breaking compilation on RPI3+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1526653 -# https://bugzilla.mozilla.org/show_bug.cgi?id=1536491 +# https://bugzilla.mozilla.org/show_bug.cgi?id=1536491 patch -p1 < ../FixRpiUnalignedFpAccess.diff + +# Patch those separately, as they might interfere with normal behaviour. +if [ "$(uname -s)" = "FreeBSD" ]; +then + # https://svnweb.freebsd.org/ports/head/lang/spidermonkey78/files/patch-js_moz.configure?view=log + patch -p1 < ../FixFreeBSDReadlineDetection.diff + # https://svnweb.freebsd.org/ports/head/lang/spidermonkey78/files/patch-third__party_rust_cc_.cargo-checksum.json?view=log + patch -p1 < ../FixFreeBSDCargoChecksum.diff + # https://svnweb.freebsd.org/ports/head/lang/spidermonkey78/files/patch-third__party_rust_cc_src_lib.rs?view=log + patch -p1 < ../FixFreeBSDRustThirdPartyOSDetection.diff +fi