# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= firefox VERSION= 125.0.3 KEYWORDS= www VARIANTS= standard SDESC[standard]= Mozilla web browser HOMEPAGE= https://www.mozilla.org/en-US/firefox/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= MOZILLA/firefox/releases/125.0.3/source DISTFILE[1]= firefox-125.0.3.source.tar.xz:main DF_INDEX= 1 SPKGS[standard]= single OPTIONS_AVAILABLE= MOLD OPTIONS_STANDARD= MOLD OPT_ON[linux]= MOLD BUILD_DEPENDS= autoconf213:single:standard cbindgen:single:standard clang:complete:standard dav1d:dev:standard evdev-proto:single:standard ffmpeg:dev:standard harfbuzz:dev:standard icu:dev:standard libcanberra:dev:standard libevent:dev:standard libnotify:dev:standard libproxy:dev:standard llvm:tools:standard nasm:primary:standard nodejs:primary:standard nss:dev:standard pciutils:dev:standard python-sqlite3:single:python_used rust:single:standard yasm:single:standard zip:single:standard BUILDRUN_DEPENDS= dav1d:primary:standard dbus-glib:primary:standard ffmpeg:primary:standard harfbuzz:primary:standard icu:primary:standard libcanberra:primary:standard libdrm:primary:standard libevent:primary:standard libffi:primary:standard libnotify:primary:standard libproxy:primary:standard nss:primary:standard pciutils:primary:standard RUN_DEPENDS= icu:data:standard B_DEPS[linux]= alsa-lib:dev:standard BR_DEPS[linux]= sndio:single:standard alsa-lib:primary:standard BR_DEPS[netbsd]= sndio:single:standard USES= cpe desktop-utils:single gmake jpeg perl:build pkgconfig png python:v11,build zlib GNOME_COMPONENTS= gdkpixbuf gtk3 XORG_COMPONENTS= pixman xcb ice sm LICENSE= MPL:single LICENSE_TERMS= single:{{WRKSRC}}/toolkit/content/license.html LICENSE_FILE= MPL:stock LICENSE_SCHEME= solo CPE_VENDOR= mozilla FPC_EQUIVALENT= www/firefox MUST_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes CONFIGURE_ENV= PYTHON3={{PYTHON_CMD}} SETUPTOOLS_USE_DISTUTILS=stdlib BINDGEN_CFLAGS="-I{{LOCALBASE}}/include" MAKE_ENV= PYTHON3={{PYTHON_CMD}} CXXSTDLIB="stdc++" QMAKE_ARGS= --enable-application=browser --enable-chrome-format=omni --enable-default-toolkit=cairo-gtk3 --enable-install-strip --enable-official-branding --enable-optimize --enable-release --enable-strip --enable-libproxy --enable-system-ffi --enable-system-pixman --disable-alsa --disable-debug --disable-debug-symbols --disable-dtrace --disable-jack --disable-profiling --disable-pulseaudio --disable-tests --disable-updater --disable-webrtc --disable-hardening --prefix="{{PREFIX}}" --with-intl-api --with-system-icu --with-system-jpeg --with-system-libevent --with-system-nspr --with-system-nss --with-system-png --with-system-zlib --without-wasm-sandboxed-libraries VAR_OPSYS[linux]= QMAKE_ARGS=--disable-elf-hack QMAKE_ARGS=--enable-audio-backends=sndio CONFIGURE_ENV=PKG_CONFIG_LIBDIR={{LOCALBASE}}/lib/pkgconfig VAR_OPSYS[netbsd]= QMAKE_ARGS=--enable-audio-backends=sndio VAR_OPSYS[midnightbsd]= MAKEFILE_LINE=CONFIGURE_TARGET=x86_64-raven-freebsd12.3 [MOLD].DESCRIPTION= Link Firefox with MOLD rather than ports linker [MOLD].BUILD_DEPENDS_ON= mold:primary:standard [MOLD].QMAKE_ARGS_ON= --enable-linker=mold post-patch: ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp ${REINPLACE_CMD} -e 's/%u/%U/' -e '/X-MultipleArgs/d' \ -e '/^Icon/s/=.*/=firefox/' \ ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop (cd ${WRKSRC}/gfx/angle/checkout/src/compiler/translator && \ ${REINPLACE_CMD} -e 's|||' \ InfoSink.h IntermNode.cpp) # disable SCTP ${REINPLACE_CMD} -e 's|MOZ_SCTP|MOZ_DISABLE_SCTP|' \ ${WRKSRC}/netwerk/moz.build # disable rust checksums ${REINPLACE_CMD} -e 's/"files":{[^}]*}/"files":{}/' \ ${WRKSRC}/third_party/rust/libc/.cargo-checksum.json # Fix midnight ${REINPLACE_CMD} -e "s|%%MBSD64_TGT%%|x86_64-raven-freebsd12.3|" \ ${WRKSRC}/build/autoconf/config.guess # Set mozilla options @${ECHO_CMD} "--=> Setting configuration <=--" @for arg in ${QMAKE_ARGS}; do \ ${ECHO_CMD} ".mozconfig << $$arg" ;\ ${ECHO_CMD} ac_add_options $$arg >> ${WRKSRC}/.mozconfig ;\ done @${ECHO_CMD} LDFLAGS=\"-lm -Wl,-rpath,${PREFIX}/lib/firefox\" \ >> ${WRKSRC}/.mozconfig post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps \ ${STAGEDIR}${PREFIX}/share/applications ${INSTALL_DATA} ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop \ ${STAGEDIR}${PREFIX}/share/applications/ (cd ${STAGEDIR}${PREFIX}/share/pixmaps &&\ ${LN} -s ../../lib/firefox/browser/chrome/icons/default/default48.png firefox.png) # Rewrite symlink to make it relative instead of absolute (cd ${STAGEDIR}${PREFIX}/bin &&\ ${RM} firefox &&\ ${LN} -s ../lib/firefox/firefox firefox) [FILE:527:descriptions/desc.single] Firefox is a full-featured standard-compliant web browser, built on the Mozilla codebase by thousands of contributors around the world. It is extensible through thousands of user-contributed extensions, and features: * Improved Security; * Improved Tabbed Browsing, with tab grouping; * Private Browsing; * Spell Checking; * Search Suggestions; * Session Restore; * Web Feeds (RSS); * Live Titles; * Integrated Search; * Live Bookmarks; * Pop-up Blocker; * Phishing Protection; * Themes; * Search Engine Manager. [FILE:108:distinfo] 461c66b85e4a0345dcce422d3b66212489f3cca8f22a9a8f43a07a0c98bd5616 551590872 firefox-125.0.3.source.tar.xz [FILE:999:manifests/plist.single] %%ONLY-LINUX%%lib/firefox/ Throbber-small.gif crashreporter crashreporter.ini libmozsandbox.so minidump-analyzer %%ONLY-LINUX%%lib/firefox/browser/crashreporter-override.ini bin/firefox lib/firefox/ application.ini dependentlibs.list firefox firefox-bin glxtest libgkcodecs.so libipcclientcerts.so liblgpllibs.so libmozavcodec.so libmozavutil.so libmozgtk.so libmozsqlite3.so libxul.so omni.ja pingsender platform.ini removed-files vaapitest lib/firefox/browser/omni.ja lib/firefox/browser/chrome/icons/default/ default128.png default16.png default32.png default48.png default64.png lib/firefox/browser/features/ formautofill@mozilla.org.xpi pictureinpicture@mozilla.org.xpi screenshots@mozilla.org.xpi webcompat-reporter@mozilla.org.xpi webcompat@mozilla.org.xpi lib/firefox/defaults/pref/channel-prefs.js lib/firefox/fonts/TwemojiMozilla.ttf lib/firefox/gmp-clearkey/0.1/ libclearkey.so manifest.json share/applications/firefox.desktop share/pixmaps/firefox.png [FILE:4649:patches/patch-addon-search] https://github.com/mozilla/addons/issues/708 https://github.com/mozilla/addons-frontend/issues/4610 diff --git browser/app/profile/firefox.js browser/app/profile/firefox.js index 5964d40ca3a3..ed81b06af8d5 100644 --- browser/app/profile/firefox.js +++ browser/app/profile/firefox.js @@ -39,7 +39,7 @@ pref("extensions.postDownloadThirdPartyPrompt", true); // Preferences for AMO integration pref("extensions.getAddons.cache.enabled", true); pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/api/v4/addons/search/?guid=%IDS%&lang=%LOCALE%"); -pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=%OS%&appver=%VERSION%"); +pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=Linux&appver=%VERSION%"); pref("extensions.getAddons.link.url", "https://addons.mozilla.org/%LOCALE%/firefox/"); pref("extensions.getAddons.langpacks.url", "https://services.addons.mozilla.org/api/v4/addons/language-tools/?app=firefox&type=language&appversion=%VERSION%"); pref("extensions.getAddons.discovery.api_url", "https://services.addons.mozilla.org/api/v4/discovery/?lang=%LOCALE%&edition=%DISTRIBUTION%"); @@ -214,8 +214,8 @@ pref("app.update.langpack.enabled", true); // .. etc .. // pref("extensions.update.enabled", true); -pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); -pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); +pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=Linux&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); +pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=Linux&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); pref("extensions.update.interval", 86400); // Check for updates to Extensions and // Themes every day diff --git toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs index e854e04b3ce2..27e8247eb886 100644 --- toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs +++ toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs @@ -715,7 +715,7 @@ export var AddonRepository = { addon.version = String(aEntry.current_version.version); if (Array.isArray(aEntry.current_version.files)) { for (let file of aEntry.current_version.files) { - if (file.platform == "all" || file.platform == lazy.PLATFORM) { + if (file.platform == "all" || file.platform == "linux" || file.platform == lazy.PLATFORM) { if (file.url) { addon.sourceURI = lazy.NetUtil.newURI(file.url); } diff --git toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs index 5d1d2c19706b..4dcba06a95f4 100644 --- toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs +++ toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs @@ -632,7 +632,7 @@ export class AddonInternal { // Something is causing errors in here try { for (let platform of this.targetPlatforms) { - if (platform.os == Services.appinfo.OS) { + if (platform.os == "Linux" || platform.os == Services.appinfo.OS) { if (platform.abi) { needsABI = true; if (platform.abi === abi) { [FILE:642:patches/patch-browser_app_nsBrowserApp.cpp] diff --git browser/app/nsBrowserApp.cpp browser/app/nsBrowserApp.cpp index 87c2e16..a41f1d9 100644 --- browser/app/nsBrowserApp.cpp.orig 2023-06-08 22:09:31 UTC +++ browser/app/nsBrowserApp.cpp @@ -388,6 +388,9 @@ int main(int argc, char* argv[], char* e // Register an external module to report on otherwise uncatchable exceptions. CrashReporter::RegisterRuntimeExceptionModule(); + setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + #ifdef HAS_DLL_BLOCKLIST DllBlocklist_Initialize(gBlocklistInitFlags); #endif [FILE:2405:patches/patch-bug1504834_comment5] https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c5 https://bugzilla.mozilla.org/attachment.cgi?id=9028600 Rough progress patch diff --git gfx/2d/DrawTargetSkia.cpp gfx/2d/DrawTargetSkia.cpp index 6bbef8d..82b04ba 100644 --- gfx/2d/DrawTargetSkia.cpp.orig 2023-06-08 22:09:35 UTC +++ gfx/2d/DrawTargetSkia.cpp @@ -155,8 +155,7 @@ static IntRect CalculateSurfaceBounds(co return surfaceBounds.Intersect(bounds); } -static const int kARGBAlphaOffset = - SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0; +static const int kARGBAlphaOffset = 0; static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize, const int32_t aStride, SurfaceFormat aFormat) { --- gfx/2d/Types.h.orig 2023-06-08 22:09:33 UTC +++ gfx/2d/Types.h @@ -92,15 +92,8 @@ enum class SurfaceFormat : int8_t { // The following values are endian-independent synonyms. The _UINT32 suffix // indicates that the name reflects the layout when viewed as a uint32_t // value. -#if MOZ_LITTLE_ENDIAN() A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB -#elif MOZ_BIG_ENDIAN() - A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB - X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB -#else -# error "bad endianness" -#endif // The following values are OS and endian-independent synonyms. // --- gfx/skia/skia/modules/skcms/skcms.cc.orig 2023-06-08 22:09:35 UTC +++ gfx/skia/skia/modules/skcms/skcms.cc @@ -30,6 +30,8 @@ #include #include #endif +#else + #define SKCMS_PORTABLE #endif static bool runtime_cpu_detection = true; @@ -324,20 +326,28 @@ enum { static uint16_t read_big_u16(const uint8_t* ptr) { uint16_t be; memcpy(&be, ptr, sizeof(be)); -#if defined(_MSC_VER) - return _byteswap_ushort(be); +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + return be; #else + #if defined(_MSC_VER) + return _byteswap_ushort(be); + #else return __builtin_bswap16(be); + #endif #endif } static uint32_t read_big_u32(const uint8_t* ptr) { uint32_t be; memcpy(&be, ptr, sizeof(be)); -#if defined(_MSC_VER) - return _byteswap_ulong(be); +#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__ + return be; #else + #if defined(_MSC_VER) + return _byteswap_ulong(be); + #else return __builtin_bswap32(be); + #endif #endif } [FILE:3711:patches/patch-bug1559213] commit 717bba28411c Author: Jory A. Pratt Date: Thu Jun 13 11:53:00 2019 -0700 Bug 1559213 - Allow to use system av1 libs instead of bundled. --- config/external/moz.build | 5 +++-- config/system-headers.mozbuild | 8 ++++++++ dom/media/platforms/moz.build | 5 +++++ toolkit/moz.configure | 19 ++++++++++++++++++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git config/external/moz.build config/external/moz.build index 2fc8df57992e..63d18e50a961 100644 --- config/external/moz.build +++ config/external/moz.build @@ -40,8 +40,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]: external_dirs += ["media/libvpx"] if CONFIG["MOZ_AV1"]: - external_dirs += ["media/libaom"] - external_dirs += ["media/libdav1d"] + if not CONFIG["MOZ_SYSTEM_AV1"]: + external_dirs += ["media/libaom"] + external_dirs += ["media/libdav1d"] if not CONFIG["MOZ_SYSTEM_PNG"]: external_dirs += ["media/libpng"] diff --git dom/media/platforms/moz.build dom/media/platforms/moz.build index 5c6e25b3980b..ce99ebfb6d3f 100644 --- dom/media/platforms/moz.build +++ dom/media/platforms/moz.build @@ -81,6 +81,11 @@ if CONFIG["MOZ_AV1"]: "agnostic/AOMDecoder.cpp", "agnostic/DAV1DDecoder.cpp", ] + if CONFIG['MOZ_SYSTEM_AV1']: + CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS'] + OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS'] + CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS'] + OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS'] if CONFIG["MOZ_OMX"]: EXPORTS += [ diff --git media/ffvpx/libavcodec/moz.build media/ffvpx/libavcodec/moz.build index 761fc8cf4cd9..793a5b8697a8 100644 --- media/ffvpx/libavcodec/moz.build +++ media/ffvpx/libavcodec/moz.build @@ -120,10 +120,14 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']: 'vp9recon.c', 'vpx_rac.c', ] - USE_LIBS += [ - 'dav1d', - 'media_libdav1d_asm', - ] + if CONFIG["MOZ_SYSTEM_AV1"]: + CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS'] + OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS'] + else: + USE_LIBS += [ + 'dav1d', + 'media_libdav1d_asm', + ] if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": LOCAL_INCLUDES += ['/media/mozva'] SOURCES += [ diff --git toolkit/moz.configure toolkit/moz.configure index f93a5d64fec8..814357f4e979 100644 --- toolkit/moz.configure +++ toolkit/moz.configure @@ -744,7 +744,23 @@ def av1(value): return True -@depends(target, when=av1 & compile_environment) +option("--with-system-av1", + help="Use system av1 (located with pkgconfig)") + +system_libaom_info = pkg_check_modules("MOZ_SYSTEM_LIBAOM", "aom >= 1.0.0", + when="--with-system-av1") + +system_libdav1d_info = pkg_check_modules("MOZ_SYSTEM_LIBDAV1D", "dav1d >= 0.1.1", + when="--with-system-av1") + +@depends(system_libaom_info, system_libdav1d_info) +def system_av1(system_libaom_info, system_libdav1d_info): + has_av1_libs = False + if system_libaom_info and system_libdav1d_info: + has_av1_libs = True + return has_av1_libs + +@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment) def dav1d_asm(target): if target.cpu in ("aarch64", "x86", "x86_64"): return True @@ -760,6 +776,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm) set_define("MOZ_DAV1D_ASM", dav1d_asm) set_config("MOZ_AV1", av1) set_define("MOZ_AV1", av1) +set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True)) # JXL Image Codec Support # ============================================================== [FILE:2175:patches/patch-bug1659612] media/libcubeb/src/cubeb_alsa.c:613:9: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned int, const char *, ...)' [-Werror,-Wimplicit-function-declaration] r = snprintf(node_name, sizeof(node_name), "pcm.%s", string); ^ media/libcubeb/src/cubeb_alsa.c:613:9: note: include the header or explicitly provide a declaration for 'snprintf' media/libcubeb/src/cubeb_alsa.c:1168:3: error: implicitly declaring library function 'alloca' with type 'void *(unsigned int)' [-Werror,-Wimplicit-function-declaration] snd_pcm_hw_params_alloca(&hw_params); ^ /usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca' #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params) ^ /usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca' #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0) ^ media/libcubeb/src/cubeb_alsa.c:1168:3: note: include the header or explicitly provide a declaration for 'alloca' /usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca' #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params) ^ /usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca' #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0) ^ 2 errors generated. --- media/libcubeb/src/cubeb_alsa.c.orig 2023-06-08 22:09:41 UTC +++ media/libcubeb/src/cubeb_alsa.c @@ -5,12 +5,16 @@ * accompanying file LICENSE for details. */ #undef NDEBUG +#if defined(__FreeBSD__) +#define _GNU_SOURCE +#else #define _DEFAULT_SOURCE #define _BSD_SOURCE #if defined(__NetBSD__) #define _NETBSD_SOURCE /* timersub() */ #endif #define _XOPEN_SOURCE 500 +#endif #include "cubeb-internal.h" #include "cubeb/cubeb.h" #include "cubeb_tracing.h" [FILE:2089:patches/patch-bug1859752] # HG changeset patch # User AndrĂ© Bargull # Date 1699346749 0 # Node ID 0e7eefda24250041d7f008cc77dfa79045afa791 # Parent 1e39572cb1c784039a9e14b8c36396c66cf58a5d Bug 1859752 - Part 9: Add new line break classes. r=platform-i18n-reviewers,dminor Use `CLASS_CHARACTER` because that matches the previous character class for most characters which are now part of the new character classes. Depends on D192733 Differential Revision: https://phabricator.services.mozilla.com/D192734 diff --git intl/lwbrk/LineBreaker.cpp intl/lwbrk/LineBreaker.cpp --- intl/lwbrk/LineBreaker.cpp +++ intl/lwbrk/LineBreaker.cpp @@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB /* JT = 34, [JT] */ CLASS_CHARACTER, /* JV = 35, [JV] */ CLASS_CHARACTER, /* CLOSE_PARENTHESIS = 36, [CP] */ CLASS_CLOSE_LIKE_CHARACTER, /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE, /* HEBREW_LETTER = 38, [HL] */ CLASS_CHARACTER, /* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER, /* E_BASE = 40, [EB] */ CLASS_BREAKABLE, /* E_MODIFIER = 41, [EM] */ CLASS_CHARACTER, - /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER}; + /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER, + /* AKSARA = 43, [AK] */ CLASS_CHARACTER, + /* AKSARA_PREBASE = 44, [AP] */ CLASS_CHARACTER, + /* AKSARA_START = 45, [AS] */ CLASS_CHARACTER, + /* VIRAMA_FINAL = 46, [VF] */ CLASS_CHARACTER, + /* VIRAMA = 47, [VI] */ CLASS_CHARACTER, + }; static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass), "Gecko vs ICU LineBreak class mismatch"); auto cls = GetLineBreakClass(u); MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass)); // Overrides based on rules for the different line-break values given in [FILE:1020:patches/patch-bug1874059] commit 56c888446600991803fd92d668349101ad4bf160 Author: Christoph Moench-Tegeder Date: Tue Feb 6 22:51:27 2024 +0100 switch to -fvisibility flags this fixes linkage with llvm18 (which does not like the former approach via the #pragma in gcc_hidden.h PR: 276746 Submitted by: dim@ diff --git build/moz.configure/toolchain.configure build/moz.configure/toolchain.configure index d08b748db250..4696f69153f6 100644 --- build/moz.configure/toolchain.configure +++ build/moz.configure/toolchain.configure @@ -2186,7 +2186,7 @@ set_define("_LIBCPP_HIDE_FROM_ABI", libcxx_override_visibility.hide_from_abi) @depends(target, build_environment) def visibility_flags(target, env): if target.os != "WINNT": - if target.kernel == "Darwin": + if target.kernel == "Darwin" or target.kernel == "FreeBSD": return ("-fvisibility=hidden", "-fvisibility-inlines-hidden") return ( "-I%s/system_wrappers" % os.path.join(env.dist), [FILE:892:patches/patch-bug1876366] commit 46a89fb0319d673b3139a068e3d89aed9f44fc16 Author: Christoph Moench-Tegeder use gdk legacy cursor interface by default Upstream https://bugzilla.mozilla.org/show_bug.cgi?id=1876366#c16 hints that we could re-test this once we have GTK 3.24.42 (with the now-current gtk3-3.24.41 the original problem is still reproducable, but toggling this flag does fix it for me) diff --git modules/libpref/init/StaticPrefList.yaml modules/libpref/init/StaticPrefList.yaml index 835450712a12..f2249006c36d 100644 --- modules/libpref/init/StaticPrefList.yaml +++ modules/libpref/init/StaticPrefList.yaml @@ -16070,7 +16070,7 @@ # Whether to use gtk legacy cursor API. - name: widget.gtk.legacy-cursors.enabled type: bool - value: false + value: true mirror: always # Whether to use gtk high contrast themes to disable content styling like on [FILE:8485:patches/patch-bug847568] # Allow building against system-wide graphite2/harfbuzz. diff --git config/system-headers.mozbuild config/system-headers.mozbuild index 0c06f581b33b..10f125be25ab 100644 --- config/system-headers.mozbuild +++ config/system-headers.mozbuild @@ -1307,6 +1307,19 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]: "proxy.h", ] +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + system_headers += [ + 'graphite2/Font.h', + 'graphite2/Segment.h', + ] + +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + system_headers += [ + 'harfbuzz/hb-glib.h', + 'harfbuzz/hb-ot.h', + 'harfbuzz/hb.h', + ] + if CONFIG["MOZ_SYSTEM_ICU"]: system_headers += [ "unicode/calendar.h", diff --git dom/base/moz.build dom/base/moz.build index 14c9f9dd96fb..bd1c8f241e9b 100644 --- dom/base/moz.build +++ dom/base/moz.build @@ -606,6 +606,9 @@ FINAL_LIBRARY = "xul" if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] + GeneratedFile( "UseCounterList.h", script="gen-usecounters.py", diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build new file mode 100644 index 000000000000..24e8d7a03274 --- /dev/null +++ gfx/graphite2/geckoextra/moz.build @@ -0,0 +1,21 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +EXPORTS.graphite2 += [ + 'include/GraphiteExtra.h', + 'include/GraphiteStructsForRLBox.h', +] + +UNIFIED_SOURCES += [ + '../geckoextra/src/GraphiteExtra.cpp', +] + +CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] + +# Match bundled graphite2 configuration +AllowCompilerWarnings() + +FINAL_LIBRARY = 'gkmedias' diff --git gfx/harfbuzz/README-mozilla.fbsd gfx/harfbuzz/README-mozilla.fbsd new file mode 100644 index 000000000000..2a10eb1e2b42 --- /dev/null +++ gfx/harfbuzz/README-mozilla.fbsd @@ -0,0 +1,4 @@ +The in-tree copy may be omitted during build by --with-system-harfbuzz. +Make sure to keep pkg-config version check within toolkit/moz.configure in sync +with checkout version or increment latest tag by one if it's not based +on upstream release. diff --git gfx/moz.build gfx/moz.build index 56ea317bedfc..07dd7f66f1bc 100644 --- gfx/moz.build +++ gfx/moz.build @@ -10,6 +10,14 @@ with Files("**"): with Files("wr/**"): BUG_COMPONENT = ("Core", "Graphics: WebRender") +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: + DIRS += ["graphite2/geckoextra"] +else: + DIRS += ["graphite2/src" ] + +if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + DIRS += ["harfbuzz/src"] + DIRS += [ "cairo", "2d", @@ -19,8 +27,6 @@ DIRS += [ "qcms", "gl", "layers", - "graphite2/src", - "harfbuzz/src", "ots/src", "thebes", "ipc", diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py index c161d24df853..8c7dd395b371 100755 --- gfx/skia/generate_mozbuild.py +++ gfx/skia/generate_mozbuild.py @@ -91,6 +91,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): '-Wno-unused-private-field', ] +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'): LOCAL_INCLUDES += [ "/gfx/cairo/cairo/src", diff --git gfx/skia/moz.build gfx/skia/moz.build index 83aa2957a938..0859316a1f09 100644 --- gfx/skia/moz.build +++ gfx/skia/moz.build @@ -601,6 +601,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): '-Wno-unused-private-field', ] +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'): LOCAL_INCLUDES += [ "/gfx/cairo/cairo/src", diff --git gfx/thebes/moz.build gfx/thebes/moz.build index fd1fcf236d81..958d3f699ffd 100644 --- gfx/thebes/moz.build +++ gfx/thebes/moz.build @@ -293,7 +293,13 @@ if CONFIG["MOZ_WAYLAND"]: LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"] -DEFINES["GRAPHITE2_STATIC"] = True +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: + CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"] +else: + DEFINES["GRAPHITE2_STATIC"] = True + +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] CXXFLAGS += ["-Werror=switch"] diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build index 2bbd00415cae..f66bd37695d4 100644 --- intl/unicharutil/util/moz.build +++ intl/unicharutil/util/moz.build @@ -24,6 +24,9 @@ UNIFIED_SOURCES += [ "nsUnicodeProperties.cpp", ] +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] + include("/ipc/chromium/chromium-config.mozbuild") GeneratedFile( diff --git netwerk/dns/moz.build netwerk/dns/moz.build index c926d14707d1..35a3f33e2885 100644 --- netwerk/dns/moz.build +++ netwerk/dns/moz.build @@ -112,6 +112,9 @@ GeneratedFile( "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"] ) +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] + # need to include etld_data.inc LOCAL_INCLUDES += [ "/netwerk/base", diff --git old-configure.in old-configure.in index 2ca88a20a4b3..88bc9b873eff 100644 --- old-configure.in +++ old-configure.in @@ -1067,6 +1067,27 @@ fi AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID) AC_SUBST(MOZ_MACBUNDLE_ID) +dnl ======================================================== +dnl Check for graphite2 +dnl ======================================================== +if test -n "$MOZ_SYSTEM_GRAPHITE2"; then + dnl graphite2.pc has bogus version, check manually + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" + AC_TRY_COMPILE([ #include + #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ + ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ + * 100 + GR2_VERSION_BUGFIX >= \ + (major) * 10000 + (minor) * 100 + (bugfix) ) + ], [ + #if !GR2_VERSION_REQUIRE(1,3,14) + #error "Insufficient graphite2 version." + #endif + ], [], + [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) + CFLAGS=$_SAVE_CFLAGS +fi + dnl ======================================================== dnl = Child Process Name for IPC dnl ======================================================== diff --git toolkit/library/moz.build toolkit/library/moz.build index 76746f308011..f6844f4c400b 100644 --- toolkit/library/moz.build +++ toolkit/library/moz.build @@ -292,6 +292,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]: if CONFIG["MOZ_SYSTEM_WEBP"]: OS_LIBS += CONFIG["MOZ_WEBP_LIBS"] +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: + OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"] + +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"] + if CONFIG["MOZ_SYSTEM_LIBEVENT"]: OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"] diff --git toolkit/moz.configure toolkit/moz.configure index a060a59f728f..f0778d1ae2d6 100644 --- toolkit/moz.configure +++ toolkit/moz.configure @@ -1218,6 +1218,26 @@ def enable_cairo_ft(target, tree_freetype, freetype2_info): set_config("MOZ_ENABLE_CAIRO_FT", True, when=enable_cairo_ft) set_config("CAIRO_FT_CFLAGS", ft2_info.cflags, when=enable_cairo_ft) +# Graphite2 +# ============================================================== +option("--with-system-graphite2", + help="Use system graphite2 (located with pkgconfig)") + +system_graphite2 = pkg_check_modules("MOZ_GRAPHITE2", "graphite2", + when="--with-system-graphite2") + +set_config("MOZ_SYSTEM_GRAPHITE2", depends_if(system_graphite2)(lambda _: True)) + +# HarfBuzz +# ============================================================== +option("--with-system-harfbuzz", + help="Use system harfbuzz (located with pkgconfig)") + +system_harfbuzz = pkg_check_modules("MOZ_HARFBUZZ", "harfbuzz >= 2.7.4", + when="--with-system-harfbuzz") + +set_config("MOZ_SYSTEM_HARFBUZZ", depends_if(system_harfbuzz)(lambda _: True)) + # WebDriver (HTTP / BiDi) # ============================================================== [FILE:402:patches/patch-build_autoconf_config.guess] --- build/autoconf/config.guess.orig 2023-06-08 22:09:32 UTC +++ build/autoconf/config.guess @@ -284,7 +284,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + GUESS=%%MBSD64_TGT%% ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE [FILE:893:patches/patch-env-api-keys] # Accept API keys from environment like before bug 1294585 --- build/moz.configure/keyfiles.configure.orig 2023-06-08 22:09:32 UTC +++ build/moz.configure/keyfiles.configure @@ -19,6 +19,7 @@ def keyfile(desc, default=None, help=Non @checking("for the %s key" % desc, lambda x: x and x is not no_key) @imports(_from="__builtin__", _import="open") @imports(_from="__builtin__", _import="IOError") + @imports(_from="os", _import="environ") def keyfile(value): if value: try: @@ -29,7 +30,7 @@ def keyfile(desc, default=None, help=Non raise FatalCheckError("'%s' is empty." % value[0]) except IOError as e: raise FatalCheckError("'%s': %s." % (value[0], e.strerror)) - return no_key + return environ.get("MOZ_%s_KEY" % desc.upper().replace(" ", "_")) or no_key return keyfile [FILE:1188:patches/patch-gfx_skia_skia_src_base_SkContainers.cpp] DragonFly eventually gets malloc_usable_size, check again when sysroot updates --- gfx/skia/skia/src/base/SkContainers.cpp.orig 2023-06-08 22:09:35 UTC +++ gfx/skia/skia/src/base/SkContainers.cpp @@ -14,7 +14,7 @@ #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) #include -#elif defined(SK_BUILD_FOR_ANDROID) || (defined(SK_BUILD_FOR_UNIX) && !defined(__OpenBSD__)) +#elif defined(SK_BUILD_FOR_ANDROID) || (defined(SK_BUILD_FOR_UNIX) && !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__NetBSD__)) #include #elif defined(SK_BUILD_FOR_WIN) #include @@ -38,7 +38,7 @@ SkSpan complete_size(void* pt #elif defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 17 completeSize = malloc_usable_size(ptr); SkASSERT(completeSize >= size); - #elif defined(SK_BUILD_FOR_UNIX) && !defined(__OpenBSD__) + #elif defined(SK_BUILD_FOR_UNIX) && !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__NetBSD__) completeSize = malloc_usable_size(ptr); SkASSERT(completeSize >= size); #elif defined(SK_BUILD_FOR_WIN) [FILE:217:patches/patch-image_imgFrame.h] --- image/imgFrame.h.orig 2023-06-08 22:09:34 UTC +++ image/imgFrame.h @@ -9,6 +9,7 @@ #include #include +#include #include "AnimationParams.h" #include "MainThreadUtils.h" [FILE:316:patches/patch-ipc_chromium_src_base_platform__thread__posix.cc] --- ipc/chromium/src/base/platform_thread_posix.cc.orig 2023-06-08 22:35:48 UTC +++ ipc/chromium/src/base/platform_thread_posix.cc @@ -16,6 +16,8 @@ #elif defined(OS_LINUX) # include # include +#elif defined(OS_DRAGONFLY) +# include #endif #if !defined(OS_MACOSX) [FILE:614:patches/patch-ipc_chromium_src_base_shared__memory__posix.cc] --- ipc/chromium/src/base/shared_memory_posix.cc.orig 2023-08-03 14:46:56 UTC +++ ipc/chromium/src/base/shared_memory_posix.cc @@ -284,6 +284,11 @@ bool SharedMemory::AppendPosixShmPrefix( StringAppendF(str, "snap.%s.", snap); } # endif // XP_LINUX +# ifdef OS_DRAGONFLY + // DragonFly BSD has a userland IPC implementation, we need to prefix the + // path to shm_open(3), preferably with '/tmp' + StringAppendF(str, "tmp/"); +# endif // Hopefully the "implementation defined" name length limit is long // enough for this. StringAppendF(str, "org.mozilla.ipc.%d.", static_cast(pid)); [FILE:1584:patches/patch-js_public_Utility.h] commit 57b30241311091b5a6a5a0bb1c19a8e073860fc3 Author: Christoph Moench-Tegeder do not assert on alignment when not having the bits the underlying issue seemed to be win-only anyways? diff --git js/public/Utility.h js/public/Utility.h index 0d745e9df785..f0ca7ea37162 100644 --- js/public/Utility.h +++ js/public/Utility.h @@ -480,6 +480,7 @@ static inline void js_free(void* p) { * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS, * or the build will break. */ +#if !defined(__i386__) #define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS) \ template \ QUALIFIERS T* MOZ_HEAP_ALLOCATOR NEWNAME(Args&&... args) { \ @@ -490,6 +491,15 @@ static inline void js_free(void* p) { return MOZ_LIKELY(memory) ? new (memory) T(std::forward(args)...) \ : nullptr; \ } +#else +#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS) \ + template \ + QUALIFIERS T* MOZ_HEAP_ALLOCATOR NEWNAME(Args&&... args) { \ + void* memory = ALLOCATOR(sizeof(T)); \ + return MOZ_LIKELY(memory) ? new (memory) T(std::forward(args)...) \ + : nullptr; \ + } +#endif /* * Given a class which should provide a 'new' method that takes an arena as [FILE:318:patches/patch-js_src_old-configure.in] --- js/src/old-configure.in.orig 2023-06-08 22:35:48 UTC +++ js/src/old-configure.in @@ -652,7 +652,7 @@ then fi case "$target" in - *-*-freebsd*) + *-*-freebsd*|*-*-dragonfly*) AC_DEFINE(_REENTRANT) AC_DEFINE(_THREAD_SAFE) dnl -pthread links in -lpthread, so don't specify it explicitly. [FILE:361:patches/patch-media_libcubeb_src_cubeb__jack.cpp] --- media/libcubeb/src/cubeb_jack.cpp.orig 2023-06-08 22:09:41 UTC +++ media/libcubeb/src/cubeb_jack.cpp @@ -8,7 +8,7 @@ */ #define _DEFAULT_SOURCE #define _BSD_SOURCE -#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__) #define _POSIX_SOURCE #endif #include "cubeb-internal.h" [FILE:736:patches/patch-modules_fdlibm_src_math__private.h] commit 7a20fbf537ee0867244109d1ea48a8ad9de2e4ea Author: Christoph Moench-Tegeder align typedefs with our libm for historical CPUs diff --git modules/fdlibm/src/math_private.h modules/fdlibm/src/math_private.h index f4373f27834a..3b898241660f 100644 --- modules/fdlibm/src/math_private.h +++ modules/fdlibm/src/math_private.h @@ -30,9 +30,17 @@ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t */ +#ifdef __LP64__ typedef double __double_t; +#else +typedef long double __double_t; +#endif typedef __double_t double_t; +#ifdef __LP64__ typedef float __float_t; +#else +typedef long double __float_t; +#endif /* * The original fdlibm code used statements like: [FILE:2549:patches/patch-mozglue_misc_SSE.h] commit 70c3be521da1296f7ba47bd07b67927e43634d1b Author: Christoph Moench-Tegeder disable SSE and friends in builds for legacy architectures diff --git gfx/thebes/moz.build gfx/thebes/moz.build index 71903756ea19..3591cc0f38e8 100644 --- gfx/thebes/moz.build +++ gfx/thebes/moz.build @@ -174,7 +174,7 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": ] # Are we targeting x86 or x64? If so, build gfxAlphaRecoverySSE2.cpp. -if CONFIG["INTEL_ARCHITECTURE"]: +if CONFIG["INTEL_ARCHITECTURE"] and CONFIG['TARGET_CPU'] == 'x86_64': SOURCES += ["gfxAlphaRecoverySSE2.cpp"] # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. diff --git mozglue/misc/SSE.h mozglue/misc/SSE.h index 0b87366a8043..af0a0b38d23c 100644 --- mozglue/misc/SSE.h +++ mozglue/misc/SSE.h @@ -100,36 +100,50 @@ # define MOZILLA_PRESUME_MMX 1 # endif # ifdef __SSE__ +# if !defined(__386__) // It's ok to use SSE instructions based on the -march option (or // the default for x86_64 or for Intel Mac). # define MOZILLA_PRESUME_SSE 1 # endif +# endif # ifdef __SSE2__ +# if !defined(__386__) // It's ok to use SSE2 instructions based on the -march option (or // the default for x86_64 or for Intel Mac). # define MOZILLA_PRESUME_SSE2 1 # endif +# endif # ifdef __SSE3__ +# if !defined(__386__) // It's ok to use SSE3 instructions based on the -march option (or the // default for Intel Mac). # define MOZILLA_PRESUME_SSE3 1 # endif +# endif # ifdef __SSSE3__ +# if !defined(__386__) // It's ok to use SSSE3 instructions based on the -march option. # define MOZILLA_PRESUME_SSSE3 1 # endif +# endif # ifdef __SSE4A__ +# if !defined(__386__) // It's ok to use SSE4A instructions based on the -march option. # define MOZILLA_PRESUME_SSE4A 1 # endif +# endif # ifdef __SSE4_1__ +# if !defined(__386__) // It's ok to use SSE4.1 instructions based on the -march option. # define MOZILLA_PRESUME_SSE4_1 1 # endif +# endif # ifdef __SSE4_2__ +# if !defined(__386__) // It's ok to use SSE4.2 instructions based on the -march option. # define MOZILLA_PRESUME_SSE4_2 1 # endif +# endif # ifdef __AVX__ // It's ok to use AVX instructions based on the -march option. # define MOZILLA_PRESUME_AVX 1 @@ -144,8 +158,10 @@ # endif # ifdef HAVE_CPUID_H +# if !defined(__i386__) # define MOZILLA_SSE_HAVE_CPUID_DETECTION # endif +# endif #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64)) [FILE:5140:patches/patch-pipewire_init] Chase ABI from multimedia/pipewire/files/patch-src_pipewire_pipewire_init Ref: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1819 diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc index 1872a8684132..7e519f9e9cbb 100644 --- third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc @@ -417,7 +417,7 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( pw_stream_node_id_ = stream_node_id; - pw_init(/*argc=*/nullptr, /*argc=*/nullptr); + pipewire_init(/*argc=*/nullptr, /*argc=*/nullptr); pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc index ffba13775363..da6a828a21ee 100644 --- third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc +++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc @@ -36,7 +36,7 @@ TestScreenCastStreamProvider::TestScreenCastStreamProvider(Observer* observer, return; } - pw_init(/*argc=*/nullptr, /*argc=*/nullptr); + pipewire_init(/*argc=*/nullptr, /*argc=*/nullptr); pw_main_loop_ = pw_thread_loop_new("pipewire-test-main-loop", nullptr); diff --git third_party/libwebrtc/modules/portal/pipewire.sigs third_party/libwebrtc/modules/portal/pipewire.sigs index c3abf05b386f..a994c218f5a5 100644 --- third_party/libwebrtc/modules/portal/pipewire.sigs +++ third_party/libwebrtc/modules/portal/pipewire.sigs @@ -15,7 +15,7 @@ pw_loop * pw_loop_new(const spa_dict *props); // pipewire.h -void pw_init(int *argc, char **argv[]); +void pipewire_init(int *argc, char **argv[]); const char* pw_get_library_version(); // properties.h diff --git third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc index f2680b28162c..03476a5fffd0 100644 --- third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +++ third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc @@ -252,7 +252,7 @@ void PipeWireSession::InitPipeWire(int fd) { } bool PipeWireSession::StartPipeWire(int fd) { - pw_init(/*argc=*/nullptr, /*argv=*/nullptr); + pipewire_init(/*argc=*/nullptr, /*argv=*/nullptr); pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); diff --git third_party/pipewire/libpipewire/mozpipewire.cpp third_party/pipewire/libpipewire/mozpipewire.cpp index b8068296745e..7e8be3dc764f 100644 --- third_party/pipewire/libpipewire/mozpipewire.cpp +++ third_party/pipewire/libpipewire/mozpipewire.cpp @@ -58,7 +58,7 @@ struct pw_context * (*pw_context_new_fn)(struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size); static int (*pw_core_disconnect_fn)(struct pw_core *core); -static void (*pw_init_fn)(int *argc, char **argv[]); +static void (*pipewire_init_fn)(int *argc, char **argv[]); static void (*pw_proxy_destroy_fn)(struct pw_proxy *proxy); static void (*pw_stream_add_listener_fn)(struct pw_stream *stream, struct spa_hook *listener, @@ -103,7 +103,7 @@ bool IsPwLibraryLoaded() { IS_FUNC_LOADED(pw_context_destroy_fn) && IS_FUNC_LOADED(pw_context_new_fn) && IS_FUNC_LOADED(pw_core_disconnect_fn) && - IS_FUNC_LOADED(pw_init_fn) && + IS_FUNC_LOADED(pipewire_init_fn) && IS_FUNC_LOADED(pw_proxy_destroy_fn) && IS_FUNC_LOADED(pw_stream_add_listener_fn) && IS_FUNC_LOADED(pw_stream_connect_fn) && @@ -146,7 +146,7 @@ bool LoadPWLibrary() { GET_FUNC(pw_context_destroy, pwLib); GET_FUNC(pw_context_new, pwLib); GET_FUNC(pw_core_disconnect, pwLib); - GET_FUNC(pw_init, pwLib); + GET_FUNC(pipewire_init, pwLib); GET_FUNC(pw_stream_add_listener, pwLib); GET_FUNC(pw_stream_connect, pwLib); GET_FUNC(pw_stream_disconnect, pwLib); @@ -226,12 +226,12 @@ pw_core_disconnect(struct pw_core *core) } void -pw_init(int *argc, char **argv[]) +pipewire_init(int *argc, char **argv[]) { if (!LoadPWLibrary()) { return; } - return pw_init_fn(argc, argv); + return pipewire_init_fn(argc, argv); } void diff --git third_party/pipewire/pipewire/pipewire.h third_party/pipewire/pipewire/pipewire.h index b932103f46e6..2c88e28421ec 100644 --- third_party/pipewire/pipewire/pipewire.h +++ third_party/pipewire/pipewire/pipewire.h @@ -69,9 +69,9 @@ extern "C" { * \{ */ void -pw_init(int *argc, char **argv[]); +pipewire_init(int *argc, char **argv[]); -void pw_deinit(void); +void pipewire_deinit(void); bool pw_debug_is_category_enabled(const char *name); [FILE:2119:patches/patch-python_mozbuild_mozbuild_gn__processor.py] commit 6bfdff4afcc9e3843b9c3a5d7e884e281a305398 Author: Christoph Moench-Tegeder chase gn_processor.py changes diff --git python/mozbuild/mozbuild/gn_processor.py python/mozbuild/mozbuild/gn_processor.py index a77b6c7759f1..e5498ac5e9df 100644 --- python/mozbuild/mozbuild/gn_processor.py +++ python/mozbuild/mozbuild/gn_processor.py @@ -185,6 +185,7 @@ def filter_gn_config(path, gn_result, sandbox_vars, input_vars, gn_target): } oses = { "android": "Android", + "freebsd": "FreeBSD", "linux": "Linux", "mac": "Darwin", "openbsd": "OpenBSD", @@ -742,17 +743,17 @@ def main(): vars_set = [] for is_debug in (True, False): - for target_os in ("android", "linux", "mac", "openbsd", "win"): + for target_os in ("freebsd",): target_cpus = ["x64"] - if target_os in ("android", "linux", "mac", "win", "openbsd"): + if target_os in ("android", "freebsd", "linux", "mac", "win", "openbsd"): target_cpus.append("arm64") if target_os in ("android", "linux"): target_cpus.append("arm") - if target_os in ("android", "linux", "win"): + if target_os in ("android", "freebsd", "linux", "win"): target_cpus.append("x86") - if target_os in ("linux", "openbsd"): + if target_os in ("freebsd", "linux", "openbsd"): target_cpus.append("riscv64") - if target_os == "linux": + if target_os in ("freebsd", "linux"): target_cpus.extend(["ppc64", "mipsel", "mips64el"]) for target_cpu in target_cpus: vars = { @@ -761,7 +762,7 @@ def main(): "target_cpu": target_cpu, "target_os": target_os, } - if target_os == "linux": + if target_os in ("freebsd", "linux"): for use_x11 in (True, False): vars["use_x11"] = use_x11 vars_set.append(vars.copy()) [FILE:468:patches/patch-testing_mozbase_mozinfo_mozinfo_mozinfo.py] --- testing/mozbase/mozinfo/mozinfo/mozinfo.py.orig 2023-06-08 22:35:48 UTC +++ testing/mozbase/mozinfo/mozinfo/mozinfo.py @@ -131,7 +131,7 @@ elif system == "Linux": info["os"] = "linux" info["linux_distro"] = distribution -elif system in ["DragonFly", "FreeBSD", "NetBSD", "OpenBSD"]: +elif system in ["DragonFly", "FreeBSD", "NetBSD", "OpenBSD", "MidnightBSD"]: info["os"] = "bsd" version = os_version = sys.platform elif system == "Darwin": [FILE:361:patches/patch-third__party_libwebrtc_build_build__config.h] --- third_party/libwebrtc/build/build_config.h.orig 2023-06-08 22:09:49 UTC +++ third_party/libwebrtc/build/build_config.h @@ -76,7 +76,7 @@ #define OS_WIN 1 #elif defined(__Fuchsia__) #define OS_FUCHSIA 1 -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) #define OS_FREEBSD 1 #elif defined(__NetBSD__) #define OS_NETBSD 1 [FILE:515:patches/patch-third__party_sqlite3_src_moz.build] --- third_party/sqlite3/src/moz.build.orig 2023-06-08 22:35:48 UTC +++ third_party/sqlite3/src/moz.build @@ -92,7 +92,8 @@ DEFINES['SQLITE_TEMP_FILE_PREFIX'] = '"m # Enabling sqlite math functions DEFINES['SQLITE_ENABLE_MATH_FUNCTIONS'] = True -if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android": +if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android" or \ + CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "DragonFly": OS_LIBS += [ "m" ] [FILE:3543:patches/patch-toolkit_components_processtools_procinfo__bsd.c] diff --git toolkit/components/processtools/ProcInfo_bsd.cpp toolkit/components/processtools/ProcInfo_bsd.cpp index a6ff4881940c..f041ed5e50ce 100644 --- toolkit/components/processtools/ProcInfo_bsd.cpp +++ toolkit/components/processtools/ProcInfo_bsd.cpp @@ -18,6 +18,9 @@ #include #include #include +#ifdef __FreeBSD__ +#include +#endif namespace mozilla { @@ -50,25 +53,39 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync( } for (const auto& request : aRequests) { size_t size; +#ifdef __FreeBSD__ + int mib[4]; + int mibsize = 4; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; + mib[3] = request.pid; +#else int mib[6]; + int mibsize = 6; mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID | KERN_PROC_SHOW_THREADS; mib[3] = request.pid; mib[4] = sizeof(kinfo_proc); mib[5] = 0; - if (sysctl(mib, 6, nullptr, &size, nullptr, 0) == -1) { +#endif + if (sysctl(mib, mibsize, nullptr, &size, nullptr, 0) == -1) { // Can't get info for this process. Skip it. continue; } +#ifdef __FreeBSD__ + auto procs = MakeUniqueFallible(size / sizeof(kinfo_proc)); +#else mib[5] = size / sizeof(kinfo_proc); auto procs = MakeUniqueFallible(mib[5]); +#endif if (!procs) { result.SetReject(NS_ERROR_OUT_OF_MEMORY); return result; } - if (sysctl(mib, 6, procs.get(), &size, nullptr, 0) == -1 && + if (sysctl(mib, mibsize, procs.get(), &size, nullptr, 0) == -1 && errno != ENOMEM) { continue; } @@ -84,19 +101,34 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync( bool found = false; for (size_t i = 0; i < size / sizeof(kinfo_proc); i++) { const auto& p = procs[i]; +#ifdef __FreeBSD__ + if (i == 0) { +#else if (p.p_tid == -1) { +#endif // This is the process. found = true; +#ifdef __FreeBSD__ + info.cpuTime = uint64_t(p.ki_runtime) * 1'000u; + info.memory = (p.ki_tsize + p.ki_dsize + p.ki_ssize) * getpagesize(); +#else info.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u + uint64_t(p.p_rtime_usec) * 1'000u; info.memory = (p.p_vm_tsize + p.p_vm_dsize + p.p_vm_ssize) * getpagesize(); +#endif + } else { // This is one of its threads. ThreadInfo threadInfo; +#ifdef __FreeBSD__ + threadInfo.tid = p.ki_tid; + threadInfo.cpuTime = uint64_t(p.ki_runtime) * 1'000u; +#else threadInfo.tid = p.p_tid; threadInfo.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u + uint64_t(p.p_rtime_usec) * 1'000u; +#endif info.threads.AppendElement(threadInfo); } } diff --git toolkit/components/processtools/moz.build toolkit/components/processtools/moz.build index b7c164c1b0ac..a41dad52c343 100644 --- toolkit/components/processtools/moz.build +++ toolkit/components/processtools/moz.build @@ -39,7 +39,7 @@ BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"] # Platform-specific implementations of `ProcInfo`. toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"] if toolkit == "gtk" or toolkit == "android": - if CONFIG["OS_TARGET"] == "OpenBSD": + if CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "OpenBSD": UNIFIED_SOURCES += ["ProcInfo_bsd.cpp"] else: UNIFIED_SOURCES += ["ProcInfo_linux.cpp"] [FILE:498:patches/patch-toolkit_components_protobuf_src_google_protobuf_stubs_port.h] --- toolkit/components/protobuf/src/google/protobuf/stubs/port.h.orig 2023-06-08 22:09:52 UTC +++ toolkit/components/protobuf/src/google/protobuf/stubs/port.h @@ -59,7 +59,7 @@ #else #ifdef __APPLE__ #include // __BYTE_ORDER -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) #include // __BYTE_ORDER #elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)) #include // __BYTE_ORDER [FILE:362:patches/patch-toolkit_system_unixproxy_moz.build] --- toolkit/system/unixproxy/moz.build.orig 2024-04-19 17:45:00 UTC +++ toolkit/system/unixproxy/moz.build @@ -10,10 +10,6 @@ with Files("**"): if CONFIG["MOZ_ENABLE_LIBPROXY"]: CXXFLAGS += CONFIG["MOZ_LIBPROXY_CFLAGS"] SOURCES += [ - "nsLibProxySettings.cpp", - ] -else: - SOURCES += [ "nsUnixSystemProxySettings.cpp", ] [FILE:1519:patches/patch-tools_profiler_core_patform.cpp] commit 45a7951cb6a9b1735b9b6cec89db69b5933715c7 Author: Christoph Moench-Tegeder Date: Mon Mar 28 21:54:35 2022 +0200 FreeBSD can use sched_getcpu() from 1400046/1300524 on diff --git tools/profiler/core/platform.cpp tools/profiler/core/platform.cpp index 92bcc1100687..2f17a88942a8 100644 --- tools/profiler/core/platform.cpp.orig 2023-06-08 22:09:52 UTC +++ tools/profiler/core/platform.cpp @@ -115,6 +115,20 @@ # include #endif +#if defined(GP_OS_freebsd) +#include +// "after making CPU_SET macros compatible with glibc" +# if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000) +# include +# else +# if __x86_64__ || __i386__ +// similar cpuid_count() trick as on Darwin, using LLVM +// but not for all CPUs +# include +# endif +# endif +#endif + #if defined(GP_OS_windows) # include @@ -6703,6 +6717,19 @@ void profiler_mark_thread_awake() { cpuId = ebx >> 24; } # endif +#elif defined(GP_OS_freebsd) +# if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000) + cpuId = sched_getcpu(); +# elif defined(__amd64__) + unsigned int eax, ebx, ecx, edx; + __cpuid_count(1, 0, eax, ebx, ecx, edx); + // Check if we have an APIC. + if ((edx & (1 << 9))) { + // APIC ID is bits 24-31 of EBX + cpuId = ebx >> 24; + } +# endif +// the fallthrough is cpuID = 0 #else cpuId = sched_getcpu(); #endif [FILE:231:files/pkg-message-single] ========================================================================== If Firefox segfaults, try setting MOZ_FORCE_DISABLE_E10S=1 in environment. ========================================================================== [FILE:181:files/special.mk] .if defined(BUILD_WITH_CCACHE) # disable sccache - it freezes all the time # MAKE_ENV+= SCCACHE_DIR=${CCACHE_DIR}/sccache # MAKE_ENV+= RUSTC_WRAPPER=${LOCALBASE}/bin/sccache .endif