diff options
author | Evgeniy Khramtsov <evgeniy@khramtsov.org> | 2022-02-01 00:30:08 +0000 |
---|---|---|
committer | Christoph Moench-Tegeder <cmt@FreeBSD.org> | 2022-02-01 16:31:51 +0000 |
commit | a012dd67b23d35b6a44c8b8b3ecaf0f750bb9238 (patch) | |
tree | a1743d756c5964d3a59848aeacf89805eaa09e74 | |
parent | b6643bf0a337f1043b1c6ea99cd9a6d2ec049713 (diff) |
www/firefox: update to 97.0 (rc1)
Release Notes (soon):
https://www.mozilla.org/en-US/firefox/97.0/releasenotes/
PR: 261642
-rw-r--r-- | Mk/bsd.gecko.mk | 3 | ||||
-rw-r--r-- | www/firefox/Makefile | 4 | ||||
-rw-r--r-- | www/firefox/distinfo | 6 | ||||
-rw-r--r-- | www/firefox/files/patch-bug1640982 | 2 | ||||
-rw-r--r-- | www/firefox/files/patch-bug1664115 | 4 | ||||
-rw-r--r-- | www/firefox/files/patch-bug1749604 | 249 | ||||
-rw-r--r-- | www/firefox/files/patch-bug847568 | 14 | ||||
-rw-r--r-- | www/firefox/files/patch-libwebrtc-generate | 192 | ||||
-rw-r--r-- | www/firefox/files/patch-libwebrtc-generated | 19756 | ||||
-rw-r--r-- | www/firefox/files/patch-media_libcubeb_src_cubeb__oss.c | 385 | ||||
-rw-r--r-- | www/firefox/files/patch-webrtc | 253107 |
11 files changed, 20249 insertions, 253473 deletions
diff --git a/Mk/bsd.gecko.mk b/Mk/bsd.gecko.mk index 0613d70a0272..380c1df518e1 100644 --- a/Mk/bsd.gecko.mk +++ b/Mk/bsd.gecko.mk @@ -167,6 +167,9 @@ pixman_MOZ_OPTIONS= --enable-system-pixman png_LIB_DEPENDS= libpng.so:graphics/png png_MOZ_OPTIONS= --with-system-png=${LOCALBASE} +.if ${MOZILLA_VER:R:R} >= 97 +png_MOZ_OPTIONS= --with-system-png +.endif sqlite_LIB_DEPENDS= libsqlite3.so:databases/sqlite3 sqlite_MOZ_OPTIONS= --enable-system-sqlite diff --git a/www/firefox/Makefile b/www/firefox/Makefile index 7b574b3473d5..6cef007bc48e 100644 --- a/www/firefox/Makefile +++ b/www/firefox/Makefile @@ -1,7 +1,7 @@ # Created by: Alan Eldridge <alane@FreeBSD.org> PORTNAME= firefox -DISTVERSION= 96.0.3 +DISTVERSION= 97.0 PORTEPOCH= 2 CATEGORIES= www MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ @@ -12,7 +12,7 @@ MAINTAINER= gecko@FreeBSD.org COMMENT= Web browser based on the browser portion of Mozilla BUILD_DEPENDS= nspr>=4.32:devel/nspr \ - nss>=3.73:security/nss \ + nss>=3.74:security/nss \ icu>=70.1:devel/icu \ libevent>=2.1.8:devel/libevent \ harfbuzz>=2.9.1:print/harfbuzz \ diff --git a/www/firefox/distinfo b/www/firefox/distinfo index 862c1dda9361..5f757d0d0e7f 100644 --- a/www/firefox/distinfo +++ b/www/firefox/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1643336011 -SHA256 (firefox-96.0.3.source.tar.xz) = 1a741d6fcf20e6833a90169f41d29141ea4610f58b848e06091a683af6304dea -SIZE (firefox-96.0.3.source.tar.xz) = 406721708 +TIMESTAMP = 1643713139 +SHA256 (firefox-97.0.source.tar.xz) = 7a98c83d552ffde2b858fa288778c6d44d0077c3a9488293280184ee856420ee +SIZE (firefox-97.0.source.tar.xz) = 487369236 diff --git a/www/firefox/files/patch-bug1640982 b/www/firefox/files/patch-bug1640982 index 15789b617616..5ad0fbad6c72 100644 --- a/www/firefox/files/patch-bug1640982 +++ b/www/firefox/files/patch-bug1640982 @@ -2,8 +2,6 @@ Unbreak build with Rust 1.45.0 error: options `-C embed-bitcode=no` and `-C lto` are incompatible ---- config/makefiles/rust.mk.orig 2020-05-12 09:36:22 UTC - diff --git config/makefiles/rust.mk config/makefiles/rust.mk index 75570d3..94ec33f 100644 --- config/makefiles/rust.mk diff --git a/www/firefox/files/patch-bug1664115 b/www/firefox/files/patch-bug1664115 index 8a6e82d59b1f..86898c765f08 100644 --- a/www/firefox/files/patch-bug1664115 +++ b/www/firefox/files/patch-bug1664115 @@ -10,10 +10,10 @@ created by libcubeb. #include "Tracing.h" #include "webaudio/blink/DenormalDisabler.h" -#include "AudioThreadRegistry.h" + #include "mozilla/StaticPrefs_media.h" // Use abort() instead of exception in SoundTouch. - #define ST_NO_EXCEPTION_HANDLING 1 -@@ -140,9 +139,7 @@ +@@ -141,9 +140,7 @@ AudioStream::AudioStream(DataSource& aSource) mTimeStretcher(nullptr), mState(INITIALIZED), mDataSource(aSource), diff --git a/www/firefox/files/patch-bug1749604 b/www/firefox/files/patch-bug1749604 new file mode 100644 index 000000000000..a0195b8d00c9 --- /dev/null +++ b/www/firefox/files/patch-bug1749604 @@ -0,0 +1,249 @@ +https://bugzilla.mozilla.org/show_bug.cgi?id=1749604 +https://hg.mozilla.org/mozilla-central/rev/f6031b5927f5 +https://hg.mozilla.org/mozilla-central/rev/c7440a6eb545 +https://github.com/mozilla/gecko-dev/commit/e6f459cd77e3 +(Avoid ~13 GB clone of moz-libwebrtc for libwebrtc regen) +(To be dropped for 98) + +Updated README.md to reflect simplified setup for generation. +Updated generate-gn-build-files.sh: + - remove dependencies on MOZ_LIBWEBRTC environment variable + - add checking for GN environment variable +--- + +diff --git a/dom/media/webrtc/third_party_build/gn-configs/README.md b/dom/media/webrtc/third_party_build/gn-configs/README.md +index bc54ba183d016..09dea1ae87833 100644 +--- dom/media/webrtc/third_party_build/gn-configs/README.md ++++ dom/media/webrtc/third_party_build/gn-configs/README.md +@@ -1,9 +1,10 @@ + # Generate new gn json files and moz.build files for building libwebrtc in our tree + +-1. If generating on macOS for Apple Silicon (cross-compiling), make sure to have at least +-[Xcode 12.2](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip). ++1. If generating on macOS for Apple Silicon (cross-compiling), make sure to have ++ at least [Xcode 12.2](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip). + +- In addition the aarch64 Rust target will need to be installed via: `rustup target add aarch64-apple-darwin` ++ The aarch64 Rust target will need to be installed via: ++ `rustup target add aarch64-apple-darwin` + + 2. If generating on Windows 10, Visual Studio 2019 is required. Please follow + the install instructions from [here](https://firefox-source-docs.mozilla.org/setup/windows_build.html) +@@ -14,86 +15,85 @@ + - MSVC v142 - VS2019 C++ ARM64 build tools + + "Debugging Tools for Windows" is also required. +- - Under `Settings -> Apps` search for "Windows Software Development Kit" with the version +- number 10.0.19041.685. ++ - Under `Settings -> Apps` search for "Windows Software Development Kit" with ++ the version number 10.0.19041.685. + - select Modify (and allow the installer to modify) + - select Change and then click Next + - select "Debugging Tools for Windows" and then click Change. + +- And the aarch64 Rust target will need to be installed via: `rustup target add aarch64-pc-windows-msvc` ++ The aarch64 Rust target will need to be installed via: ++ `rustup target add aarch64-pc-windows-msvc` + +-3. See information in `third_party/libwebrtc/README.mozilla` for the proper revision of libwebrtc ++3. See information in `third_party/libwebrtc/README.mozilla` for the proper ++ revision of libwebrtc + + libwebrtc updated from commit https://github.com/mozilla/libwebrtc/archive/149d693483e9055f574d9d65b01fe75a186b654b.tar.gz on 2020-11-30T15:48:48.472088. + third_party updated from commit https://chromium.googlesource.com/chromium/src/third_party/+archive/5dc5a4a45df9592baa8e8c5f896006d9193d8e45.tar.gz on 2020-11-30T17:00:15.612630. + +- In our current case, the revision is `149d693483e9055f574d9d65b01fe75a186b654b` which +- corresponds to: ++ In our current case, the revision is `149d693483e9055f574d9d65b01fe75a186b654b` ++ which corresponds to: + + mozilla-modifications-rel86 + +-4. Clone Mozilla's version of libwebrtc from [libwebrtc](https://github.com/mozilla/libwebrtc) ++ This commit was made on `Thu Nov 19 14:14:00 2020`. + +- git clone https://github.com/mozilla/libwebrtc moz-libwebrtc +- export MOZ_LIBWEBRTC=`pwd`/moz-libwebrtc +- (cd moz-libwebrtc ; git checkout mozilla-modifications-rel86) ++4. Download a version of the `gn` executable that corresponds to ++ `Thu Nov 19 14:14:00 2020`. In our case, that is version `1889 (8fe02009)`. ++ ++ - [Win](https://chrome-infra-packages.appspot.com/p/gn/gn/windows-amd64/+/e_UmTHedzuu4zJ2gdpW8jrFFNnzIhThljx3jn3RMlVsC) ++ - [Linux](https://chrome-infra-packages.appspot.com/p/gn/gn/linux-amd64/+/bvBFKgehaepiKy_YhFnbiOpF38CK26N2OyE1R1jXof0C) ++ - [macOS](https://chrome-infra-packages.appspot.com/p/gn/gn/mac-amd64/+/nXvMRpyJhLhisAcnRmU5s9UZqovzMAhKAvWjax-swioC) + +- Note that branch was made on `Thu Nov 19 14:14:00 2020` ++ Find the downloaded `.zip` file, unzip and export the location of the ++ executable: + +-5. Clone `depot_tools` from [depot_tools](https://chromium.googlesource.com/chromium/tools/depot_tools.git) ++ unzip gn-mac-amd64.zip && export GN=`pwd`/gn ++ unzip gn-windows-amd64.zip && export GN=`pwd`/gn.exe ++ unzip gn-linux-amd64.zip && export GN=`pwd`/gn + +- git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git +- export DEPOT_TOOLS=`pwd`/depot_tools ++ On platforms that don't have pre-built `gn` executables, `ninja` and `gn` can ++ be easily built: + +- If generating files on Windows, the following steps must be completed +- from a traditional Windows Cmd prompt (cmd.exe) launched from the start +- menu or search bar. This allows `gclient` to properly bootstrap the +- required python setup. ++ git clone https://github.com/ninja-build/ninja.git ++ git clone https://gn.googlesource.com/gn ++ (cd gn && git checkout 8fe02009) ++ (cd ninja && ./configure.py --bootstrap) ++ (export NINJA=`pwd`/ninja/ninja ; cd gn && python build/gen.py && $NINJA -C out) ++ export GN=`pwd`/gn/out/gn + +- cd {depot_tools directory} +- set PATH=%CD%;%PATH% +- set DEPOT_TOOLS_WIN_TOOLCHAIN=0 +- set vs2019_install="c:\Program Files (x86)\Microsoft Visual Studio\2019\Community" +- gclient +- exit ++ On OpenBSD, a slightly newer version of `gn` is needed in order to build: + +- Now, we need to checkout a revision of `depot_tools` that corresponds to the date of +- our libwebrtc branch. The closest `depot_tools` commit to `Thu Nov 19 14:14:00 2020` is +- `e7d1862b155ac3ccbef72c4d70629b5c88ffcb32`. There is additional information on how to +- more automatically determine this [here](https://chromium.googlesource.com/chromium/src/+/master/docs/building_old_revisions.md). ++ (cd gn && git checkout 31f2bba8) + +- (cd depot_tools ; git checkout e7d1862b155ac3ccbef72c4d70629b5c88ffcb32 ) ++5. Clone `depot_tools` from [depot_tools](https://chromium.googlesource.com/chromium/tools/depot_tools.git) + +-6. It is necessary to let `depot_tools` pull information into the `libwebrtc` tree as well. This can take a while. ++ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ++ export DEPOT_TOOLS=`pwd`/depot_tools + +- (cd moz-libwebrtc ; \ +- export PATH=$DEPOT_TOOLS:$PATH ; \ +- export DEPOT_TOOLS_UPDATE=0 ; \ +- export DEPOT_TOOLS_WIN_TOOLCHAIN=0 ; \ +- gclient config https://github.com/mozilla/libwebrtc && \ +- gclient sync -D --force --reset --with_branch_heads \ +- ) +- +- Note that if one uses `gclient` sync with a different output directory `$MOZ_LIBWEBRTC_GIT` +- must be set to the original clone directory, and `$MOZ_LIBWEBRTC` needs to be set to the +- directory created by `gclient sync`. ++ Now, we need to checkout a revision of `depot_tools` that corresponds to the ++ date of our libwebrtc branch. The closest `depot_tools` commit to ++ `Thu Nov 19 14:14:00 2020` is `e7d1862b155ac3ccbef72c4d70629b5c88ffcb32`. ++ There is additional information on how to more automatically determine this ++ [here](https://chromium.googlesource.com/chromium/src/+/master/docs/building_old_revisions.md). ++ ++ (cd depot_tools ; git checkout e7d1862b155ac3ccbef72c4d70629b5c88ffcb32 ) + +-7. Now it is time to generate the build files. The script should be run from the top +-directory of our firefox tree. ++6. It is time to generate the build files. The script should be run from the ++ top directory of our firefox tree. + +- ./dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh ++ bash ./dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh + +- Debugging the generate script itself may prove useful, and one can do this by setting the DEBUG_GEN environment +- variable to a non-empty value. This will print everything that the script executes. ++ Debugging the generate script itself may prove useful, and one can do this by ++ setting the DEBUG_GEN environment variable to a non-empty value. This will ++ print everything that the script executes. + +-8. Checkin all the generated/modified files and try your build! ++7. Checkin all the generated/modified files and try your build! + + # Adding new configurations to the build + +-- Each new platform/architecture will require 2 new mozconfig files, +- one for the debug build and one for the non-debug build. The +- filenames follow the same pattern as the generated json files, +- `a-b-c-d.mozconfig` where: ++- Each new platform/architecture will require 2 new mozconfig files, one for the ++ debug build and one for the non-debug build. The filenames follow the same ++ pattern as the generated json files, `a-b-c-d.mozconfig` where: + - a = generating cpu (example: x64) + - b = debug (True / False) + - c = target cpu (example: x64 / arm64) +@@ -103,9 +103,9 @@ directory of our firefox tree. + - The new configs must be added to the appropriate platform section in + `generate-gn-build-files.sh`. + +-**Note:** when adding new mozconfig files, especially for linux/android +-configs, it is important to include the `ac_add_options +---enable-bootstrap`. This ensures switching archtectures for +-"cross-compiled" generation works properly. For example, when generating +-`x86` or `arm64` linux json files, it would be necessary to install additional +-libraries in order for the configure step to complete. ++**Note:** when adding new mozconfig files, especially for linux/android configs, ++it is important to include the `ac_add_options --enable-bootstrap`. This ++ensures switching archtectures for "cross-compiled" generation works properly. ++For example, when generating `x86` or `arm64` linux json files, it would be ++necessary to install additional libraries in order for the configure step to ++complete. +diff --git a/dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh b/dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh +index 4452b0ce76aeb..8d1acbf783514 100755 +--- dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh ++++ dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh +@@ -8,33 +8,15 @@ if [ ! "x$DEBUG_GEN" = "x" ]; then + set -x + fi + +-if [ "x$MOZ_LIBWEBRTC" = "x" ]; then +- echo "MOZ_LIBWEBRTC is not defined, see README.md" ++if [ "x$GN" = "x" ]; then ++ echo "GN is not defined, see README.md" + exit + fi + +-if [ -d $MOZ_LIBWEBRTC ]; then +- echo "MOZ_LIBWEBRTC is $MOZ_LIBWEBRTC" ++if [ -f $GN ]; then ++ echo "GN is $GN" + else +- echo "Path $MOZ_LIBWEBRTC is not found, see README.md" +- exit +-fi +- +-# git clone and gclient checkout may be in different places +-if [ "x$MOZ_LIBWEBRTC_GIT" = "x" ]; then +- MOZ_LIBWEBRTC_GIT=$MOZ_LIBWEBRTC +-fi +- +-if [ ! -d $MOZ_LIBWEBRTC_GIT/.git ]; then +- echo "No .git directory is found in the libwebrtc checkout, see README.md" +- exit +-fi +- +-if [ ! -d $MOZ_LIBWEBRTC/src/buildtools ]; then +- echo "Path $MOZ_LIBWEBRTC/src/buildtools is not found, see README.md" +- echo "Please run the following commands from inside $MOZ_LIBWEBRTC:" +- echo "\tgclient config https://github.com/mozilla/libwebrtc" +- echo "\tgclient sync -D --force --reset --with_branch_heads # this make take a while" ++ echo "Path $GN is not found, see README.md" + exit + fi + +@@ -115,21 +97,6 @@ fi + export PATH=$DEPOT_TOOLS:$PATH + export DEPOT_TOOLS_UPDATE=0 + +-# Symlink in the buildtools and .git directories from our copy of libwebrtc. +-if [ -L ./third_party/libwebrtc/buildtools ]; then +- rm ./third_party/libwebrtc/buildtools +-elif [ -d ./third_party/libwebrtc/buildtools ]; then +- rm -rf ./third_party/libwebrtc/buildtools +-fi +-ln -s $MOZ_LIBWEBRTC/src/buildtools ./third_party/libwebrtc/ +- +-if [ -L ./third_party/libwebrtc/.git ]; then +- rm ./third_party/libwebrtc/.git +-elif [ -d ./third_party/libwebrtc/.git ]; then +- rm -rf ./third_party/libwebrtc/.git +-fi +-ln -s $MOZ_LIBWEBRTC_GIT/.git ./third_party/libwebrtc/ +- + CONFIG_DIR=dom/media/webrtc/third_party_build/gn-configs + echo "CONFIG_DIR is $CONFIG_DIR" + diff --git a/www/firefox/files/patch-bug847568 b/www/firefox/files/patch-bug847568 index c91cc9be17a9..3161dbb88d08 100644 --- a/www/firefox/files/patch-bug847568 +++ b/www/firefox/files/patch-bug847568 @@ -28,9 +28,9 @@ diff --git dom/base/moz.build dom/base/moz.build index d390adf..4508f19 100644 --- dom/base/moz.build +++ dom/base/moz.build -@@ -567,6 +567,9 @@ FINAL_LIBRARY = "xul" - if CONFIG["MOZ_X11"]: - CXXFLAGS += CONFIG["TK_CFLAGS"] +@@ -576,6 +576,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"] @@ -215,9 +215,9 @@ diff --git old-configure.in old-configure.in index d147957..d332b34 100644 --- old-configure.in +++ old-configure.in -@@ -2217,6 +2217,27 @@ dnl ======================================================== - - AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR) +@@ -1335,6 +1335,27 @@ fi + AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID) + AC_SUBST(MOZ_MACBUNDLE_ID) +dnl ======================================================== +dnl Check for graphite2 @@ -241,7 +241,7 @@ index d147957..d332b34 100644 +fi + dnl ======================================================== - dnl Check for pixman and cairo + dnl = Child Process Name for IPC dnl ======================================================== diff --git toolkit/library/moz.build toolkit/library/moz.build index 2c3f869..e8a9d23 100644 diff --git a/www/firefox/files/patch-libwebrtc-generate b/www/firefox/files/patch-libwebrtc-generate new file mode 100644 index 000000000000..fc8cd43d4686 --- /dev/null +++ b/www/firefox/files/patch-libwebrtc-generate @@ -0,0 +1,192 @@ +# Below are the changes needed for generate-gn-build-files.sh +# except for depot_tools +# https://bugzilla.mozilla.org/show_bug.cgi?id=1654448 + +diff --git dom/media/webrtc/third_party_build/gn-configs/arm64_False_arm64_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/arm64_False_arm64_freebsd.mozconfig +new file mode 100644 +index 0000000000..7c76576969 +--- /dev/null ++++ dom/media/webrtc/third_party_build/gn-configs/arm64_False_arm64_freebsd.mozconfig +@@ -0,0 +1,12 @@ ++export M4=/usr/local/bin/gm4 ++export CC=/usr/local/bin/clang13 ++export CXX=/usr/local/bin/clang++13 ++export CPP=/usr/local/bin/clang-cpp13 ++ac_add_options --prefix="/usr/local" ++ac_add_options --with-libclang-path="/usr/local/llvm13/lib" ++ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" ++ ++ac_add_options --target=aarch64 ++ac_add_options --enable-bootstrap ++ ++mk_add_options MOZ_OBJDIR=obj-arm64_False_arm64_freebsd +diff --git dom/media/webrtc/third_party_build/gn-configs/arm64_True_arm64_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/arm64_True_arm64_freebsd.mozconfig +new file mode 100644 +index 0000000000..d056686355 +--- /dev/null ++++ dom/media/webrtc/third_party_build/gn-configs/arm64_True_arm64_freebsd.mozconfig +@@ -0,0 +1,13 @@ ++export M4=/usr/local/bin/gm4 ++export CC=/usr/local/bin/clang13 ++export CXX=/usr/local/bin/clang++13 ++export CPP=/usr/local/bin/clang-cpp13 ++ac_add_options --prefix="/usr/local" ++ac_add_options --with-libclang-path="/usr/local/llvm13/lib" ++ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" ++ ++ac_add_options --target=aarch64 ++ac_add_options --enable-debug ++ac_add_options --enable-bootstrap ++ ++mk_add_options MOZ_OBJDIR=obj-arm64_True_arm64_freebsd +diff --git dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh +index 4452b0ce76..34a8ddf28e 100755 +--- dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh ++++ dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh +@@ -57,17 +57,6 @@ set -eEuo pipefail + + SYS_NAME=`uname` + +-# Check for modified files and abort if present. +-MODIFIED_FILES=`hg status --modified --added --exclude "**/moz.build" --exclude "dom/media/webrtc/third_party_build/**.json"` +-if [ "x$MODIFIED_FILES" = "x" ]; then +- # Completely clean the mercurial checkout before proceeding +- hg update -C -r . +- hg purge +-else +- echo "There are modified files in the checkout. Cowardly aborting!" +- echo "$MODIFIED_FILES" +- exit 1 +-fi + + IS_WIN=0 + IS_DARWIN=0 +@@ -94,6 +83,10 @@ elif [ "x$SYS_NAME" = "xMINGW32_NT-6.2" ]; then + IS_WIN=1 + elif [ "x$SYS_NAME" = "xOpenBSD" ]; then + CONFIGS="x64_False_x64_openbsd x64_True_x64_openbsd" ++elif [ "x$SYS_NAME" = "xFreeBSD" ]; then ++ CONFIGS="x64_False_x64_freebsd x64_True_x64_freebsd" ++ CONFIGS="$CONFIGS x64_False_x86_freebsd x64_True_x86_freebsd" ++ #CONFIGS="arm64_False_arm64_freebsd arm64_True_arm64_freebsd" + else + # Ensure rust has the correct targets for building x86 and arm64. These + # operations succeed quickly if previously completed. +diff --git dom/media/webrtc/third_party_build/gn-configs/x64_False_x64_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/x64_False_x64_freebsd.mozconfig +new file mode 100644 +index 0000000000..37319939ba +--- /dev/null ++++ dom/media/webrtc/third_party_build/gn-configs/x64_False_x64_freebsd.mozconfig +@@ -0,0 +1,11 @@ ++export M4=/usr/local/bin/gm4 ++export CC=/usr/local/bin/clang13 ++export CXX=/usr/local/bin/clang++13 ++export CPP=/usr/local/bin/clang-cpp13 ++ac_add_options --prefix="/usr/local" ++ac_add_options --with-libclang-path="/usr/local/llvm13/lib" ++ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" ++ ++ac_add_options --enable-bootstrap ++ ++mk_add_options MOZ_OBJDIR=obj-x64_False_x64_freebsd +diff --git dom/media/webrtc/third_party_build/gn-configs/x64_False_x86_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/x64_False_x86_freebsd.mozconfig +new file mode 100644 +index 0000000000..4bcac5d797 +--- /dev/null ++++ dom/media/webrtc/third_party_build/gn-configs/x64_False_x86_freebsd.mozconfig +@@ -0,0 +1,12 @@ ++export M4=/usr/local/bin/gm4 ++export CC=/usr/local/bin/clang13 ++export CXX=/usr/local/bin/clang++13 ++export CPP=/usr/local/bin/clang-cpp13 ++ac_add_options --prefix="/usr/local" ++ac_add_options --with-libclang-path="/usr/local/llvm13/lib" ++ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" ++ ++ac_add_options --target=i686 ++ac_add_options --enable-bootstrap ++ ++mk_add_options MOZ_OBJDIR=obj-x64_False_x86_freebsd +diff --git dom/media/webrtc/third_party_build/gn-configs/x64_True_x64_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/x64_True_x64_freebsd.mozconfig +new file mode 100644 +index 0000000000..7c5ae25d67 +--- /dev/null ++++ dom/media/webrtc/third_party_build/gn-configs/x64_True_x64_freebsd.mozconfig +@@ -0,0 +1,12 @@ ++export M4=/usr/local/bin/gm4 ++export CC=/usr/local/bin/clang13 ++export CXX=/usr/local/bin/clang++13 ++export CPP=/usr/local/bin/clang-cpp13 ++ac_add_options --prefix="/usr/local" ++ac_add_options --with-libclang-path="/usr/local/llvm13/lib" ++ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" ++ ++ac_add_options --enable-debug ++ac_add_options --enable-bootstrap ++ ++mk_add_options MOZ_OBJDIR=obj-x64_True_x64_freebsd +diff --git dom/media/webrtc/third_party_build/gn-configs/x64_True_x86_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/x64_True_x86_freebsd.mozconfig +new file mode 100644 +index 0000000000..ee95c64a23 +--- /dev/null ++++ dom/media/webrtc/third_party_build/gn-configs/x64_True_x86_freebsd.mozconfig +@@ -0,0 +1,13 @@ ++export M4=/usr/local/bin/gm4 ++export CC=/usr/local/bin/clang13 ++export CXX=/usr/local/bin/clang++13 ++export CPP=/usr/local/bin/clang-cpp13 ++ac_add_options --prefix="/usr/local" ++ac_add_options --with-libclang-path="/usr/local/llvm13/lib" ++ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" ++ ++ac_add_options --target=i686 ++ac_add_options --enable-debug ++ac_add_options --enable-bootstrap ++ ++mk_add_options MOZ_OBJDIR=obj-x64_True_x86_freebsd +diff --git third_party/libwebrtc/build/config/BUILDCONFIG.gn third_party/libwebrtc/build/config/BUILDCONFIG.gn +index fe6f5b7d2a..1092f99c65 100644 +--- third_party/libwebrtc/build/config/BUILDCONFIG.gn ++++ third_party/libwebrtc/build/config/BUILDCONFIG.gn +@@ -131,10 +131,12 @@ declare_args() { + is_official_build = false + + # Whether we're a traditional desktop unix. +- is_desktop_linux = current_os == "linux" || current_os == "openbsd" ++ is_desktop_linux = current_os == "linux" || current_os == "openbsd" || ++ current_os == "freebsd" + + # Set to true when compiling with the Clang compiler. + is_clang = current_os != "linux" || current_os == "openbsd" || ++ current_os == "freebsd" || + (current_cpu != "s390x" && current_cpu != "s390" && + current_cpu != "ppc64" && current_cpu != "ppc" && + current_cpu != "mips" && current_cpu != "mips64") +@@ -186,7 +188,7 @@ if (host_toolchain == "") { + # TODO(dpranke): Add some sort of assert here that verifies that + # no toolchain omitted host_toolchain from its toolchain_args(). + +- if (host_os == "linux" || host_os == "openbsd") { ++ if (host_os == "linux" || host_os == "openbsd" || host_os == "freebsd" ) { + if (target_os != "linux") { + host_toolchain = "//build/toolchain/linux:clang_$host_cpu" + } else if (is_clang) { +@@ -224,7 +226,8 @@ if (target_os == "android") { + assert(host_os == "linux" || host_os == "mac", + "Android builds are only supported on Linux and Mac hosts.") + _default_toolchain = "//build/toolchain/android:android_clang_$target_cpu" +-} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd") { ++} else if (target_os == "chromeos" || target_os == "linux" || ++ target_os == "openbsd" || target_os == "freebsd") { + # See comments in build/toolchain/cros/BUILD.gn about board compiles. + if (is_clang) { + _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" +@@ -289,7 +292,7 @@ is_chromeos = current_os == "chromeos" + is_fuchsia = current_os == "fuchsia" + is_ios = current_os == "ios" + is_linux = current_os == "chromeos" || current_os == "linux" +-is_bsd = current_os == "openbsd" ++is_bsd = current_os == "openbsd" || current_os == "freebsd" + is_mac = current_os == "mac" + is_nacl = current_os == "nacl" + is_win = current_os == "win" || current_os == "winuwp" diff --git a/www/firefox/files/patch-libwebrtc-generated b/www/firefox/files/patch-libwebrtc-generated new file mode 100644 index 000000000000..b51a927bddb0 --- /dev/null +++ b/www/firefox/files/patch-libwebrtc-generated @@ -0,0 +1,19756 @@ +diff --git third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build +index 3dffbc4abb..aac5d092ef 100644 +--- third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build ++++ third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/array_view_gn/moz.build third_party/libwebrtc/api/array_view_gn/moz.build +index aca9f59966..1ea31b6a5e 100644 +--- third_party/libwebrtc/api/array_view_gn/moz.build ++++ third_party/libwebrtc/api/array_view_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/audio/aec3_config_gn/moz.build third_party/libwebrtc/api/audio/aec3_config_gn/moz.build +index 861233bfeb..c2f87155bb 100644 +--- third_party/libwebrtc/api/audio/aec3_config_gn/moz.build ++++ third_party/libwebrtc/api/audio/aec3_config_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build +index 2421e514b6..6a6fc577a5 100644 +--- third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build ++++ third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build +index 48abf7cd40..26317d4cf5 100644 +--- third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build ++++ third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -192,6 +211,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio/audio_mixer_api_gn/moz.build third_party/libwebrtc/api/audio/audio_mixer_api_gn/moz.build +index 41222e1e06..5a75494c05 100644 +--- third_party/libwebrtc/api/audio/audio_mixer_api_gn/moz.build ++++ third_party/libwebrtc/api/audio/audio_mixer_api_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/audio/echo_control_gn/moz.build third_party/libwebrtc/api/audio/echo_control_gn/moz.build +index 132b296b25..df28661dfb 100644 +--- third_party/libwebrtc/api/audio/echo_control_gn/moz.build ++++ third_party/libwebrtc/api/audio/echo_control_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/audio_codecs/L16/audio_decoder_L16_gn/moz.build third_party/libwebrtc/api/audio_codecs/L16/audio_decoder_L16_gn/moz.build +index 8499f556e3..92d90abb2d 100644 +--- third_party/libwebrtc/api/audio_codecs/L16/audio_decoder_L16_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/L16/audio_decoder_L16_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/L16/audio_encoder_L16_gn/moz.build third_party/libwebrtc/api/audio_codecs/L16/audio_encoder_L16_gn/moz.build +index a5f3673082..58e96dbb98 100644 +--- third_party/libwebrtc/api/audio_codecs/L16/audio_encoder_L16_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/L16/audio_encoder_L16_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/audio_codecs_api_gn/moz.build third_party/libwebrtc/api/audio_codecs/audio_codecs_api_gn/moz.build +index f7bf17624e..1f8a4a7497 100644 +--- third_party/libwebrtc/api/audio_codecs/audio_codecs_api_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/audio_codecs_api_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -156,6 +167,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -172,6 +187,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -194,6 +213,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/builtin_audio_decoder_factory_gn/moz.build third_party/libwebrtc/api/audio_codecs/builtin_audio_decoder_factory_gn/moz.build +index b52257b6b6..402d787b35 100644 +--- third_party/libwebrtc/api/audio_codecs/builtin_audio_decoder_factory_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/builtin_audio_decoder_factory_gn/moz.build +@@ -71,6 +71,19 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["WEBRTC_USE_BUILTIN_ISAC_FIX"] = "0" ++ DEFINES["WEBRTC_USE_BUILTIN_ISAC_FLOAT"] = "1" ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -173,6 +186,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -189,6 +206,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -224,6 +245,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + DEFINES["WEBRTC_USE_BUILTIN_ISAC_FIX"] = "0" + DEFINES["WEBRTC_USE_BUILTIN_ISAC_FLOAT"] = "1" + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/builtin_audio_encoder_factory_gn/moz.build third_party/libwebrtc/api/audio_codecs/builtin_audio_encoder_factory_gn/moz.build +index d84e1656f6..afddfe8bac 100644 +--- third_party/libwebrtc/api/audio_codecs/builtin_audio_encoder_factory_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/builtin_audio_encoder_factory_gn/moz.build +@@ -71,6 +71,19 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["WEBRTC_USE_BUILTIN_ISAC_FIX"] = "0" ++ DEFINES["WEBRTC_USE_BUILTIN_ISAC_FLOAT"] = "1" ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -173,6 +186,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -189,6 +206,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -224,6 +245,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + DEFINES["WEBRTC_USE_BUILTIN_ISAC_FIX"] = "0" + DEFINES["WEBRTC_USE_BUILTIN_ISAC_FLOAT"] = "1" + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/g711/audio_decoder_g711_gn/moz.build third_party/libwebrtc/api/audio_codecs/g711/audio_decoder_g711_gn/moz.build +index e39db35128..ec6254de74 100644 +--- third_party/libwebrtc/api/audio_codecs/g711/audio_decoder_g711_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/g711/audio_decoder_g711_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/g711/audio_encoder_g711_gn/moz.build third_party/libwebrtc/api/audio_codecs/g711/audio_encoder_g711_gn/moz.build +index 6a431c8970..413d83e455 100644 +--- third_party/libwebrtc/api/audio_codecs/g711/audio_encoder_g711_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/g711/audio_encoder_g711_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/g722/audio_decoder_g722_gn/moz.build third_party/libwebrtc/api/audio_codecs/g722/audio_decoder_g722_gn/moz.build +index 57f9cbdb1a..f1b7612533 100644 +--- third_party/libwebrtc/api/audio_codecs/g722/audio_decoder_g722_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/g722/audio_decoder_g722_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/g722/audio_encoder_g722_config_gn/moz.build third_party/libwebrtc/api/audio_codecs/g722/audio_encoder_g722_config_gn/moz.build +index 6b2c8222cf..17d26b56bb 100644 +--- third_party/libwebrtc/api/audio_codecs/g722/audio_encoder_g722_config_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/g722/audio_encoder_g722_config_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/audio_codecs/g722/audio_encoder_g722_gn/moz.build third_party/libwebrtc/api/audio_codecs/g722/audio_encoder_g722_gn/moz.build +index bc3dac1e0e..e6d120ffff 100644 +--- third_party/libwebrtc/api/audio_codecs/g722/audio_encoder_g722_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/g722/audio_encoder_g722_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/ilbc/audio_decoder_ilbc_gn/moz.build third_party/libwebrtc/api/audio_codecs/ilbc/audio_decoder_ilbc_gn/moz.build +index ca0df168ef..db603b008d 100644 +--- third_party/libwebrtc/api/audio_codecs/ilbc/audio_decoder_ilbc_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/ilbc/audio_decoder_ilbc_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/ilbc/audio_encoder_ilbc_config_gn/moz.build third_party/libwebrtc/api/audio_codecs/ilbc/audio_encoder_ilbc_config_gn/moz.build +index 4b3a5922de..9410478923 100644 +--- third_party/libwebrtc/api/audio_codecs/ilbc/audio_encoder_ilbc_config_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/ilbc/audio_encoder_ilbc_config_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/audio_codecs/ilbc/audio_encoder_ilbc_gn/moz.build third_party/libwebrtc/api/audio_codecs/ilbc/audio_encoder_ilbc_gn/moz.build +index 0fd8a2cd93..3595936b6e 100644 +--- third_party/libwebrtc/api/audio_codecs/ilbc/audio_encoder_ilbc_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/ilbc/audio_encoder_ilbc_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn/moz.build third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn/moz.build +index ea25619a8f..a5418dc87c 100644 +--- third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -146,6 +157,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -162,6 +177,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -184,6 +203,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_gn/moz.build third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_gn/moz.build +index 63a9de405e..0e8086206d 100644 +--- third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_gn/moz.build +@@ -65,6 +65,19 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["WEBRTC_USE_BUILTIN_ISAC_FIX"] = "0" ++ DEFINES["WEBRTC_USE_BUILTIN_ISAC_FLOAT"] = "1" ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +176,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +196,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn/moz.build third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn/moz.build +index 80d57e950c..54f305e11b 100644 +--- third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -146,6 +157,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -162,6 +177,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -184,6 +203,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_gn/moz.build third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_gn/moz.build +index ad8509420e..185c938438 100644 +--- third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_gn/moz.build +@@ -65,6 +65,19 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["WEBRTC_USE_BUILTIN_ISAC_FIX"] = "0" ++ DEFINES["WEBRTC_USE_BUILTIN_ISAC_FLOAT"] = "1" ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +176,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +196,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_multiopus_gn/moz.build third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_multiopus_gn/moz.build +index 1aac13195a..a7d5573ec5 100644 +--- third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_multiopus_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_multiopus_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -192,6 +211,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_opus_config_gn/moz.build third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_opus_config_gn/moz.build +index 3c14d0afe9..e3e40b8b5b 100644 +--- third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_opus_config_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_opus_config_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_opus_gn/moz.build third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_opus_gn/moz.build +index 18314dfa72..c8c06081f4 100644 +--- third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_opus_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/opus/audio_decoder_opus_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_multiopus_gn/moz.build third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_multiopus_gn/moz.build +index 58f0062b01..7b9e11054b 100644 +--- third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_multiopus_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_multiopus_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -192,6 +211,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_opus_config_gn/moz.build third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_opus_config_gn/moz.build +index a8f5c61509..5d088626da 100644 +--- third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_opus_config_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_opus_config_gn/moz.build +@@ -72,6 +72,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -158,6 +169,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -174,6 +189,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -196,6 +215,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_opus_gn/moz.build third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_opus_gn/moz.build +index 2afcfb0571..e7d4692406 100644 +--- third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_opus_gn/moz.build ++++ third_party/libwebrtc/api/audio_codecs/opus/audio_encoder_opus_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/audio_options_api_gn/moz.build third_party/libwebrtc/api/audio_options_api_gn/moz.build +index a9ca2f37f6..10636508a1 100644 +--- third_party/libwebrtc/api/audio_options_api_gn/moz.build ++++ third_party/libwebrtc/api/audio_options_api_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/bitrate_allocation_gn/moz.build third_party/libwebrtc/api/bitrate_allocation_gn/moz.build +index 2cc056678b..d7121e8987 100644 +--- third_party/libwebrtc/api/bitrate_allocation_gn/moz.build ++++ third_party/libwebrtc/api/bitrate_allocation_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/call_api_gn/moz.build third_party/libwebrtc/api/call_api_gn/moz.build +index c6b01250ea..6fd6f7a615 100644 +--- third_party/libwebrtc/api/call_api_gn/moz.build ++++ third_party/libwebrtc/api/call_api_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/callfactory_api_gn/moz.build third_party/libwebrtc/api/callfactory_api_gn/moz.build +index bb55b07e9f..751c37e99d 100644 +--- third_party/libwebrtc/api/callfactory_api_gn/moz.build ++++ third_party/libwebrtc/api/callfactory_api_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/crypto/frame_decryptor_interface_gn/moz.build third_party/libwebrtc/api/crypto/frame_decryptor_interface_gn/moz.build +index fe4a347c04..b7e372112d 100644 +--- third_party/libwebrtc/api/crypto/frame_decryptor_interface_gn/moz.build ++++ third_party/libwebrtc/api/crypto/frame_decryptor_interface_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/crypto/frame_encryptor_interface_gn/moz.build third_party/libwebrtc/api/crypto/frame_encryptor_interface_gn/moz.build +index aaaaeac661..64ae65e0dc 100644 +--- third_party/libwebrtc/api/crypto/frame_encryptor_interface_gn/moz.build ++++ third_party/libwebrtc/api/crypto/frame_encryptor_interface_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/crypto/options_gn/moz.build third_party/libwebrtc/api/crypto/options_gn/moz.build +index 1849070995..f31d4e2240 100644 +--- third_party/libwebrtc/api/crypto/options_gn/moz.build ++++ third_party/libwebrtc/api/crypto/options_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/fec_controller_api_gn/moz.build third_party/libwebrtc/api/fec_controller_api_gn/moz.build +index 4b623b0034..d882c1ebe0 100644 +--- third_party/libwebrtc/api/fec_controller_api_gn/moz.build ++++ third_party/libwebrtc/api/fec_controller_api_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/frame_transformer_interface_gn/moz.build third_party/libwebrtc/api/frame_transformer_interface_gn/moz.build +index 39a5a04f5a..d202431e5a 100644 +--- third_party/libwebrtc/api/frame_transformer_interface_gn/moz.build ++++ third_party/libwebrtc/api/frame_transformer_interface_gn/moz.build +@@ -64,6 +64,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/function_view_gn/moz.build third_party/libwebrtc/api/function_view_gn/moz.build +index 67fc4e25a2..ff4bc2082b 100644 +--- third_party/libwebrtc/api/function_view_gn/moz.build ++++ third_party/libwebrtc/api/function_view_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/libjingle_logging_api_gn/moz.build third_party/libwebrtc/api/libjingle_logging_api_gn/moz.build +index e2eb369f3e..22954f6943 100644 +--- third_party/libwebrtc/api/libjingle_logging_api_gn/moz.build ++++ third_party/libwebrtc/api/libjingle_logging_api_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/media_stream_interface_gn/moz.build third_party/libwebrtc/api/media_stream_interface_gn/moz.build +index 90856a4e62..b709d70d24 100644 +--- third_party/libwebrtc/api/media_stream_interface_gn/moz.build ++++ third_party/libwebrtc/api/media_stream_interface_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/neteq/default_neteq_controller_factory_gn/moz.build third_party/libwebrtc/api/neteq/default_neteq_controller_factory_gn/moz.build +index 0b2386cefd..73d24403a1 100644 +--- third_party/libwebrtc/api/neteq/default_neteq_controller_factory_gn/moz.build ++++ third_party/libwebrtc/api/neteq/default_neteq_controller_factory_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/neteq/neteq_api_gn/moz.build third_party/libwebrtc/api/neteq/neteq_api_gn/moz.build +index b1fa978fd0..18e69e0265 100644 +--- third_party/libwebrtc/api/neteq/neteq_api_gn/moz.build ++++ third_party/libwebrtc/api/neteq/neteq_api_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/neteq/neteq_controller_api_gn/moz.build third_party/libwebrtc/api/neteq/neteq_controller_api_gn/moz.build +index a250cf1b72..1bcbb5ffa8 100644 +--- third_party/libwebrtc/api/neteq/neteq_controller_api_gn/moz.build ++++ third_party/libwebrtc/api/neteq/neteq_controller_api_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -152,6 +163,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -168,6 +183,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/neteq/tick_timer_gn/moz.build third_party/libwebrtc/api/neteq/tick_timer_gn/moz.build +index 179458a984..d77bb4cb7a 100644 +--- third_party/libwebrtc/api/neteq/tick_timer_gn/moz.build ++++ third_party/libwebrtc/api/neteq/tick_timer_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/network_state_predictor_api_gn/moz.build third_party/libwebrtc/api/network_state_predictor_api_gn/moz.build +index 1a5b0bf109..fa02a56f8e 100644 +--- third_party/libwebrtc/api/network_state_predictor_api_gn/moz.build ++++ third_party/libwebrtc/api/network_state_predictor_api_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/numerics/numerics_gn/moz.build third_party/libwebrtc/api/numerics/numerics_gn/moz.build +index fa11b290a9..6152ef8e59 100644 +--- third_party/libwebrtc/api/numerics/numerics_gn/moz.build ++++ third_party/libwebrtc/api/numerics/numerics_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/priority_gn/moz.build third_party/libwebrtc/api/priority_gn/moz.build +index dbe91f7048..ac0e0c377e 100644 +--- third_party/libwebrtc/api/priority_gn/moz.build ++++ third_party/libwebrtc/api/priority_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/refcountedbase_gn/moz.build third_party/libwebrtc/api/refcountedbase_gn/moz.build +index 1511ac2e44..2e08c63cda 100644 +--- third_party/libwebrtc/api/refcountedbase_gn/moz.build ++++ third_party/libwebrtc/api/refcountedbase_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/rtc_error_gn/moz.build third_party/libwebrtc/api/rtc_error_gn/moz.build +index 01b92cee7a..41bbb8718c 100644 +--- third_party/libwebrtc/api/rtc_error_gn/moz.build ++++ third_party/libwebrtc/api/rtc_error_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build +index 62dec010ac..db7abcf561 100644 +--- third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build ++++ third_party/libwebrtc/api/rtc_event_log/rtc_event_log_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -192,6 +211,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/rtp_headers_gn/moz.build third_party/libwebrtc/api/rtp_headers_gn/moz.build +index 2a67aeb66e..b65a55e453 100644 +--- third_party/libwebrtc/api/rtp_headers_gn/moz.build ++++ third_party/libwebrtc/api/rtp_headers_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/rtp_packet_info_gn/moz.build third_party/libwebrtc/api/rtp_packet_info_gn/moz.build +index 8918746b08..f75e6c9c00 100644 +--- third_party/libwebrtc/api/rtp_packet_info_gn/moz.build ++++ third_party/libwebrtc/api/rtp_packet_info_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/rtp_parameters_gn/moz.build third_party/libwebrtc/api/rtp_parameters_gn/moz.build +index 23d200f8b0..8c778c8cb2 100644 +--- third_party/libwebrtc/api/rtp_parameters_gn/moz.build ++++ third_party/libwebrtc/api/rtp_parameters_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -150,6 +161,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -166,6 +181,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -188,6 +207,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/rtp_transceiver_direction_gn/moz.build third_party/libwebrtc/api/rtp_transceiver_direction_gn/moz.build +index 6b31767ec8..49ce8708a6 100644 +--- third_party/libwebrtc/api/rtp_transceiver_direction_gn/moz.build ++++ third_party/libwebrtc/api/rtp_transceiver_direction_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/scoped_refptr_gn/moz.build third_party/libwebrtc/api/scoped_refptr_gn/moz.build +index 97b07c9010..0c9bc9ef6a 100644 +--- third_party/libwebrtc/api/scoped_refptr_gn/moz.build ++++ third_party/libwebrtc/api/scoped_refptr_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/simulated_network_api_gn/moz.build third_party/libwebrtc/api/simulated_network_api_gn/moz.build +index 17cbb28903..e75d9233e6 100644 +--- third_party/libwebrtc/api/simulated_network_api_gn/moz.build ++++ third_party/libwebrtc/api/simulated_network_api_gn/moz.build +@@ -64,6 +64,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/task_queue/task_queue_gn/moz.build third_party/libwebrtc/api/task_queue/task_queue_gn/moz.build +index 691d7edc2d..8614057ddc 100644 +--- third_party/libwebrtc/api/task_queue/task_queue_gn/moz.build ++++ third_party/libwebrtc/api/task_queue/task_queue_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/transport/bitrate_settings_gn/moz.build third_party/libwebrtc/api/transport/bitrate_settings_gn/moz.build +index 3513f9c224..9e1a49e8e4 100644 +--- third_party/libwebrtc/api/transport/bitrate_settings_gn/moz.build ++++ third_party/libwebrtc/api/transport/bitrate_settings_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/transport/field_trial_based_config_gn/moz.build third_party/libwebrtc/api/transport/field_trial_based_config_gn/moz.build +index 04aaa9aa2b..ed67e61812 100644 +--- third_party/libwebrtc/api/transport/field_trial_based_config_gn/moz.build ++++ third_party/libwebrtc/api/transport/field_trial_based_config_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/transport/goog_cc_gn/moz.build third_party/libwebrtc/api/transport/goog_cc_gn/moz.build +index 409c7dde4b..a05eff6f59 100644 +--- third_party/libwebrtc/api/transport/goog_cc_gn/moz.build ++++ third_party/libwebrtc/api/transport/goog_cc_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/transport/network_control_gn/moz.build third_party/libwebrtc/api/transport/network_control_gn/moz.build +index 09e38326bd..80fa181ab9 100644 +--- third_party/libwebrtc/api/transport/network_control_gn/moz.build ++++ third_party/libwebrtc/api/transport/network_control_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/transport/rtp/dependency_descriptor_gn/moz.build third_party/libwebrtc/api/transport/rtp/dependency_descriptor_gn/moz.build +index 735d60d2d2..e21c0aa575 100644 +--- third_party/libwebrtc/api/transport/rtp/dependency_descriptor_gn/moz.build ++++ third_party/libwebrtc/api/transport/rtp/dependency_descriptor_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/transport/rtp/rtp_source_gn/moz.build third_party/libwebrtc/api/transport/rtp/rtp_source_gn/moz.build +index efeffbc658..29eb538b64 100644 +--- third_party/libwebrtc/api/transport/rtp/rtp_source_gn/moz.build ++++ third_party/libwebrtc/api/transport/rtp/rtp_source_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/transport/webrtc_key_value_config_gn/moz.build third_party/libwebrtc/api/transport/webrtc_key_value_config_gn/moz.build +index f3132f72ab..2fb0df1299 100644 +--- third_party/libwebrtc/api/transport/webrtc_key_value_config_gn/moz.build ++++ third_party/libwebrtc/api/transport/webrtc_key_value_config_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/transport_api_gn/moz.build third_party/libwebrtc/api/transport_api_gn/moz.build +index 41b32d6762..59e6e8ce4a 100644 +--- third_party/libwebrtc/api/transport_api_gn/moz.build ++++ third_party/libwebrtc/api/transport_api_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/units/data_rate_gn/moz.build third_party/libwebrtc/api/units/data_rate_gn/moz.build +index 6708de4bb0..3b2fc8ba9c 100644 +--- third_party/libwebrtc/api/units/data_rate_gn/moz.build ++++ third_party/libwebrtc/api/units/data_rate_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/units/data_size_gn/moz.build third_party/libwebrtc/api/units/data_size_gn/moz.build +index 14b9742573..54ecb92e08 100644 +--- third_party/libwebrtc/api/units/data_size_gn/moz.build ++++ third_party/libwebrtc/api/units/data_size_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/units/frequency_gn/moz.build third_party/libwebrtc/api/units/frequency_gn/moz.build +index 79fcff48ef..6790d9ceaa 100644 +--- third_party/libwebrtc/api/units/frequency_gn/moz.build ++++ third_party/libwebrtc/api/units/frequency_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/units/time_delta_gn/moz.build third_party/libwebrtc/api/units/time_delta_gn/moz.build +index 9cd9ff24f3..c32d6624b5 100644 +--- third_party/libwebrtc/api/units/time_delta_gn/moz.build ++++ third_party/libwebrtc/api/units/time_delta_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/units/timestamp_gn/moz.build third_party/libwebrtc/api/units/timestamp_gn/moz.build +index 23aa0ba2c5..72d6220c6b 100644 +--- third_party/libwebrtc/api/units/timestamp_gn/moz.build ++++ third_party/libwebrtc/api/units/timestamp_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/builtin_video_bitrate_allocator_factory_gn/moz.build third_party/libwebrtc/api/video/builtin_video_bitrate_allocator_factory_gn/moz.build +index 0ecc793d69..ea20a3d5b5 100644 +--- third_party/libwebrtc/api/video/builtin_video_bitrate_allocator_factory_gn/moz.build ++++ third_party/libwebrtc/api/video/builtin_video_bitrate_allocator_factory_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/encoded_frame_gn/moz.build third_party/libwebrtc/api/video/encoded_frame_gn/moz.build +index 456c8a541d..3b556fdd3c 100644 +--- third_party/libwebrtc/api/video/encoded_frame_gn/moz.build ++++ third_party/libwebrtc/api/video/encoded_frame_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/encoded_image_gn/moz.build third_party/libwebrtc/api/video/encoded_image_gn/moz.build +index d109bfa1a0..225b559521 100644 +--- third_party/libwebrtc/api/video/encoded_image_gn/moz.build ++++ third_party/libwebrtc/api/video/encoded_image_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/recordable_encoded_frame_gn/moz.build third_party/libwebrtc/api/video/recordable_encoded_frame_gn/moz.build +index df2bcac4b7..ad955dc4a0 100644 +--- third_party/libwebrtc/api/video/recordable_encoded_frame_gn/moz.build ++++ third_party/libwebrtc/api/video/recordable_encoded_frame_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/video/video_adaptation_gn/moz.build third_party/libwebrtc/api/video/video_adaptation_gn/moz.build +index 539cc93e02..3f6fd22ca3 100644 +--- third_party/libwebrtc/api/video/video_adaptation_gn/moz.build ++++ third_party/libwebrtc/api/video/video_adaptation_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_bitrate_allocation_gn/moz.build third_party/libwebrtc/api/video/video_bitrate_allocation_gn/moz.build +index 427be85229..39df8789f7 100644 +--- third_party/libwebrtc/api/video/video_bitrate_allocation_gn/moz.build ++++ third_party/libwebrtc/api/video/video_bitrate_allocation_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_bitrate_allocator_factory_gn/moz.build third_party/libwebrtc/api/video/video_bitrate_allocator_factory_gn/moz.build +index 07db1b3b38..27fad85dc4 100644 +--- third_party/libwebrtc/api/video/video_bitrate_allocator_factory_gn/moz.build ++++ third_party/libwebrtc/api/video/video_bitrate_allocator_factory_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/video/video_bitrate_allocator_gn/moz.build third_party/libwebrtc/api/video/video_bitrate_allocator_gn/moz.build +index 8726c6c5a5..891f5b2ac1 100644 +--- third_party/libwebrtc/api/video/video_bitrate_allocator_gn/moz.build ++++ third_party/libwebrtc/api/video/video_bitrate_allocator_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_codec_constants_gn/moz.build third_party/libwebrtc/api/video/video_codec_constants_gn/moz.build +index 9f6daffa4a..39371a1714 100644 +--- third_party/libwebrtc/api/video/video_codec_constants_gn/moz.build ++++ third_party/libwebrtc/api/video/video_codec_constants_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/video/video_frame_gn/moz.build third_party/libwebrtc/api/video/video_frame_gn/moz.build +index cec245170a..646e570081 100644 +--- third_party/libwebrtc/api/video/video_frame_gn/moz.build ++++ third_party/libwebrtc/api/video/video_frame_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -155,6 +166,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -171,6 +186,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -193,6 +212,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_frame_i010_gn/moz.build third_party/libwebrtc/api/video/video_frame_i010_gn/moz.build +index fa9d71395c..927c06c940 100644 +--- third_party/libwebrtc/api/video/video_frame_i010_gn/moz.build ++++ third_party/libwebrtc/api/video/video_frame_i010_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_frame_i420_gn/moz.build third_party/libwebrtc/api/video/video_frame_i420_gn/moz.build +index 3d4c1bd899..2f0e6fdd07 100644 +--- third_party/libwebrtc/api/video/video_frame_i420_gn/moz.build ++++ third_party/libwebrtc/api/video/video_frame_i420_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_frame_metadata_gn/moz.build third_party/libwebrtc/api/video/video_frame_metadata_gn/moz.build +index c817dc4982..0283c8356c 100644 +--- third_party/libwebrtc/api/video/video_frame_metadata_gn/moz.build ++++ third_party/libwebrtc/api/video/video_frame_metadata_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_frame_nv12_gn/moz.build third_party/libwebrtc/api/video/video_frame_nv12_gn/moz.build +index 63ee6f9099..2c64a6dc79 100644 +--- third_party/libwebrtc/api/video/video_frame_nv12_gn/moz.build ++++ third_party/libwebrtc/api/video/video_frame_nv12_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_frame_type_gn/moz.build third_party/libwebrtc/api/video/video_frame_type_gn/moz.build +index 57cfaf7c23..07f1dd75ba 100644 +--- third_party/libwebrtc/api/video/video_frame_type_gn/moz.build ++++ third_party/libwebrtc/api/video/video_frame_type_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/video/video_rtp_headers_gn/moz.build third_party/libwebrtc/api/video/video_rtp_headers_gn/moz.build +index 54cdbd8c57..1ec0d71ab4 100644 +--- third_party/libwebrtc/api/video/video_rtp_headers_gn/moz.build ++++ third_party/libwebrtc/api/video/video_rtp_headers_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -156,6 +167,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -172,6 +187,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -194,6 +213,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_stream_encoder_create_gn/moz.build third_party/libwebrtc/api/video/video_stream_encoder_create_gn/moz.build +index 57a39cfe40..1d7a2ba9b8 100644 +--- third_party/libwebrtc/api/video/video_stream_encoder_create_gn/moz.build ++++ third_party/libwebrtc/api/video/video_stream_encoder_create_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video/video_stream_encoder_gn/moz.build third_party/libwebrtc/api/video/video_stream_encoder_gn/moz.build +index e5e9a7c055..057b4db9ea 100644 +--- third_party/libwebrtc/api/video/video_stream_encoder_gn/moz.build ++++ third_party/libwebrtc/api/video/video_stream_encoder_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/video_codecs/bitstream_parser_api_gn/moz.build third_party/libwebrtc/api/video_codecs/bitstream_parser_api_gn/moz.build +index 2666e25ab7..1514db3a49 100644 +--- third_party/libwebrtc/api/video_codecs/bitstream_parser_api_gn/moz.build ++++ third_party/libwebrtc/api/video_codecs/bitstream_parser_api_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/api/video_codecs/builtin_video_decoder_factory_gn/moz.build third_party/libwebrtc/api/video_codecs/builtin_video_decoder_factory_gn/moz.build +index 1d21c1fa81..8c122cbd13 100644 +--- third_party/libwebrtc/api/video_codecs/builtin_video_decoder_factory_gn/moz.build ++++ third_party/libwebrtc/api/video_codecs/builtin_video_decoder_factory_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video_codecs/builtin_video_encoder_factory_gn/moz.build third_party/libwebrtc/api/video_codecs/builtin_video_encoder_factory_gn/moz.build +index bd29841460..ea3e4aab9b 100644 +--- third_party/libwebrtc/api/video_codecs/builtin_video_encoder_factory_gn/moz.build ++++ third_party/libwebrtc/api/video_codecs/builtin_video_encoder_factory_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video_codecs/rtc_software_fallback_wrappers_gn/moz.build third_party/libwebrtc/api/video_codecs/rtc_software_fallback_wrappers_gn/moz.build +index 90afc61ce7..2dad21ab8e 100644 +--- third_party/libwebrtc/api/video_codecs/rtc_software_fallback_wrappers_gn/moz.build ++++ third_party/libwebrtc/api/video_codecs/rtc_software_fallback_wrappers_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video_codecs/video_codecs_api_gn/moz.build third_party/libwebrtc/api/video_codecs/video_codecs_api_gn/moz.build +index acf0202689..c80bfb5b66 100644 +--- third_party/libwebrtc/api/video_codecs/video_codecs_api_gn/moz.build ++++ third_party/libwebrtc/api/video_codecs/video_codecs_api_gn/moz.build +@@ -75,6 +75,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/api/video_codecs/vp8_temporal_layers_factory_gn/moz.build third_party/libwebrtc/api/video_codecs/vp8_temporal_layers_factory_gn/moz.build +index e0bcb09d59..4bf73c444c 100644 +--- third_party/libwebrtc/api/video_codecs/vp8_temporal_layers_factory_gn/moz.build ++++ third_party/libwebrtc/api/video_codecs/vp8_temporal_layers_factory_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/audio/audio_gn/moz.build third_party/libwebrtc/audio/audio_gn/moz.build +index 48c74e8063..78ccf8d0e2 100644 +--- third_party/libwebrtc/audio/audio_gn/moz.build ++++ third_party/libwebrtc/audio/audio_gn/moz.build +@@ -81,6 +81,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -175,6 +186,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -191,6 +206,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -213,6 +232,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/audio/utility/audio_frame_operations_gn/moz.build third_party/libwebrtc/audio/utility/audio_frame_operations_gn/moz.build +index f3708d6b8e..a7fa266d64 100644 +--- third_party/libwebrtc/audio/utility/audio_frame_operations_gn/moz.build ++++ third_party/libwebrtc/audio/utility/audio_frame_operations_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/adaptation/resource_adaptation_gn/moz.build third_party/libwebrtc/call/adaptation/resource_adaptation_gn/moz.build +index 0c08bff6a3..2a6e85ac47 100644 +--- third_party/libwebrtc/call/adaptation/resource_adaptation_gn/moz.build ++++ third_party/libwebrtc/call/adaptation/resource_adaptation_gn/moz.build +@@ -77,6 +77,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -171,6 +182,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -187,6 +202,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -209,6 +228,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/audio_sender_interface_gn/moz.build third_party/libwebrtc/call/audio_sender_interface_gn/moz.build +index a746c88078..cb4ace74be 100644 +--- third_party/libwebrtc/call/audio_sender_interface_gn/moz.build ++++ third_party/libwebrtc/call/audio_sender_interface_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/call/bitrate_allocator_gn/moz.build third_party/libwebrtc/call/bitrate_allocator_gn/moz.build +index 8d140ba125..5ee40a51d4 100644 +--- third_party/libwebrtc/call/bitrate_allocator_gn/moz.build ++++ third_party/libwebrtc/call/bitrate_allocator_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/bitrate_configurator_gn/moz.build third_party/libwebrtc/call/bitrate_configurator_gn/moz.build +index 2dba19a53a..290ee2e201 100644 +--- third_party/libwebrtc/call/bitrate_configurator_gn/moz.build ++++ third_party/libwebrtc/call/bitrate_configurator_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/call_gn/moz.build third_party/libwebrtc/call/call_gn/moz.build +index 8cb24f9748..7f3d3e0f33 100644 +--- third_party/libwebrtc/call/call_gn/moz.build ++++ third_party/libwebrtc/call/call_gn/moz.build +@@ -72,6 +72,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -166,6 +177,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -182,6 +197,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -204,6 +223,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/call_interfaces_gn/moz.build third_party/libwebrtc/call/call_interfaces_gn/moz.build +index 4f07c8b731..8ef60e959c 100644 +--- third_party/libwebrtc/call/call_interfaces_gn/moz.build ++++ third_party/libwebrtc/call/call_interfaces_gn/moz.build +@@ -73,6 +73,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -167,6 +178,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -183,6 +198,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -205,6 +224,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/fake_network_gn/moz.build third_party/libwebrtc/call/fake_network_gn/moz.build +index 54b8d2df6b..2d2ebb2e84 100644 +--- third_party/libwebrtc/call/fake_network_gn/moz.build ++++ third_party/libwebrtc/call/fake_network_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/rtp_interfaces_gn/moz.build third_party/libwebrtc/call/rtp_interfaces_gn/moz.build +index 040939df59..814d9c1d92 100644 +--- third_party/libwebrtc/call/rtp_interfaces_gn/moz.build ++++ third_party/libwebrtc/call/rtp_interfaces_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/rtp_receiver_gn/moz.build third_party/libwebrtc/call/rtp_receiver_gn/moz.build +index 5c1f19a9da..f31fa589f9 100644 +--- third_party/libwebrtc/call/rtp_receiver_gn/moz.build ++++ third_party/libwebrtc/call/rtp_receiver_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/rtp_sender_gn/moz.build third_party/libwebrtc/call/rtp_sender_gn/moz.build +index 1d14b03100..337dcfd1ce 100644 +--- third_party/libwebrtc/call/rtp_sender_gn/moz.build ++++ third_party/libwebrtc/call/rtp_sender_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/simulated_network_gn/moz.build third_party/libwebrtc/call/simulated_network_gn/moz.build +index 62ff82980c..6abb9718b7 100644 +--- third_party/libwebrtc/call/simulated_network_gn/moz.build ++++ third_party/libwebrtc/call/simulated_network_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/call/simulated_packet_receiver_gn/moz.build third_party/libwebrtc/call/simulated_packet_receiver_gn/moz.build +index e51a1dce73..0961e95dbb 100644 +--- third_party/libwebrtc/call/simulated_packet_receiver_gn/moz.build ++++ third_party/libwebrtc/call/simulated_packet_receiver_gn/moz.build +@@ -64,6 +64,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/call/video_stream_api_gn/moz.build third_party/libwebrtc/call/video_stream_api_gn/moz.build +index 926361a8fa..bf3117cf96 100644 +--- third_party/libwebrtc/call/video_stream_api_gn/moz.build ++++ third_party/libwebrtc/call/video_stream_api_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_audio/common_audio_avx2_gn/moz.build third_party/libwebrtc/common_audio/common_audio_avx2_gn/moz.build +index 386e90330f..e8a0c2625a 100644 +--- third_party/libwebrtc/common_audio/common_audio_avx2_gn/moz.build ++++ third_party/libwebrtc/common_audio/common_audio_avx2_gn/moz.build +@@ -73,6 +73,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -146,6 +157,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -162,6 +177,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -184,6 +203,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": + + CXXFLAGS += [ +diff --git third_party/libwebrtc/common_audio/common_audio_c_arm_asm_gn/moz.build third_party/libwebrtc/common_audio/common_audio_c_arm_asm_gn/moz.build +index 7adcbbf362..3beca43fd4 100644 +--- third_party/libwebrtc/common_audio/common_audio_c_arm_asm_gn/moz.build ++++ third_party/libwebrtc/common_audio/common_audio_c_arm_asm_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -142,6 +153,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -158,6 +173,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/common_audio/common_audio_c_gn/moz.build third_party/libwebrtc/common_audio/common_audio_c_gn/moz.build +index 8e471b3278..cf7c67d7f1 100644 +--- third_party/libwebrtc/common_audio/common_audio_c_gn/moz.build ++++ third_party/libwebrtc/common_audio/common_audio_c_gn/moz.build +@@ -110,6 +110,22 @@ if CONFIG["OS_TARGET"] == "Darwin": + "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c" + ] + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ ++ UNIFIED_SOURCES += [ ++ "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c", ++ "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c" ++ ] ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -218,6 +234,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -234,6 +254,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -275,6 +299,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_audio/common_audio_cc_gn/moz.build third_party/libwebrtc/common_audio/common_audio_cc_gn/moz.build +index 5475e35ad6..1aa0a02b27 100644 +--- third_party/libwebrtc/common_audio/common_audio_cc_gn/moz.build ++++ third_party/libwebrtc/common_audio/common_audio_cc_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_audio/common_audio_gn/moz.build third_party/libwebrtc/common_audio/common_audio_gn/moz.build +index e499c12bf0..6d5c275806 100644 +--- third_party/libwebrtc/common_audio/common_audio_gn/moz.build ++++ third_party/libwebrtc/common_audio/common_audio_gn/moz.build +@@ -80,6 +80,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -173,6 +184,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -189,6 +204,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -211,6 +230,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_audio/common_audio_neon_c_gn/moz.build third_party/libwebrtc/common_audio/common_audio_neon_c_gn/moz.build +index 36ffd6add1..a16a1a6b1b 100644 +--- third_party/libwebrtc/common_audio/common_audio_neon_c_gn/moz.build ++++ third_party/libwebrtc/common_audio/common_audio_neon_c_gn/moz.build +@@ -71,6 +71,18 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_ARCH_ARM64"] = True ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +@@ -150,6 +162,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -162,6 +178,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/common_audio/common_audio_neon_gn/moz.build third_party/libwebrtc/common_audio/common_audio_neon_gn/moz.build +index ba1537f7dd..c409afbddb 100644 +--- third_party/libwebrtc/common_audio/common_audio_neon_gn/moz.build ++++ third_party/libwebrtc/common_audio/common_audio_neon_gn/moz.build +@@ -70,6 +70,18 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_ARCH_ARM64"] = True ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +@@ -149,6 +161,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +177,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/common_audio/common_audio_sse2_gn/moz.build third_party/libwebrtc/common_audio/common_audio_sse2_gn/moz.build +index c516a1769e..a207526986 100644 +--- third_party/libwebrtc/common_audio/common_audio_sse2_gn/moz.build ++++ third_party/libwebrtc/common_audio/common_audio_sse2_gn/moz.build +@@ -72,6 +72,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -194,6 +213,19 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + "-msse2" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2", ++ "-msse2" ++ ] ++ ++if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": + + CXXFLAGS += [ +diff --git third_party/libwebrtc/common_audio/fir_filter_factory_gn/moz.build third_party/libwebrtc/common_audio/fir_filter_factory_gn/moz.build +index e93b927f63..c3847e1200 100644 +--- third_party/libwebrtc/common_audio/fir_filter_factory_gn/moz.build ++++ third_party/libwebrtc/common_audio/fir_filter_factory_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_audio/fir_filter_gn/moz.build third_party/libwebrtc/common_audio/fir_filter_gn/moz.build +index 1bb7ad1e4b..ea708477d7 100644 +--- third_party/libwebrtc/common_audio/fir_filter_gn/moz.build ++++ third_party/libwebrtc/common_audio/fir_filter_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/common_audio/sinc_resampler_gn/moz.build third_party/libwebrtc/common_audio/sinc_resampler_gn/moz.build +index e285755822..394b2e43a7 100644 +--- third_party/libwebrtc/common_audio/sinc_resampler_gn/moz.build ++++ third_party/libwebrtc/common_audio/sinc_resampler_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -152,6 +163,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -168,6 +183,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128_gn/moz.build third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128_gn/moz.build +index 49d8183bb8..de0e1795f9 100644 +--- third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128_gn/moz.build ++++ third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -182,6 +193,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -198,6 +213,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -241,6 +260,23 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Darwin": + "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2", ++ "-msse2" ++ ] ++ ++if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ ++ UNIFIED_SOURCES += [ ++ "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_audio/third_party/ooura/fft_size_256_gn/moz.build third_party/libwebrtc/common_audio/third_party/ooura/fft_size_256_gn/moz.build +index b3213bf070..51951092da 100644 +--- third_party/libwebrtc/common_audio/third_party/ooura/fft_size_256_gn/moz.build ++++ third_party/libwebrtc/common_audio/third_party/ooura/fft_size_256_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_gn/moz.build third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_gn/moz.build +index 6d03704624..d96b6f3a71 100644 +--- third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_gn/moz.build ++++ third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_gn/moz.build +@@ -63,6 +63,21 @@ if CONFIG["OS_TARGET"] == "Darwin": + "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c" + ] + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ ++ UNIFIED_SOURCES += [ ++ "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c" ++ ] ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -157,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -173,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -211,6 +234,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_video/common_video_gn/moz.build third_party/libwebrtc/common_video/common_video_gn/moz.build +index 5d6a4adcb3..26138f5af1 100644 +--- third_party/libwebrtc/common_video/common_video_gn/moz.build ++++ third_party/libwebrtc/common_video/common_video_gn/moz.build +@@ -81,6 +81,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -175,6 +186,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -191,6 +206,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -213,6 +232,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/common_video/frame_counts_gn/moz.build third_party/libwebrtc/common_video/frame_counts_gn/moz.build +index c33906773b..eecfd4dd84 100644 +--- third_party/libwebrtc/common_video/frame_counts_gn/moz.build ++++ third_party/libwebrtc/common_video/frame_counts_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/common_video/generic_frame_descriptor/generic_frame_descriptor_gn/moz.build third_party/libwebrtc/common_video/generic_frame_descriptor/generic_frame_descriptor_gn/moz.build +index 04b49591a7..81d951ca17 100644 +--- third_party/libwebrtc/common_video/generic_frame_descriptor/generic_frame_descriptor_gn/moz.build ++++ third_party/libwebrtc/common_video/generic_frame_descriptor/generic_frame_descriptor_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/logging/rtc_event_audio_gn/moz.build third_party/libwebrtc/logging/rtc_event_audio_gn/moz.build +index 7cd0d06686..63a1163ec2 100644 +--- third_party/libwebrtc/logging/rtc_event_audio_gn/moz.build ++++ third_party/libwebrtc/logging/rtc_event_audio_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -156,6 +167,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -172,6 +187,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -194,6 +213,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/logging/rtc_event_bwe_gn/moz.build third_party/libwebrtc/logging/rtc_event_bwe_gn/moz.build +index 7902cecfcf..678eb54e71 100644 +--- third_party/libwebrtc/logging/rtc_event_bwe_gn/moz.build ++++ third_party/libwebrtc/logging/rtc_event_bwe_gn/moz.build +@@ -73,6 +73,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -167,6 +178,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -183,6 +198,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -205,6 +224,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/logging/rtc_event_pacing_gn/moz.build third_party/libwebrtc/logging/rtc_event_pacing_gn/moz.build +index 5ce1736a8a..2c2277cfda 100644 +--- third_party/libwebrtc/logging/rtc_event_pacing_gn/moz.build ++++ third_party/libwebrtc/logging/rtc_event_pacing_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/logging/rtc_event_rtp_rtcp_gn/moz.build third_party/libwebrtc/logging/rtc_event_rtp_rtcp_gn/moz.build +index 87fa2c1dac..59b5df3381 100644 +--- third_party/libwebrtc/logging/rtc_event_rtp_rtcp_gn/moz.build ++++ third_party/libwebrtc/logging/rtc_event_rtp_rtcp_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -165,6 +176,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -181,6 +196,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -203,6 +222,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/logging/rtc_event_video_gn/moz.build third_party/libwebrtc/logging/rtc_event_video_gn/moz.build +index 35bbf759ab..740650442b 100644 +--- third_party/libwebrtc/logging/rtc_event_video_gn/moz.build ++++ third_party/libwebrtc/logging/rtc_event_video_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -192,6 +211,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/logging/rtc_stream_config_gn/moz.build third_party/libwebrtc/logging/rtc_stream_config_gn/moz.build +index 6b35e5a077..b1fe6b3bb3 100644 +--- third_party/libwebrtc/logging/rtc_stream_config_gn/moz.build ++++ third_party/libwebrtc/logging/rtc_stream_config_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/media/rtc_constants_gn/moz.build third_party/libwebrtc/media/rtc_constants_gn/moz.build +index 78cddb03a1..1e857b78e7 100644 +--- third_party/libwebrtc/media/rtc_constants_gn/moz.build ++++ third_party/libwebrtc/media/rtc_constants_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/media/rtc_encoder_simulcast_proxy_gn/moz.build third_party/libwebrtc/media/rtc_encoder_simulcast_proxy_gn/moz.build +index 4f84ca1381..cdc80664ad 100644 +--- third_party/libwebrtc/media/rtc_encoder_simulcast_proxy_gn/moz.build ++++ third_party/libwebrtc/media/rtc_encoder_simulcast_proxy_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/media/rtc_h264_profile_id_gn/moz.build third_party/libwebrtc/media/rtc_h264_profile_id_gn/moz.build +index 46b6a25fea..b02ad9dae0 100644 +--- third_party/libwebrtc/media/rtc_h264_profile_id_gn/moz.build ++++ third_party/libwebrtc/media/rtc_h264_profile_id_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/media/rtc_internal_video_codecs_gn/moz.build third_party/libwebrtc/media/rtc_internal_video_codecs_gn/moz.build +index aff43704f4..3e09a88cb7 100644 +--- third_party/libwebrtc/media/rtc_internal_video_codecs_gn/moz.build ++++ third_party/libwebrtc/media/rtc_internal_video_codecs_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/media/rtc_media_base_gn/moz.build third_party/libwebrtc/media/rtc_media_base_gn/moz.build +index 7b0ac45394..e1e6b7c15e 100644 +--- third_party/libwebrtc/media/rtc_media_base_gn/moz.build ++++ third_party/libwebrtc/media/rtc_media_base_gn/moz.build +@@ -73,6 +73,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -167,6 +178,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -183,6 +198,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -205,6 +224,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/media/rtc_media_config_gn/moz.build third_party/libwebrtc/media/rtc_media_config_gn/moz.build +index e559dfd675..d24a1900d9 100644 +--- third_party/libwebrtc/media/rtc_media_config_gn/moz.build ++++ third_party/libwebrtc/media/rtc_media_config_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/media/rtc_simulcast_encoder_adapter_gn/moz.build third_party/libwebrtc/media/rtc_simulcast_encoder_adapter_gn/moz.build +index 266b11ad8e..d7c74367e9 100644 +--- third_party/libwebrtc/media/rtc_simulcast_encoder_adapter_gn/moz.build ++++ third_party/libwebrtc/media/rtc_simulcast_encoder_adapter_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/media/rtc_vp9_profile_gn/moz.build third_party/libwebrtc/media/rtc_vp9_profile_gn/moz.build +index 52456dd65b..ce3a4ea0f0 100644 +--- third_party/libwebrtc/media/rtc_vp9_profile_gn/moz.build ++++ third_party/libwebrtc/media/rtc_vp9_profile_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/audio_coding_gn/moz.build third_party/libwebrtc/modules/audio_coding/audio_coding_gn/moz.build +index 1f968a13a1..94ecdd7dfa 100644 +--- third_party/libwebrtc/modules/audio_coding/audio_coding_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/audio_coding_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/audio_coding_module_typedefs_gn/moz.build third_party/libwebrtc/modules/audio_coding/audio_coding_module_typedefs_gn/moz.build +index 1c313a5b00..08d3e88c98 100644 +--- third_party/libwebrtc/modules/audio_coding/audio_coding_module_typedefs_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/audio_coding_module_typedefs_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_coding/audio_coding_opus_common_gn/moz.build third_party/libwebrtc/modules/audio_coding/audio_coding_opus_common_gn/moz.build +index bd7056caf3..a8a0801d58 100644 +--- third_party/libwebrtc/modules/audio_coding/audio_coding_opus_common_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/audio_coding_opus_common_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/audio_encoder_cng_gn/moz.build third_party/libwebrtc/modules/audio_coding/audio_encoder_cng_gn/moz.build +index 6fa0115864..a0ffc9ad0f 100644 +--- third_party/libwebrtc/modules/audio_coding/audio_encoder_cng_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/audio_encoder_cng_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/audio_network_adaptor_config_gn/moz.build third_party/libwebrtc/modules/audio_coding/audio_network_adaptor_config_gn/moz.build +index b537062aef..560f57dc55 100644 +--- third_party/libwebrtc/modules/audio_coding/audio_network_adaptor_config_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/audio_network_adaptor_config_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/audio_network_adaptor_gn/moz.build third_party/libwebrtc/modules/audio_coding/audio_network_adaptor_gn/moz.build +index b38993845c..4660cc9b91 100644 +--- third_party/libwebrtc/modules/audio_coding/audio_network_adaptor_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/audio_network_adaptor_gn/moz.build +@@ -77,6 +77,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -170,6 +181,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -186,6 +201,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -208,6 +227,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/default_neteq_factory_gn/moz.build third_party/libwebrtc/modules/audio_coding/default_neteq_factory_gn/moz.build +index df061c6618..c2bbb84fd5 100644 +--- third_party/libwebrtc/modules/audio_coding/default_neteq_factory_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/default_neteq_factory_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/g711_c_gn/moz.build third_party/libwebrtc/modules/audio_coding/g711_c_gn/moz.build +index e0f07f2351..d333d25384 100644 +--- third_party/libwebrtc/modules/audio_coding/g711_c_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/g711_c_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/g711_gn/moz.build third_party/libwebrtc/modules/audio_coding/g711_gn/moz.build +index 3716ec4cbe..850c1de44e 100644 +--- third_party/libwebrtc/modules/audio_coding/g711_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/g711_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -192,6 +211,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/g722_c_gn/moz.build third_party/libwebrtc/modules/audio_coding/g722_c_gn/moz.build +index 8910ce7cf4..0a1a559212 100644 +--- third_party/libwebrtc/modules/audio_coding/g722_c_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/g722_c_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/g722_gn/moz.build third_party/libwebrtc/modules/audio_coding/g722_gn/moz.build +index 71d1053761..81dae2b987 100644 +--- third_party/libwebrtc/modules/audio_coding/g722_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/g722_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -192,6 +211,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/ilbc_c_gn/moz.build third_party/libwebrtc/modules/audio_coding/ilbc_c_gn/moz.build +index 165ab4b8ac..1588baf881 100644 +--- third_party/libwebrtc/modules/audio_coding/ilbc_c_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/ilbc_c_gn/moz.build +@@ -135,6 +135,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -228,6 +239,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -244,6 +259,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -266,6 +285,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/ilbc_gn/moz.build third_party/libwebrtc/modules/audio_coding/ilbc_gn/moz.build +index e46ee8458f..d4a96cbb19 100644 +--- third_party/libwebrtc/modules/audio_coding/ilbc_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/ilbc_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/isac_bwinfo_gn/moz.build third_party/libwebrtc/modules/audio_coding/isac_bwinfo_gn/moz.build +index 538b0d271d..cbcab8c2f3 100644 +--- third_party/libwebrtc/modules/audio_coding/isac_bwinfo_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/isac_bwinfo_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_coding/isac_c_gn/moz.build third_party/libwebrtc/modules/audio_coding/isac_c_gn/moz.build +index 43fb6469dd..b49f126bad 100644 +--- third_party/libwebrtc/modules/audio_coding/isac_c_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/isac_c_gn/moz.build +@@ -89,6 +89,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -168,6 +179,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -184,6 +199,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -206,6 +225,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/isac_common_gn/moz.build third_party/libwebrtc/modules/audio_coding/isac_common_gn/moz.build +index b4ed48e62b..9656a8e979 100644 +--- third_party/libwebrtc/modules/audio_coding/isac_common_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/isac_common_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_coding/isac_gn/moz.build third_party/libwebrtc/modules/audio_coding/isac_gn/moz.build +index 67f836250c..64781830bc 100644 +--- third_party/libwebrtc/modules/audio_coding/isac_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/isac_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -147,6 +158,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -163,6 +178,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -185,6 +204,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/isac_vad_gn/moz.build third_party/libwebrtc/modules/audio_coding/isac_vad_gn/moz.build +index b7c99fdd71..0a445df1f7 100644 +--- third_party/libwebrtc/modules/audio_coding/isac_vad_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/isac_vad_gn/moz.build +@@ -66,6 +66,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -148,6 +159,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -164,6 +179,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -186,6 +205,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/legacy_encoded_audio_frame_gn/moz.build third_party/libwebrtc/modules/audio_coding/legacy_encoded_audio_frame_gn/moz.build +index 16e35fafbb..a8ca6dc587 100644 +--- third_party/libwebrtc/modules/audio_coding/legacy_encoded_audio_frame_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/legacy_encoded_audio_frame_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/neteq_gn/moz.build third_party/libwebrtc/modules/audio_coding/neteq_gn/moz.build +index fb0747b69c..46a84e8c38 100644 +--- third_party/libwebrtc/modules/audio_coding/neteq_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/neteq_gn/moz.build +@@ -99,6 +99,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -192,6 +203,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -208,6 +223,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -230,6 +249,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/pcm16b_c_gn/moz.build third_party/libwebrtc/modules/audio_coding/pcm16b_c_gn/moz.build +index 24cda76b67..99e02a289f 100644 +--- third_party/libwebrtc/modules/audio_coding/pcm16b_c_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/pcm16b_c_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/pcm16b_gn/moz.build third_party/libwebrtc/modules/audio_coding/pcm16b_gn/moz.build +index 621edd1f38..09f6cceb97 100644 +--- third_party/libwebrtc/modules/audio_coding/pcm16b_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/pcm16b_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -155,6 +166,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -171,6 +186,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -193,6 +212,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/red_gn/moz.build third_party/libwebrtc/modules/audio_coding/red_gn/moz.build +index ff0cdea507..770c012bff 100644 +--- third_party/libwebrtc/modules/audio_coding/red_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/red_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/webrtc_cng_gn/moz.build third_party/libwebrtc/modules/audio_coding/webrtc_cng_gn/moz.build +index 8a5e2d696b..8937898ffb 100644 +--- third_party/libwebrtc/modules/audio_coding/webrtc_cng_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/webrtc_cng_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/webrtc_multiopus_gn/moz.build third_party/libwebrtc/modules/audio_coding/webrtc_multiopus_gn/moz.build +index 543f023f8f..3e52c8782e 100644 +--- third_party/libwebrtc/modules/audio_coding/webrtc_multiopus_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/webrtc_multiopus_gn/moz.build +@@ -73,6 +73,18 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_CODEC_ISAC"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -211,6 +231,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + + DEFINES["WEBRTC_CODEC_ISAC"] = True + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/webrtc_opus_gn/moz.build third_party/libwebrtc/modules/audio_coding/webrtc_opus_gn/moz.build +index e831769c57..e2d3a94841 100644 +--- third_party/libwebrtc/modules/audio_coding/webrtc_opus_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/webrtc_opus_gn/moz.build +@@ -73,6 +73,18 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_CODEC_ISAC"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -170,6 +182,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -186,6 +202,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -218,6 +238,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + + DEFINES["WEBRTC_CODEC_ISAC"] = True + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_coding/webrtc_opus_wrapper_gn/moz.build third_party/libwebrtc/modules/audio_coding/webrtc_opus_wrapper_gn/moz.build +index fa94ad5248..7f242d4ccd 100644 +--- third_party/libwebrtc/modules/audio_coding/webrtc_opus_wrapper_gn/moz.build ++++ third_party/libwebrtc/modules/audio_coding/webrtc_opus_wrapper_gn/moz.build +@@ -72,6 +72,18 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_CODEC_ISAC"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -210,6 +230,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + + DEFINES["WEBRTC_CODEC_ISAC"] = True + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_device/audio_device_api_gn/moz.build third_party/libwebrtc/modules/audio_device/audio_device_api_gn/moz.build +index 0680df2546..9eb57026b1 100644 +--- third_party/libwebrtc/modules/audio_device/audio_device_api_gn/moz.build ++++ third_party/libwebrtc/modules/audio_device/audio_device_api_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_device/audio_device_buffer_gn/moz.build third_party/libwebrtc/modules/audio_device/audio_device_buffer_gn/moz.build +index 8e1e8c6eea..99aed058a2 100644 +--- third_party/libwebrtc/modules/audio_device/audio_device_buffer_gn/moz.build ++++ third_party/libwebrtc/modules/audio_device/audio_device_buffer_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_device/audio_device_default_gn/moz.build third_party/libwebrtc/modules/audio_device/audio_device_default_gn/moz.build +index a079f00e51..b73f2f5bf0 100644 +--- third_party/libwebrtc/modules/audio_device/audio_device_default_gn/moz.build ++++ third_party/libwebrtc/modules/audio_device/audio_device_default_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_device/audio_device_generic_gn/moz.build third_party/libwebrtc/modules/audio_device/audio_device_generic_gn/moz.build +index ff6ced9576..ab33cf8f57 100644 +--- third_party/libwebrtc/modules/audio_device/audio_device_generic_gn/moz.build ++++ third_party/libwebrtc/modules/audio_device/audio_device_generic_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_device/audio_device_gn/moz.build third_party/libwebrtc/modules/audio_device/audio_device_gn/moz.build +index f57f39f961..a49062054a 100644 +--- third_party/libwebrtc/modules/audio_device/audio_device_gn/moz.build ++++ third_party/libwebrtc/modules/audio_device/audio_device_gn/moz.build +@@ -64,6 +64,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -154,6 +165,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -170,6 +185,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_device/audio_device_impl_gn/moz.build third_party/libwebrtc/modules/audio_device/audio_device_impl_gn/moz.build +index c67982918f..296eea9c6d 100644 +--- third_party/libwebrtc/modules/audio_device/audio_device_impl_gn/moz.build ++++ third_party/libwebrtc/modules/audio_device/audio_device_impl_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -165,6 +176,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -181,6 +196,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -203,6 +222,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_mixer/audio_frame_manipulator_gn/moz.build third_party/libwebrtc/modules/audio_mixer/audio_frame_manipulator_gn/moz.build +index 6ef7c5724e..fc01f3952e 100644 +--- third_party/libwebrtc/modules/audio_mixer/audio_frame_manipulator_gn/moz.build ++++ third_party/libwebrtc/modules/audio_mixer/audio_frame_manipulator_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_mixer/audio_mixer_impl_gn/moz.build third_party/libwebrtc/modules/audio_mixer/audio_mixer_impl_gn/moz.build +index cf7151974d..95d9fb125a 100644 +--- third_party/libwebrtc/modules/audio_mixer/audio_mixer_impl_gn/moz.build ++++ third_party/libwebrtc/modules/audio_mixer/audio_mixer_impl_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/aec3/adaptive_fir_filter_erl_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/adaptive_fir_filter_erl_gn/moz.build +index b1898d53ae..04f8b9d9e5 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/adaptive_fir_filter_erl_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/adaptive_fir_filter_erl_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec3/adaptive_fir_filter_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/adaptive_fir_filter_gn/moz.build +index 249c41bf52..447e48922b 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/adaptive_fir_filter_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/adaptive_fir_filter_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -152,6 +163,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -168,6 +183,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn/moz.build +index 81618e8ebb..dd8080b826 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn/moz.build +@@ -77,6 +77,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -150,6 +161,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -166,6 +181,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -188,6 +207,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": + + CXXFLAGS += [ +diff --git third_party/libwebrtc/modules/audio_processing/aec3/aec3_common_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/aec3_common_gn/moz.build +index f4efbb9a68..0906a1fb69 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/aec3_common_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/aec3_common_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec3/aec3_fft_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/aec3_fft_gn/moz.build +index 5ccd7db91d..82d11ecf9e 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/aec3_fft_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/aec3_fft_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -152,6 +163,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -168,6 +183,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec3/aec3_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/aec3_gn/moz.build +index a1dbc7c8d7..6f82564ed9 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/aec3_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/aec3_gn/moz.build +@@ -121,6 +121,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -214,6 +225,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -230,6 +245,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -252,6 +271,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/aec3/fft_data_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/fft_data_gn/moz.build +index d55b326e7c..f3c8f121e9 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/fft_data_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/fft_data_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec3/matched_filter_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/matched_filter_gn/moz.build +index 33c5ef238f..feca639586 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/matched_filter_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/matched_filter_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec3/render_buffer_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/render_buffer_gn/moz.build +index a2685d2689..0fb811dd64 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/render_buffer_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/render_buffer_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec3/vector_math_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec3/vector_math_gn/moz.build +index 9e65da3503..eaa756eab9 100644 +--- third_party/libwebrtc/modules/audio_processing/aec3/vector_math_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec3/vector_math_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec_dump/aec_dump_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec_dump/aec_dump_gn/moz.build +index 452ea8eb6f..61d3197165 100644 +--- third_party/libwebrtc/modules/audio_processing/aec_dump/aec_dump_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec_dump/aec_dump_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/aec_dump/null_aec_dump_factory_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec_dump/null_aec_dump_factory_gn/moz.build +index 35e3329585..834afb7998 100644 +--- third_party/libwebrtc/modules/audio_processing/aec_dump/null_aec_dump_factory_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec_dump/null_aec_dump_factory_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/aec_dump_interface_gn/moz.build third_party/libwebrtc/modules/audio_processing/aec_dump_interface_gn/moz.build +index efc4513c9e..392e0f4ffa 100644 +--- third_party/libwebrtc/modules/audio_processing/aec_dump_interface_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aec_dump_interface_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_gn/moz.build third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_gn/moz.build +index 3efc2af585..afdd337a76 100644 +--- third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -170,6 +181,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -186,6 +201,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -208,6 +227,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc/agc_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc/agc_gn/moz.build +index cb7f900073..455a94feb0 100644 +--- third_party/libwebrtc/modules/audio_processing/agc/agc_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc/agc_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc/gain_control_interface_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc/gain_control_interface_gn/moz.build +index 2a0e9bc2c3..f14b4ffa4b 100644 +--- third_party/libwebrtc/modules/audio_processing/agc/gain_control_interface_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc/gain_control_interface_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/agc/gain_map_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc/gain_map_gn/moz.build +index 68843197cf..b7fc2b9b27 100644 +--- third_party/libwebrtc/modules/audio_processing/agc/gain_map_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc/gain_map_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/agc/legacy_agc_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc/legacy_agc_gn/moz.build +index 9cdc513dff..b73ca0a1f5 100644 +--- third_party/libwebrtc/modules/audio_processing/agc/legacy_agc_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc/legacy_agc_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc/level_estimation_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc/level_estimation_gn/moz.build +index c4ba6d6103..8c968bec46 100644 +--- third_party/libwebrtc/modules/audio_processing/agc/level_estimation_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc/level_estimation_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/adaptive_digital_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/adaptive_digital_gn/moz.build +index 873fc73ed2..7c30c4307e 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/adaptive_digital_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/adaptive_digital_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/biquad_filter_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/biquad_filter_gn/moz.build +index c082e8be20..9b5c4a102a 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/biquad_filter_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/biquad_filter_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/common_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/common_gn/moz.build +index bb2364621f..9cc868d42e 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/common_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/common_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/fixed_digital_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/fixed_digital_gn/moz.build +index c2278b5584..dceb5a5f40 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/fixed_digital_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/fixed_digital_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/gain_applier_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/gain_applier_gn/moz.build +index 7cbfedef3a..aca6db5084 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/gain_applier_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/gain_applier_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/level_estimation_agc_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/level_estimation_agc_gn/moz.build +index 6a681f6d5e..ca8d980f38 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/level_estimation_agc_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/level_estimation_agc_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/noise_level_estimator_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/noise_level_estimator_gn/moz.build +index af09244a52..a57f14ba6a 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/noise_level_estimator_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/noise_level_estimator_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_gn/moz.build +index b6cae79851..2a219468af 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_gn/moz.build +@@ -75,6 +75,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -168,6 +179,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -184,6 +199,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -206,6 +225,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad_with_level_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad_with_level_gn/moz.build +index d1b3bee93f..54fd581f80 100644 +--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad_with_level_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad_with_level_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/api_gn/moz.build third_party/libwebrtc/modules/audio_processing/api_gn/moz.build +index dfab8ef20b..35d7628efa 100644 +--- third_party/libwebrtc/modules/audio_processing/api_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/api_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/apm_logging_gn/moz.build third_party/libwebrtc/modules/audio_processing/apm_logging_gn/moz.build +index 833f44927f..95ff1333b5 100644 +--- third_party/libwebrtc/modules/audio_processing/apm_logging_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/apm_logging_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/audio_buffer_gn/moz.build third_party/libwebrtc/modules/audio_processing/audio_buffer_gn/moz.build +index ef50066aa0..f35e2bb673 100644 +--- third_party/libwebrtc/modules/audio_processing/audio_buffer_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/audio_buffer_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/audio_frame_proxies_gn/moz.build third_party/libwebrtc/modules/audio_processing/audio_frame_proxies_gn/moz.build +index aa637aa2ca..3ece88a35d 100644 +--- third_party/libwebrtc/modules/audio_processing/audio_frame_proxies_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/audio_frame_proxies_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/audio_frame_view_gn/moz.build third_party/libwebrtc/modules/audio_processing/audio_frame_view_gn/moz.build +index 4aface66d6..d93c4f540e 100644 +--- third_party/libwebrtc/modules/audio_processing/audio_frame_view_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/audio_frame_view_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/audio_processing_gn/moz.build third_party/libwebrtc/modules/audio_processing/audio_processing_gn/moz.build +index f20b13bd0a..06d3996410 100644 +--- third_party/libwebrtc/modules/audio_processing/audio_processing_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/audio_processing_gn/moz.build +@@ -82,6 +82,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -175,6 +186,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -191,6 +206,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -213,6 +232,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/audio_processing_statistics_gn/moz.build third_party/libwebrtc/modules/audio_processing/audio_processing_statistics_gn/moz.build +index 1eb1f12ac7..1047578c1c 100644 +--- third_party/libwebrtc/modules/audio_processing/audio_processing_statistics_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/audio_processing_statistics_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/config_gn/moz.build third_party/libwebrtc/modules/audio_processing/config_gn/moz.build +index efbaa9991f..01b95bf107 100644 +--- third_party/libwebrtc/modules/audio_processing/config_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/config_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/high_pass_filter_gn/moz.build third_party/libwebrtc/modules/audio_processing/high_pass_filter_gn/moz.build +index 698d52d09c..5790ee2471 100644 +--- third_party/libwebrtc/modules/audio_processing/high_pass_filter_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/high_pass_filter_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/ns/ns_gn/moz.build third_party/libwebrtc/modules/audio_processing/ns/ns_gn/moz.build +index e7b4bd602d..cdba1e73d7 100644 +--- third_party/libwebrtc/modules/audio_processing/ns/ns_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/ns/ns_gn/moz.build +@@ -80,6 +80,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -173,6 +184,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -189,6 +204,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -211,6 +230,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/optionally_built_submodule_creators_gn/moz.build third_party/libwebrtc/modules/audio_processing/optionally_built_submodule_creators_gn/moz.build +index aaaed22eeb..174e3ec82d 100644 +--- third_party/libwebrtc/modules/audio_processing/optionally_built_submodule_creators_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/optionally_built_submodule_creators_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/rms_level_gn/moz.build third_party/libwebrtc/modules/audio_processing/rms_level_gn/moz.build +index a65c04f233..f81dd6ac8b 100644 +--- third_party/libwebrtc/modules/audio_processing/rms_level_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/rms_level_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_api_gn/moz.build third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_api_gn/moz.build +index e4fedef6fe..00ff1a6f9c 100644 +--- third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_api_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_api_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl_gn/moz.build third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl_gn/moz.build +index e161f74eb6..ee40243cb5 100644 +--- third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/utility/cascaded_biquad_filter_gn/moz.build third_party/libwebrtc/modules/audio_processing/utility/cascaded_biquad_filter_gn/moz.build +index b2589fa2cb..0b6f561dfa 100644 +--- third_party/libwebrtc/modules/audio_processing/utility/cascaded_biquad_filter_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/utility/cascaded_biquad_filter_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/utility/legacy_delay_estimator_gn/moz.build third_party/libwebrtc/modules/audio_processing/utility/legacy_delay_estimator_gn/moz.build +index cf2a4f08e5..5b75fba966 100644 +--- third_party/libwebrtc/modules/audio_processing/utility/legacy_delay_estimator_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/utility/legacy_delay_estimator_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -150,6 +161,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -166,6 +181,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -188,6 +207,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/utility/pffft_wrapper_gn/moz.build third_party/libwebrtc/modules/audio_processing/utility/pffft_wrapper_gn/moz.build +index bd2401a7cb..8d497539ac 100644 +--- third_party/libwebrtc/modules/audio_processing/utility/pffft_wrapper_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/utility/pffft_wrapper_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/vad/vad_gn/moz.build third_party/libwebrtc/modules/audio_processing/vad/vad_gn/moz.build +index 06000cbc10..cf42277c70 100644 +--- third_party/libwebrtc/modules/audio_processing/vad/vad_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/vad/vad_gn/moz.build +@@ -74,6 +74,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -167,6 +178,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -183,6 +198,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -205,6 +224,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/audio_processing/voice_detection_gn/moz.build third_party/libwebrtc/modules/audio_processing/voice_detection_gn/moz.build +index bea08f119f..c104d07962 100644 +--- third_party/libwebrtc/modules/audio_processing/voice_detection_gn/moz.build ++++ third_party/libwebrtc/modules/audio_processing/voice_detection_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/congestion_controller_gn/moz.build third_party/libwebrtc/modules/congestion_controller/congestion_controller_gn/moz.build +index 6b31661826..d0d5e69729 100644 +--- third_party/libwebrtc/modules/congestion_controller/congestion_controller_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/congestion_controller_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/alr_detector_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/alr_detector_gn/moz.build +index d98d1f4660..21e9b12b4d 100644 +--- third_party/libwebrtc/modules/congestion_controller/goog_cc/alr_detector_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/goog_cc/alr_detector_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/delay_based_bwe_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/delay_based_bwe_gn/moz.build +index 9eabaa60af..cb668afcb1 100644 +--- third_party/libwebrtc/modules/congestion_controller/goog_cc/delay_based_bwe_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/goog_cc/delay_based_bwe_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/estimators_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/estimators_gn/moz.build +index 38da3f33ec..27afbf8699 100644 +--- third_party/libwebrtc/modules/congestion_controller/goog_cc/estimators_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/goog_cc/estimators_gn/moz.build +@@ -74,6 +74,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -168,6 +179,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -184,6 +199,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -206,6 +225,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/goog_cc_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/goog_cc_gn/moz.build +index 526d42a6da..c10bde89a7 100644 +--- third_party/libwebrtc/modules/congestion_controller/goog_cc/goog_cc_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/goog_cc/goog_cc_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/link_capacity_estimator_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/link_capacity_estimator_gn/moz.build +index a36d351ab1..4857832777 100644 +--- third_party/libwebrtc/modules/congestion_controller/goog_cc/link_capacity_estimator_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/goog_cc/link_capacity_estimator_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/loss_based_controller_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/loss_based_controller_gn/moz.build +index 49fc53c47c..96a190f648 100644 +--- third_party/libwebrtc/modules/congestion_controller/goog_cc/loss_based_controller_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/goog_cc/loss_based_controller_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/probe_controller_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/probe_controller_gn/moz.build +index e065f6b8d6..de0945c32f 100644 +--- third_party/libwebrtc/modules/congestion_controller/goog_cc/probe_controller_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/goog_cc/probe_controller_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/pushback_controller_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/pushback_controller_gn/moz.build +index 1a26d6fbed..ef60392c44 100644 +--- third_party/libwebrtc/modules/congestion_controller/goog_cc/pushback_controller_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/goog_cc/pushback_controller_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/rtp/control_handler_gn/moz.build third_party/libwebrtc/modules/congestion_controller/rtp/control_handler_gn/moz.build +index ec5aa36c78..873daa331e 100644 +--- third_party/libwebrtc/modules/congestion_controller/rtp/control_handler_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/rtp/control_handler_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/congestion_controller/rtp/transport_feedback_gn/moz.build third_party/libwebrtc/modules/congestion_controller/rtp/transport_feedback_gn/moz.build +index 9e1db4a2ab..c421bb524d 100644 +--- third_party/libwebrtc/modules/congestion_controller/rtp/transport_feedback_gn/moz.build ++++ third_party/libwebrtc/modules/congestion_controller/rtp/transport_feedback_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn/moz.build third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn/moz.build +index e2f5330283..8f0c389632 100644 +--- third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn/moz.build ++++ third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn/moz.build +@@ -54,6 +54,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -116,6 +127,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -128,6 +143,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -140,6 +159,19 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT": + + DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0" + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2", ++ "-msse2" ++ ] ++ ++if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": + + CXXFLAGS += [ +diff --git third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +index a5cf9234d1..59ec34a46a 100644 +--- third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ++++ third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +@@ -86,6 +86,59 @@ if CONFIG["OS_TARGET"] == "Darwin": + "/third_party/libwebrtc/modules/desktop_capture/mac/window_list_utils.cc" + ] + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["WEBRTC_USE_PIPEWIRE"] = True ++ DEFINES["WEBRTC_USE_X11"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ ++ LOCAL_INCLUDES += [ ++ "/media/libyuv/libyuv/include/", ++ "/media/libyuv/libyuv/include/", ++ "/third_party/pipewire/", ++ "/third_party/pipewire/" ++ ] ++ ++ OS_LIBS += [ ++ "X11", ++ "Xcomposite", ++ "Xdamage", ++ "Xext", ++ "Xfixes", ++ "Xrandr", ++ "Xrender", ++ "Xtst" ++ ] ++ ++ SOURCES += [ ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ ] ++ ++ UNIFIED_SOURCES += [ ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/x_atom_cache.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/x_error_trap.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/x_server_pixel_buffer.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/x_window_property.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc" ++ ] ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -282,6 +335,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -294,6 +351,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -306,6 +367,12 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT": + + DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0" + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build +index 4cf85ddfa7..0e133b2212 100644 +--- third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build ++++ third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build +@@ -46,6 +46,29 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["WEBRTC_USE_X11"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ ++ OS_LIBS += [ ++ "X11", ++ "Xcomposite", ++ "Xdamage", ++ "Xext", ++ "Xfixes", ++ "Xrandr", ++ "Xrender", ++ "Xtst" ++ ] ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -144,6 +167,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -156,6 +183,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/desktop_capture/primitives_gn/moz.build third_party/libwebrtc/modules/desktop_capture/primitives_gn/moz.build +index 6831d8a311..10af878b46 100644 +--- third_party/libwebrtc/modules/desktop_capture/primitives_gn/moz.build ++++ third_party/libwebrtc/modules/desktop_capture/primitives_gn/moz.build +@@ -54,6 +54,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -117,6 +128,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -129,6 +144,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -141,6 +160,12 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT": + + DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0" + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/module_api_gn/moz.build third_party/libwebrtc/modules/module_api_gn/moz.build +index 18dcb08135..e60a418a5c 100644 +--- third_party/libwebrtc/modules/module_api_gn/moz.build ++++ third_party/libwebrtc/modules/module_api_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/module_api_public_gn/moz.build third_party/libwebrtc/modules/module_api_public_gn/moz.build +index 9e786592ef..a45d4b3617 100644 +--- third_party/libwebrtc/modules/module_api_public_gn/moz.build ++++ third_party/libwebrtc/modules/module_api_public_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/module_fec_api_gn/moz.build third_party/libwebrtc/modules/module_fec_api_gn/moz.build +index 94c74fa40b..d535f75c8e 100644 +--- third_party/libwebrtc/modules/module_fec_api_gn/moz.build ++++ third_party/libwebrtc/modules/module_fec_api_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/pacing/interval_budget_gn/moz.build third_party/libwebrtc/modules/pacing/interval_budget_gn/moz.build +index 303d47a95a..cff53a7075 100644 +--- third_party/libwebrtc/modules/pacing/interval_budget_gn/moz.build ++++ third_party/libwebrtc/modules/pacing/interval_budget_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/pacing/pacing_gn/moz.build third_party/libwebrtc/modules/pacing/pacing_gn/moz.build +index f6fde08638..01d969c0c9 100644 +--- third_party/libwebrtc/modules/pacing/pacing_gn/moz.build ++++ third_party/libwebrtc/modules/pacing/pacing_gn/moz.build +@@ -73,6 +73,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -167,6 +178,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -183,6 +198,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -205,6 +224,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_gn/moz.build third_party/libwebrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_gn/moz.build +index bca6684427..599af3d257 100644 +--- third_party/libwebrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_gn/moz.build ++++ third_party/libwebrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_gn/moz.build +@@ -79,6 +79,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -173,6 +184,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -189,6 +204,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -211,6 +230,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_format_gn/moz.build third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_format_gn/moz.build +index a5ec9f4951..e036ba0402 100644 +--- third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_format_gn/moz.build ++++ third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_format_gn/moz.build +@@ -109,6 +109,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -203,6 +214,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -219,6 +234,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -241,6 +260,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_gn/moz.build third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_gn/moz.build +index 33a43eeed5..13217b736d 100644 +--- third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_gn/moz.build ++++ third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_gn/moz.build +@@ -121,6 +121,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -215,6 +226,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -231,6 +246,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -253,6 +272,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/rtp_rtcp/rtp_video_header_gn/moz.build third_party/libwebrtc/modules/rtp_rtcp/rtp_video_header_gn/moz.build +index aee62695af..087ee836d1 100644 +--- third_party/libwebrtc/modules/rtp_rtcp/rtp_video_header_gn/moz.build ++++ third_party/libwebrtc/modules/rtp_rtcp/rtp_video_header_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/third_party/fft/fft_gn/moz.build third_party/libwebrtc/modules/third_party/fft/fft_gn/moz.build +index 60e216ff55..192f544d28 100644 +--- third_party/libwebrtc/modules/third_party/fft/fft_gn/moz.build ++++ third_party/libwebrtc/modules/third_party/fft/fft_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/third_party/g711/g711_3p_gn/moz.build third_party/libwebrtc/modules/third_party/g711/g711_3p_gn/moz.build +index 4004c61364..4e7396bbec 100644 +--- third_party/libwebrtc/modules/third_party/g711/g711_3p_gn/moz.build ++++ third_party/libwebrtc/modules/third_party/g711/g711_3p_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/third_party/g722/g722_3p_gn/moz.build third_party/libwebrtc/modules/third_party/g722/g722_3p_gn/moz.build +index 03a10df48e..91630f3272 100644 +--- third_party/libwebrtc/modules/third_party/g722/g722_3p_gn/moz.build ++++ third_party/libwebrtc/modules/third_party/g722/g722_3p_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/utility/utility_gn/moz.build third_party/libwebrtc/modules/utility/utility_gn/moz.build +index e0b16b4073..5881ab6869 100644 +--- third_party/libwebrtc/modules/utility/utility_gn/moz.build ++++ third_party/libwebrtc/modules/utility/utility_gn/moz.build +@@ -72,6 +72,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -165,6 +176,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -181,6 +196,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -203,6 +222,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build +index 3b4e237101..0f5c345da0 100644 +--- third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build ++++ third_party/libwebrtc/modules/video_capture/video_capture_internal_impl_gn/moz.build +@@ -64,6 +64,22 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ ++ UNIFIED_SOURCES += [ ++ "/third_party/libwebrtc/modules/video_capture/linux/device_info_linux.cc", ++ "/third_party/libwebrtc/modules/video_capture/linux/video_capture_linux.cc" ++ ] ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -179,6 +195,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -195,6 +215,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -213,6 +237,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_capture/video_capture_module_gn/moz.build third_party/libwebrtc/modules/video_capture/video_capture_module_gn/moz.build +index 86bc0e277d..c0f82da6ef 100644 +--- third_party/libwebrtc/modules/video_capture/video_capture_module_gn/moz.build ++++ third_party/libwebrtc/modules/video_capture/video_capture_module_gn/moz.build +@@ -72,6 +72,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -166,6 +177,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -182,6 +197,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -204,6 +223,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/chain_diff_calculator_gn/moz.build third_party/libwebrtc/modules/video_coding/chain_diff_calculator_gn/moz.build +index 8519e21097..6181f3b482 100644 +--- third_party/libwebrtc/modules/video_coding/chain_diff_calculator_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/chain_diff_calculator_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/codec_globals_headers_gn/moz.build third_party/libwebrtc/modules/video_coding/codec_globals_headers_gn/moz.build +index 5f42fd5adb..7836c9170f 100644 +--- third_party/libwebrtc/modules/video_coding/codec_globals_headers_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/codec_globals_headers_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_decoder_gn/moz.build third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_decoder_gn/moz.build +index 69874c53ac..b8db8cd9cc 100644 +--- third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_decoder_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_decoder_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_gn/moz.build third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_gn/moz.build +index f6af0518a3..d1f6bff5e2 100644 +--- third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/deprecated/nack_module_gn/moz.build third_party/libwebrtc/modules/video_coding/deprecated/nack_module_gn/moz.build +index 4ed27aaed8..2a4a1ff7dd 100644 +--- third_party/libwebrtc/modules/video_coding/deprecated/nack_module_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/deprecated/nack_module_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/encoded_frame_gn/moz.build third_party/libwebrtc/modules/video_coding/encoded_frame_gn/moz.build +index d8d1780d20..25e50ff6fb 100644 +--- third_party/libwebrtc/modules/video_coding/encoded_frame_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/encoded_frame_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -162,6 +173,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -178,6 +193,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -200,6 +219,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/frame_dependencies_calculator_gn/moz.build third_party/libwebrtc/modules/video_coding/frame_dependencies_calculator_gn/moz.build +index 8b09cfc9ec..f3e5353ab5 100644 +--- third_party/libwebrtc/modules/video_coding/frame_dependencies_calculator_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/frame_dependencies_calculator_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/nack_module_gn/moz.build third_party/libwebrtc/modules/video_coding/nack_module_gn/moz.build +index d6059d52d2..2baa67b084 100644 +--- third_party/libwebrtc/modules/video_coding/nack_module_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/nack_module_gn/moz.build +@@ -68,6 +68,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -161,6 +172,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -177,6 +192,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -199,6 +218,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/video_codec_interface_gn/moz.build third_party/libwebrtc/modules/video_coding/video_codec_interface_gn/moz.build +index e073ac2c3f..e9bb1da50b 100644 +--- third_party/libwebrtc/modules/video_coding/video_codec_interface_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/video_codec_interface_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/video_coding_gn/moz.build third_party/libwebrtc/modules/video_coding/video_coding_gn/moz.build +index 8c0f15071b..190ae3c4d6 100644 +--- third_party/libwebrtc/modules/video_coding/video_coding_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/video_coding_gn/moz.build +@@ -88,6 +88,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -182,6 +193,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -198,6 +213,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -220,6 +239,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/video_coding_utility_gn/moz.build third_party/libwebrtc/modules/video_coding/video_coding_utility_gn/moz.build +index b6e4b928cf..aef33114b0 100644 +--- third_party/libwebrtc/modules/video_coding/video_coding_utility_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/video_coding_utility_gn/moz.build +@@ -77,6 +77,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -171,6 +182,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -187,6 +202,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -209,6 +228,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/webrtc_h264_gn/moz.build third_party/libwebrtc/modules/video_coding/webrtc_h264_gn/moz.build +index 2dced7c944..efa5dcadbb 100644 +--- third_party/libwebrtc/modules/video_coding/webrtc_h264_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/webrtc_h264_gn/moz.build +@@ -73,6 +73,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -167,6 +178,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -183,6 +198,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -205,6 +224,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/webrtc_multiplex_gn/moz.build third_party/libwebrtc/modules/video_coding/webrtc_multiplex_gn/moz.build +index 35b41b3c67..f82513bdc4 100644 +--- third_party/libwebrtc/modules/video_coding/webrtc_multiplex_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/webrtc_multiplex_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -165,6 +176,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -181,6 +196,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -203,6 +222,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/webrtc_vp8_gn/moz.build third_party/libwebrtc/modules/video_coding/webrtc_vp8_gn/moz.build +index 2315a41528..ecffacb782 100644 +--- third_party/libwebrtc/modules/video_coding/webrtc_vp8_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/webrtc_vp8_gn/moz.build +@@ -72,6 +72,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -166,6 +177,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -182,6 +197,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -204,6 +223,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/webrtc_vp8_temporal_layers_gn/moz.build third_party/libwebrtc/modules/video_coding/webrtc_vp8_temporal_layers_gn/moz.build +index 4eef28d19b..4c068c393b 100644 +--- third_party/libwebrtc/modules/video_coding/webrtc_vp8_temporal_layers_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/webrtc_vp8_temporal_layers_gn/moz.build +@@ -73,6 +73,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -167,6 +178,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -183,6 +198,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -205,6 +224,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/webrtc_vp9_gn/moz.build third_party/libwebrtc/modules/video_coding/webrtc_vp9_gn/moz.build +index cd75be3c84..9d1ce64bba 100644 +--- third_party/libwebrtc/modules/video_coding/webrtc_vp9_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/webrtc_vp9_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -164,6 +175,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -180,6 +195,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -202,6 +221,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_coding/webrtc_vp9_helpers_gn/moz.build third_party/libwebrtc/modules/video_coding/webrtc_vp9_helpers_gn/moz.build +index 4b0b804423..581c06d007 100644 +--- third_party/libwebrtc/modules/video_coding/webrtc_vp9_helpers_gn/moz.build ++++ third_party/libwebrtc/modules/video_coding/webrtc_vp9_helpers_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -163,6 +174,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -179,6 +194,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -201,6 +220,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_processing/denoiser_filter_gn/moz.build third_party/libwebrtc/modules/video_processing/denoiser_filter_gn/moz.build +index 7407051e7e..5665ec1796 100644 +--- third_party/libwebrtc/modules/video_processing/denoiser_filter_gn/moz.build ++++ third_party/libwebrtc/modules/video_processing/denoiser_filter_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/video_processing/video_processing_gn/moz.build third_party/libwebrtc/modules/video_processing/video_processing_gn/moz.build +index f7b210e234..08ca80445c 100644 +--- third_party/libwebrtc/modules/video_processing/video_processing_gn/moz.build ++++ third_party/libwebrtc/modules/video_processing/video_processing_gn/moz.build +@@ -74,6 +74,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -168,6 +179,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -184,6 +199,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -206,6 +225,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/modules/video_processing/video_processing_neon_gn/moz.build third_party/libwebrtc/modules/video_processing/video_processing_neon_gn/moz.build +index 476e28a19c..8cf4b20aaf 100644 +--- third_party/libwebrtc/modules/video_processing/video_processing_neon_gn/moz.build ++++ third_party/libwebrtc/modules/video_processing/video_processing_neon_gn/moz.build +@@ -65,6 +65,18 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_ARCH_ARM64"] = True ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +@@ -133,6 +145,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -145,6 +161,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/modules/video_processing/video_processing_sse2_gn/moz.build third_party/libwebrtc/modules/video_processing/video_processing_sse2_gn/moz.build +index cc42b921e5..9e18982afa 100644 +--- third_party/libwebrtc/modules/video_processing/video_processing_sse2_gn/moz.build ++++ third_party/libwebrtc/modules/video_processing/video_processing_sse2_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -148,6 +159,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -164,6 +179,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -193,6 +212,19 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Android": + "-msse2" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2", ++ "-msse2" ++ ] ++ ++if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": + + CXXFLAGS += [ +diff --git third_party/libwebrtc/moz.build third_party/libwebrtc/moz.build +index 11313553ed..ee4cf1c70d 100644 +--- third_party/libwebrtc/moz.build ++++ third_party/libwebrtc/moz.build +@@ -384,6 +384,18 @@ if CONFIG["OS_TARGET"] == "Darwin": + "/third_party/libwebrtc/sdk/helpers_objc_gn" + ] + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DIRS += [ ++ "/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn", ++ "/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn", ++ "/third_party/libwebrtc/modules/audio_coding/isac_c_gn", ++ "/third_party/libwebrtc/modules/audio_coding/isac_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn" ++ ] ++ + if CONFIG["OS_TARGET"] == "Linux": + + DIRS += [ +@@ -497,6 +509,34 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Darwin": + "/third_party/libwebrtc/modules/video_processing/video_processing_sse2_gn" + ] + ++if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DIRS += [ ++ "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn", ++ "/third_party/libwebrtc/common_audio/common_audio_neon_gn", ++ "/third_party/libwebrtc/modules/video_processing/video_processing_neon_gn" ++ ] ++ ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DIRS += [ ++ "/third_party/libwebrtc/common_audio/common_audio_avx2_gn", ++ "/third_party/libwebrtc/common_audio/common_audio_sse2_gn", ++ "/third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn", ++ "/third_party/libwebrtc/modules/video_processing/video_processing_sse2_gn" ++ ] ++ ++if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DIRS += [ ++ "/third_party/libwebrtc/common_audio/common_audio_avx2_gn", ++ "/third_party/libwebrtc/common_audio/common_audio_sse2_gn", ++ "/third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn", ++ "/third_party/libwebrtc/modules/video_processing/video_processing_sse2_gn" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DIRS += [ +diff --git third_party/libwebrtc/rtc_base/atomicops_gn/moz.build third_party/libwebrtc/rtc_base/atomicops_gn/moz.build +index e81ee452c4..8e62ea0b2f 100644 +--- third_party/libwebrtc/rtc_base/atomicops_gn/moz.build ++++ third_party/libwebrtc/rtc_base/atomicops_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/audio_format_to_string_gn/moz.build third_party/libwebrtc/rtc_base/audio_format_to_string_gn/moz.build +index 1562c0c15e..a317bbaed1 100644 +--- third_party/libwebrtc/rtc_base/audio_format_to_string_gn/moz.build ++++ third_party/libwebrtc/rtc_base/audio_format_to_string_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/checks_gn/moz.build third_party/libwebrtc/rtc_base/checks_gn/moz.build +index cd0f53f896..9bc0698b2a 100644 +--- third_party/libwebrtc/rtc_base/checks_gn/moz.build ++++ third_party/libwebrtc/rtc_base/checks_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/compile_assert_c_gn/moz.build third_party/libwebrtc/rtc_base/compile_assert_c_gn/moz.build +index 6d4c494876..f53819d83e 100644 +--- third_party/libwebrtc/rtc_base/compile_assert_c_gn/moz.build ++++ third_party/libwebrtc/rtc_base/compile_assert_c_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/criticalsection_gn/moz.build third_party/libwebrtc/rtc_base/criticalsection_gn/moz.build +index 4da8d7835a..5a2fc712b7 100644 +--- third_party/libwebrtc/rtc_base/criticalsection_gn/moz.build ++++ third_party/libwebrtc/rtc_base/criticalsection_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/deprecation_gn/moz.build third_party/libwebrtc/rtc_base/deprecation_gn/moz.build +index e270de4c35..e3ba310b6f 100644 +--- third_party/libwebrtc/rtc_base/deprecation_gn/moz.build ++++ third_party/libwebrtc/rtc_base/deprecation_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/divide_round_gn/moz.build third_party/libwebrtc/rtc_base/divide_round_gn/moz.build +index 0fcf9b238b..67dfd9daa9 100644 +--- third_party/libwebrtc/rtc_base/divide_round_gn/moz.build ++++ third_party/libwebrtc/rtc_base/divide_round_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/experiments/alr_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/alr_experiment_gn/moz.build +index 82b2d0f65b..5c95c7e43a 100644 +--- third_party/libwebrtc/rtc_base/experiments/alr_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/alr_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/balanced_degradation_settings_gn/moz.build third_party/libwebrtc/rtc_base/experiments/balanced_degradation_settings_gn/moz.build +index 5d3674f5ec..0fe9133e79 100644 +--- third_party/libwebrtc/rtc_base/experiments/balanced_degradation_settings_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/balanced_degradation_settings_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/cpu_speed_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/cpu_speed_experiment_gn/moz.build +index 09a8a30dcc..6edf8f0f03 100644 +--- third_party/libwebrtc/rtc_base/experiments/cpu_speed_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/cpu_speed_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/field_trial_parser_gn/moz.build third_party/libwebrtc/rtc_base/experiments/field_trial_parser_gn/moz.build +index 9affe97b83..b1b560526a 100644 +--- third_party/libwebrtc/rtc_base/experiments/field_trial_parser_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/field_trial_parser_gn/moz.build +@@ -70,6 +70,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -156,6 +167,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -172,6 +187,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -194,6 +213,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/jitter_upper_bound_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/jitter_upper_bound_experiment_gn/moz.build +index 6f0e85bc42..32f1ce05c6 100644 +--- third_party/libwebrtc/rtc_base/experiments/jitter_upper_bound_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/jitter_upper_bound_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/keyframe_interval_settings_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/keyframe_interval_settings_experiment_gn/moz.build +index d1321d6a34..7eb3cfdc8d 100644 +--- third_party/libwebrtc/rtc_base/experiments/keyframe_interval_settings_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/keyframe_interval_settings_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/min_video_bitrate_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/min_video_bitrate_experiment_gn/moz.build +index 9c23102ce9..dcb4e39f25 100644 +--- third_party/libwebrtc/rtc_base/experiments/min_video_bitrate_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/min_video_bitrate_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/quality_rampup_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/quality_rampup_experiment_gn/moz.build +index d336e658c0..ceb5cf6cbe 100644 +--- third_party/libwebrtc/rtc_base/experiments/quality_rampup_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/quality_rampup_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/quality_scaler_settings_gn/moz.build third_party/libwebrtc/rtc_base/experiments/quality_scaler_settings_gn/moz.build +index 9b65e10218..286f122ed6 100644 +--- third_party/libwebrtc/rtc_base/experiments/quality_scaler_settings_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/quality_scaler_settings_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/quality_scaling_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/quality_scaling_experiment_gn/moz.build +index c5b21c9f05..a75e83a45d 100644 +--- third_party/libwebrtc/rtc_base/experiments/quality_scaling_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/quality_scaling_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/rate_control_settings_gn/moz.build third_party/libwebrtc/rtc_base/experiments/rate_control_settings_gn/moz.build +index 0be8b6e56e..063f6ca854 100644 +--- third_party/libwebrtc/rtc_base/experiments/rate_control_settings_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/rate_control_settings_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/rtt_mult_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/rtt_mult_experiment_gn/moz.build +index 5edc266617..0b15891971 100644 +--- third_party/libwebrtc/rtc_base/experiments/rtt_mult_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/rtt_mult_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/experiments/stable_target_rate_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/stable_target_rate_experiment_gn/moz.build +index c90ea47893..1e0ae39f5a 100644 +--- third_party/libwebrtc/rtc_base/experiments/stable_target_rate_experiment_gn/moz.build ++++ third_party/libwebrtc/rtc_base/experiments/stable_target_rate_experiment_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/gtest_prod_gn/moz.build third_party/libwebrtc/rtc_base/gtest_prod_gn/moz.build +index 83bd305dbd..397c03437b 100644 +--- third_party/libwebrtc/rtc_base/gtest_prod_gn/moz.build ++++ third_party/libwebrtc/rtc_base/gtest_prod_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/ignore_wundef_gn/moz.build third_party/libwebrtc/rtc_base/ignore_wundef_gn/moz.build +index 1d41d27c81..daafa435c6 100644 +--- third_party/libwebrtc/rtc_base/ignore_wundef_gn/moz.build ++++ third_party/libwebrtc/rtc_base/ignore_wundef_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/logging_gn/moz.build third_party/libwebrtc/rtc_base/logging_gn/moz.build +index 3cd69d3494..816cbc3dba 100644 +--- third_party/libwebrtc/rtc_base/logging_gn/moz.build ++++ third_party/libwebrtc/rtc_base/logging_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/macromagic_gn/moz.build third_party/libwebrtc/rtc_base/macromagic_gn/moz.build +index bf9b26b06d..f400c123d1 100644 +--- third_party/libwebrtc/rtc_base/macromagic_gn/moz.build ++++ third_party/libwebrtc/rtc_base/macromagic_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/memory/aligned_malloc_gn/moz.build third_party/libwebrtc/rtc_base/memory/aligned_malloc_gn/moz.build +index 8eb7cbafda..7270026522 100644 +--- third_party/libwebrtc/rtc_base/memory/aligned_malloc_gn/moz.build ++++ third_party/libwebrtc/rtc_base/memory/aligned_malloc_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build +index 175efb565e..01002b6f68 100644 +--- third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build ++++ third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/platform_thread_gn/moz.build third_party/libwebrtc/rtc_base/platform_thread_gn/moz.build +index 27d304aa8a..4e0da258de 100644 +--- third_party/libwebrtc/rtc_base/platform_thread_gn/moz.build ++++ third_party/libwebrtc/rtc_base/platform_thread_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/platform_thread_types_gn/moz.build third_party/libwebrtc/rtc_base/platform_thread_types_gn/moz.build +index b8919fe70d..92c62a2dc5 100644 +--- third_party/libwebrtc/rtc_base/platform_thread_types_gn/moz.build ++++ third_party/libwebrtc/rtc_base/platform_thread_types_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -145,6 +156,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -161,6 +176,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -183,6 +202,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/protobuf_utils_gn/moz.build third_party/libwebrtc/rtc_base/protobuf_utils_gn/moz.build +index 29bb85689a..51a5a79011 100644 +--- third_party/libwebrtc/rtc_base/protobuf_utils_gn/moz.build ++++ third_party/libwebrtc/rtc_base/protobuf_utils_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/rate_limiter_gn/moz.build third_party/libwebrtc/rtc_base/rate_limiter_gn/moz.build +index 4b43624a4d..8f90e5fc32 100644 +--- third_party/libwebrtc/rtc_base/rate_limiter_gn/moz.build ++++ third_party/libwebrtc/rtc_base/rate_limiter_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -160,6 +171,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -176,6 +191,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -198,6 +217,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/refcount_gn/moz.build third_party/libwebrtc/rtc_base/refcount_gn/moz.build +index 0bb1831752..e1e97a1c61 100644 +--- third_party/libwebrtc/rtc_base/refcount_gn/moz.build ++++ third_party/libwebrtc/rtc_base/refcount_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/rtc_base_approved_gn/moz.build third_party/libwebrtc/rtc_base/rtc_base_approved_gn/moz.build +index 1a0a056251..681b7f6e3e 100644 +--- third_party/libwebrtc/rtc_base/rtc_base_approved_gn/moz.build ++++ third_party/libwebrtc/rtc_base/rtc_base_approved_gn/moz.build +@@ -80,6 +80,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -170,6 +181,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -186,6 +201,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -208,6 +227,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/rtc_base_gn/moz.build third_party/libwebrtc/rtc_base/rtc_base_gn/moz.build +index 2831f73c90..208fc12f5a 100644 +--- third_party/libwebrtc/rtc_base/rtc_base_gn/moz.build ++++ third_party/libwebrtc/rtc_base/rtc_base_gn/moz.build +@@ -94,6 +94,21 @@ if CONFIG["OS_TARGET"] == "Darwin": + "/third_party/libwebrtc/rtc_base/mac_ifaddrs_converter.cc" + ] + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ ++ UNIFIED_SOURCES += [ ++ "/third_party/libwebrtc/rtc_base/ifaddrs_converter.cc" ++ ] ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -203,6 +218,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -219,6 +238,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -241,6 +264,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/rtc_event_gn/moz.build third_party/libwebrtc/rtc_base/rtc_event_gn/moz.build +index 76376fd45d..a299d4f539 100644 +--- third_party/libwebrtc/rtc_base/rtc_event_gn/moz.build ++++ third_party/libwebrtc/rtc_base/rtc_event_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/rtc_numerics_gn/moz.build third_party/libwebrtc/rtc_base/rtc_numerics_gn/moz.build +index 4a6ac162af..9e1f79a96a 100644 +--- third_party/libwebrtc/rtc_base/rtc_numerics_gn/moz.build ++++ third_party/libwebrtc/rtc_base/rtc_numerics_gn/moz.build +@@ -69,6 +69,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -155,6 +166,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -171,6 +186,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -193,6 +212,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/rtc_task_queue_gn/moz.build third_party/libwebrtc/rtc_base/rtc_task_queue_gn/moz.build +index 16c3631473..a03e2565fe 100644 +--- third_party/libwebrtc/rtc_base/rtc_task_queue_gn/moz.build ++++ third_party/libwebrtc/rtc_base/rtc_task_queue_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/safe_compare_gn/moz.build third_party/libwebrtc/rtc_base/safe_compare_gn/moz.build +index e4bad4fb28..7654bf0046 100644 +--- third_party/libwebrtc/rtc_base/safe_compare_gn/moz.build ++++ third_party/libwebrtc/rtc_base/safe_compare_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/safe_conversions_gn/moz.build third_party/libwebrtc/rtc_base/safe_conversions_gn/moz.build +index ac5270a93e..817797ec60 100644 +--- third_party/libwebrtc/rtc_base/safe_conversions_gn/moz.build ++++ third_party/libwebrtc/rtc_base/safe_conversions_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/safe_minmax_gn/moz.build third_party/libwebrtc/rtc_base/safe_minmax_gn/moz.build +index cced167265..3a03342908 100644 +--- third_party/libwebrtc/rtc_base/safe_minmax_gn/moz.build ++++ third_party/libwebrtc/rtc_base/safe_minmax_gn/moz.build +@@ -63,6 +63,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -141,6 +152,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -157,6 +172,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/sanitizer_gn/moz.build third_party/libwebrtc/rtc_base/sanitizer_gn/moz.build +index 5e7a5ecc50..5d37d4610f 100644 +--- third_party/libwebrtc/rtc_base/sanitizer_gn/moz.build ++++ third_party/libwebrtc/rtc_base/sanitizer_gn/moz.build +@@ -59,6 +59,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -137,6 +148,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -153,6 +168,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +diff --git third_party/libwebrtc/rtc_base/stringutils_gn/moz.build third_party/libwebrtc/rtc_base/stringutils_gn/moz.build +index e398bb8abc..709e325bd2 100644 +--- third_party/libwebrtc/rtc_base/stringutils_gn/moz.build ++++ third_party/libwebrtc/rtc_base/stringutils_gn/moz.build +@@ -71,6 +71,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -153,6 +164,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -169,6 +184,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -191,6 +210,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/synchronization/mutex_gn/moz.build third_party/libwebrtc/rtc_base/synchronization/mutex_gn/moz.build +index 184fcdaa67..ca2360f09e 100644 +--- third_party/libwebrtc/rtc_base/synchronization/mutex_gn/moz.build ++++ third_party/libwebrtc/rtc_base/synchronization/mutex_gn/moz.build +@@ -67,6 +67,17 @@ if CONFIG["OS_TARGET"] == "Darwin": + DEFINES["__STDC_CONSTANT_MACROS"] = True + DEFINES["__STDC_FORMAT_MACROS"] = True + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -149,6 +160,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -165,6 +180,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_DEBUG"] = True + ++if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_DEBUG"] = True ++ + if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_DEBUG"] = True +@@ -187,6 +206,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Android": + "android_support" + ] + ++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ CXXFLAGS += [ ++ "-msse2" ++ ] ++ + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["CR_SYSROOT_HASH"] = "ef67b6ca8fd6e2e51515a243d043d1ea4caf45e6" +diff --git third_party/libwebrtc/rtc_base/synchronization/rw_lock_wrapper_gn/moz.build third_party/libwebrtc/rtc_base/synchronization/rw_lock_wrapper_gn/moz.build +index 5f14995c08..c88bc65d9a 100644 +--- third_party/libwebrtc/rtc_base/synchronization/rw_lock_wrapper_gn/moz.build ++++ third_party/libwebrtc/rtc_base/synchronization/rw_lock_wrapper_gn/moz.build +@@ -71,6 +71,21 @@ if CONFIG["OS_TARGET"] == "Darwin": + "/third_party/libwebrtc/rtc_base/synchronization/rw_lock_posix.cc" + ] + ++if CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["USE_GLIB"] = "1" ++ DEFINES["WEBRTC_BSD"] = True ++ DEFINES["WEBRTC_POSIX"] = True ++ DEFINES["_FILE_OFFSET_BITS"] = "64" ++ DEFINES["_LARGEFILE64_SOURCE"] = True ++ DEFINES["_LARGEFILE_SOURCE"] = True ++ DEFINES["__STDC_CONSTANT_MACROS"] = True ++ DEFINES["__STDC_FORMAT_MACROS"] = True ++ ++ UNIFIED_SOURCES += [ ++ "/third_party/libwebrtc/rtc_base/synchronization/rw_lock_posix.cc" ++ ] ++ + if CONFIG["OS_TARGET"] == "Linux": + + DEFINES["USE_AURA"] = "1" +@@ -169,6 +184,10 @@ if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Darwin": + + DEFINES["_FORTIFY_SOURCE"] = "2" + ++if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "FreeBSD": ++ ++ DEFINES["_FORTIFY_SOURCE"] = "2" ++ + if not CONFIG["MOZ_DEBUG"] and CONFIG["OS_TARGET"] == "Linux": + + DEFINES["_FORTIFY_SOURCE"] = "2" +@@ -185,6 +204,10 @@ if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": |