commit 462d04e65b861f39087a21d6124fde12a17f17e3
Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>

    regenerate FreeBSD libwebrtc patch for gecko 147

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 a4922c66929f..210a9a828897 100644
--- third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build
+++ third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("resource_adaptation_api_gn")
diff --git third_party/libwebrtc/api/array_view_gn/moz.build third_party/libwebrtc/api/array_view_gn/moz.build
index f1102c30059a..d2ebee0ec710 100644
--- third_party/libwebrtc/api/array_view_gn/moz.build
+++ third_party/libwebrtc/api/array_view_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("array_view_gn")
diff --git third_party/libwebrtc/api/async_dns_resolver_gn/moz.build third_party/libwebrtc/api/async_dns_resolver_gn/moz.build
index b4939a5514c1..1c688af7efa3 100644
--- third_party/libwebrtc/api/async_dns_resolver_gn/moz.build
+++ third_party/libwebrtc/api/async_dns_resolver_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("async_dns_resolver_gn")
diff --git third_party/libwebrtc/api/audio/aec3_config_gn/moz.build third_party/libwebrtc/api/audio/aec3_config_gn/moz.build
index 4ae595bcba6d..3e9fbb0332ff 100644
--- third_party/libwebrtc/api/audio/aec3_config_gn/moz.build
+++ third_party/libwebrtc/api/audio/aec3_config_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("aec3_config_gn")
diff --git third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build
index 6f88ea8491e1..9fe5afa4dd03 100644
--- third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build
+++ third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("aec3_factory_gn")
diff --git third_party/libwebrtc/api/audio/audio_device_gn/moz.build third_party/libwebrtc/api/audio/audio_device_gn/moz.build
index 8e0dddd4c23e..1812ab6bedf8 100644
--- third_party/libwebrtc/api/audio/audio_device_gn/moz.build
+++ third_party/libwebrtc/api/audio/audio_device_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_device_gn")
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 fb633e3930e2..9ba8edf80c44 100644
--- third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build
+++ third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_frame_api_gn")
diff --git third_party/libwebrtc/api/audio/audio_frame_processor_gn/moz.build third_party/libwebrtc/api/audio/audio_frame_processor_gn/moz.build
index 0088f18ad2dc..8228190616ec 100644
--- third_party/libwebrtc/api/audio/audio_frame_processor_gn/moz.build
+++ third_party/libwebrtc/api/audio/audio_frame_processor_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_frame_processor_gn")
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 28b98ffce7a9..ac544c619786 100644
--- third_party/libwebrtc/api/audio/audio_mixer_api_gn/moz.build
+++ third_party/libwebrtc/api/audio/audio_mixer_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_mixer_api_gn")
diff --git third_party/libwebrtc/api/audio/audio_processing_gn/moz.build third_party/libwebrtc/api/audio/audio_processing_gn/moz.build
index cdd225e6797e..bc5318d09ca8 100644
--- third_party/libwebrtc/api/audio/audio_processing_gn/moz.build
+++ third_party/libwebrtc/api/audio/audio_processing_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_processing_gn")
diff --git third_party/libwebrtc/api/audio/audio_processing_statistics_gn/moz.build third_party/libwebrtc/api/audio/audio_processing_statistics_gn/moz.build
index 5e452f4c3ed0..fcb573b9c8c6 100644
--- third_party/libwebrtc/api/audio/audio_processing_statistics_gn/moz.build
+++ third_party/libwebrtc/api/audio/audio_processing_statistics_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_processing_statistics_gn")
diff --git third_party/libwebrtc/api/audio/builtin_audio_processing_builder_gn/moz.build third_party/libwebrtc/api/audio/builtin_audio_processing_builder_gn/moz.build
index 23730cb4c781..b3c9022f62d2 100644
--- third_party/libwebrtc/api/audio/builtin_audio_processing_builder_gn/moz.build
+++ third_party/libwebrtc/api/audio/builtin_audio_processing_builder_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("builtin_audio_processing_builder_gn")
diff --git third_party/libwebrtc/api/audio/echo_control_gn/moz.build third_party/libwebrtc/api/audio/echo_control_gn/moz.build
index 003dd55e4b8c..a7421daf3fc4 100644
--- third_party/libwebrtc/api/audio/echo_control_gn/moz.build
+++ third_party/libwebrtc/api/audio/echo_control_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("echo_control_gn")
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 6877f2e2caba..0a94c771f597 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_decoder_L16_gn")
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 107e5544da1b..44b16b46dd4b 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_encoder_L16_gn")
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 2fcb098ef1df..624eb7a63ed3 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_codecs_api_gn")
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 2dfec6bd8ace..2c87cb06e541 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
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
 DEFINES["WEBRTC_USE_BUILTIN_OPUS"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("builtin_audio_decoder_factory_gn")
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 559645de2de6..8af7c3467f2b 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
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
 DEFINES["WEBRTC_USE_BUILTIN_OPUS"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("builtin_audio_encoder_factory_gn")
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 ad147399181d..b24120ede667 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_decoder_g711_gn")
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 6433c15e39ea..e2eb177fab83 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_encoder_g711_gn")
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 e1a1d3c8e9d4..77c49f946aeb 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_decoder_g722_gn")
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 7254662163f2..3046572aba75 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_encoder_g722_config_gn")
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 7d9475c9e15e..d35fe3533ed8 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_encoder_g722_gn")
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 8d5b597b98cd..3c9f2c3b50cb 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_decoder_multiopus_gn")
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 35c1f3b1d7dc..eeb1e3e24104 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_decoder_opus_config_gn")
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 cf0f5ac728d5..21a0df0059f5 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_decoder_opus_gn")
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 2a92d825dff0..1acf41cea4cc 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_encoder_multiopus_gn")
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 72567d1deba1..9d44290fa3c8 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
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
 DEFINES["WEBRTC_OPUS_VARIABLE_COMPLEXITY"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -51,93 +60,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -145,82 +68,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_encoder_opus_config_gn")
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 c38bcbc671fc..0bff614d13c4 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_encoder_opus_gn")
diff --git third_party/libwebrtc/api/audio_codecs/opus_audio_decoder_factory_gn/moz.build third_party/libwebrtc/api/audio_codecs/opus_audio_decoder_factory_gn/moz.build
index 22027800ff54..889064300cef 100644
--- third_party/libwebrtc/api/audio_codecs/opus_audio_decoder_factory_gn/moz.build
+++ third_party/libwebrtc/api/audio_codecs/opus_audio_decoder_factory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("opus_audio_decoder_factory_gn")
diff --git third_party/libwebrtc/api/audio_options_api_gn/moz.build third_party/libwebrtc/api/audio_options_api_gn/moz.build
index c23c271b22e1..7132a5211aa1 100644
--- third_party/libwebrtc/api/audio_options_api_gn/moz.build
+++ third_party/libwebrtc/api/audio_options_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_options_api_gn")
diff --git third_party/libwebrtc/api/bitrate_allocation_gn/moz.build third_party/libwebrtc/api/bitrate_allocation_gn/moz.build
index e554b81f633f..8999ae4c13a9 100644
--- third_party/libwebrtc/api/bitrate_allocation_gn/moz.build
+++ third_party/libwebrtc/api/bitrate_allocation_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("bitrate_allocation_gn")
diff --git third_party/libwebrtc/api/call_api_gn/moz.build third_party/libwebrtc/api/call_api_gn/moz.build
index 2d2e381b8423..bd8e01b40700 100644
--- third_party/libwebrtc/api/call_api_gn/moz.build
+++ third_party/libwebrtc/api/call_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("call_api_gn")
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 803d3f1eff52..cf3f00cfd583 100644
--- third_party/libwebrtc/api/crypto/frame_decryptor_interface_gn/moz.build
+++ third_party/libwebrtc/api/crypto/frame_decryptor_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("frame_decryptor_interface_gn")
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 64ce06200fbe..a4f99ff8357a 100644
--- third_party/libwebrtc/api/crypto/frame_encryptor_interface_gn/moz.build
+++ third_party/libwebrtc/api/crypto/frame_encryptor_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("frame_encryptor_interface_gn")
diff --git third_party/libwebrtc/api/crypto/options_gn/moz.build third_party/libwebrtc/api/crypto/options_gn/moz.build
index 071165211246..77d8eb74d010 100644
--- third_party/libwebrtc/api/crypto/options_gn/moz.build
+++ third_party/libwebrtc/api/crypto/options_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("options_gn")
diff --git third_party/libwebrtc/api/environment/deprecated_global_field_trials_gn/moz.build third_party/libwebrtc/api/environment/deprecated_global_field_trials_gn/moz.build
index 95b07bc6261f..4c2ff30dab40 100644
--- third_party/libwebrtc/api/environment/deprecated_global_field_trials_gn/moz.build
+++ third_party/libwebrtc/api/environment/deprecated_global_field_trials_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("deprecated_global_field_trials_gn")
diff --git third_party/libwebrtc/api/environment/environment_factory_gn/moz.build third_party/libwebrtc/api/environment/environment_factory_gn/moz.build
index ed3d1c43a856..fdd57e9f22b3 100644
--- third_party/libwebrtc/api/environment/environment_factory_gn/moz.build
+++ third_party/libwebrtc/api/environment/environment_factory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("environment_factory_gn")
diff --git third_party/libwebrtc/api/environment/environment_gn/moz.build third_party/libwebrtc/api/environment/environment_gn/moz.build
index 623399700cb5..631f307ea954 100644
--- third_party/libwebrtc/api/environment/environment_gn/moz.build
+++ third_party/libwebrtc/api/environment/environment_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("environment_gn")
diff --git third_party/libwebrtc/api/fec_controller_api_gn/moz.build third_party/libwebrtc/api/fec_controller_api_gn/moz.build
index 26322221e75c..c2960773bae5 100644
--- third_party/libwebrtc/api/fec_controller_api_gn/moz.build
+++ third_party/libwebrtc/api/fec_controller_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("fec_controller_api_gn")
diff --git third_party/libwebrtc/api/field_trials_registry_gn/moz.build third_party/libwebrtc/api/field_trials_registry_gn/moz.build
index 834d5f8de566..382075b68488 100644
--- third_party/libwebrtc/api/field_trials_registry_gn/moz.build
+++ third_party/libwebrtc/api/field_trials_registry_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("field_trials_registry_gn")
diff --git third_party/libwebrtc/api/field_trials_view_gn/moz.build third_party/libwebrtc/api/field_trials_view_gn/moz.build
index 6b034fd3a963..59ff862b5aff 100644
--- third_party/libwebrtc/api/field_trials_view_gn/moz.build
+++ third_party/libwebrtc/api/field_trials_view_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("field_trials_view_gn")
diff --git third_party/libwebrtc/api/frame_transformer_factory_gn/moz.build third_party/libwebrtc/api/frame_transformer_factory_gn/moz.build
index e5a1b83d2822..a437cb5392b2 100644
--- third_party/libwebrtc/api/frame_transformer_factory_gn/moz.build
+++ third_party/libwebrtc/api/frame_transformer_factory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_transformer_factory_gn")
diff --git third_party/libwebrtc/api/frame_transformer_interface_gn/moz.build third_party/libwebrtc/api/frame_transformer_interface_gn/moz.build
index ba884e273d4b..b85c50f05417 100644
--- third_party/libwebrtc/api/frame_transformer_interface_gn/moz.build
+++ third_party/libwebrtc/api/frame_transformer_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_transformer_interface_gn")
diff --git third_party/libwebrtc/api/function_view_gn/moz.build third_party/libwebrtc/api/function_view_gn/moz.build
index 37e1e4a3cb61..22e59d619687 100644
--- third_party/libwebrtc/api/function_view_gn/moz.build
+++ third_party/libwebrtc/api/function_view_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("function_view_gn")
diff --git third_party/libwebrtc/api/libjingle_logging_api_gn/moz.build third_party/libwebrtc/api/libjingle_logging_api_gn/moz.build
index 031193bbf246..420fe76c9250 100644
--- third_party/libwebrtc/api/libjingle_logging_api_gn/moz.build
+++ third_party/libwebrtc/api/libjingle_logging_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("jingle_logging_api_gn")
diff --git third_party/libwebrtc/api/libjingle_peerconnection_api_gn/moz.build third_party/libwebrtc/api/libjingle_peerconnection_api_gn/moz.build
index 570cfe3e0f46..0cf698831744 100644
--- third_party/libwebrtc/api/libjingle_peerconnection_api_gn/moz.build
+++ third_party/libwebrtc/api/libjingle_peerconnection_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("jingle_peerconnection_api_gn")
diff --git third_party/libwebrtc/api/location_gn/moz.build third_party/libwebrtc/api/location_gn/moz.build
index bb48aa293591..0df5683760a9 100644
--- third_party/libwebrtc/api/location_gn/moz.build
+++ third_party/libwebrtc/api/location_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("location_gn")
diff --git third_party/libwebrtc/api/make_ref_counted_gn/moz.build third_party/libwebrtc/api/make_ref_counted_gn/moz.build
index e8c3318f0297..e255232b7c0f 100644
--- third_party/libwebrtc/api/make_ref_counted_gn/moz.build
+++ third_party/libwebrtc/api/make_ref_counted_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("make_ref_counted_gn")
diff --git third_party/libwebrtc/api/media_stream_interface_gn/moz.build third_party/libwebrtc/api/media_stream_interface_gn/moz.build
index d2036a2a6aaa..84b69c959ded 100644
--- third_party/libwebrtc/api/media_stream_interface_gn/moz.build
+++ third_party/libwebrtc/api/media_stream_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("media_stream_interface_gn")
diff --git third_party/libwebrtc/api/metronome/metronome_gn/moz.build third_party/libwebrtc/api/metronome/metronome_gn/moz.build
index 8fc12ea95fda..4dd6b378c5c6 100644
--- third_party/libwebrtc/api/metronome/metronome_gn/moz.build
+++ third_party/libwebrtc/api/metronome/metronome_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("metronome_gn")
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 72fc97e1e4d0..578be91eda8a 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("default_neteq_controller_factory_gn")
diff --git third_party/libwebrtc/api/neteq/default_neteq_factory_gn/moz.build third_party/libwebrtc/api/neteq/default_neteq_factory_gn/moz.build
index 1fac43ca8133..3822f3c47cf0 100644
--- third_party/libwebrtc/api/neteq/default_neteq_factory_gn/moz.build
+++ third_party/libwebrtc/api/neteq/default_neteq_factory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("default_neteq_factory_gn")
diff --git third_party/libwebrtc/api/neteq/delay_manager_api_gn/moz.build third_party/libwebrtc/api/neteq/delay_manager_api_gn/moz.build
index 3063e1118a14..1cef703f3744 100644
--- third_party/libwebrtc/api/neteq/delay_manager_api_gn/moz.build
+++ third_party/libwebrtc/api/neteq/delay_manager_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("delay_manager_api_gn")
diff --git third_party/libwebrtc/api/neteq/neteq_api_gn/moz.build third_party/libwebrtc/api/neteq/neteq_api_gn/moz.build
index 1afebecfa713..e6cae2901777 100644
--- third_party/libwebrtc/api/neteq/neteq_api_gn/moz.build
+++ third_party/libwebrtc/api/neteq/neteq_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("neteq_api_gn")
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 360aeb8c1888..b3725c959c68 100644
--- third_party/libwebrtc/api/neteq/neteq_controller_api_gn/moz.build
+++ third_party/libwebrtc/api/neteq/neteq_controller_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("neteq_controller_api_gn")
diff --git third_party/libwebrtc/api/neteq/tick_timer_gn/moz.build third_party/libwebrtc/api/neteq/tick_timer_gn/moz.build
index ce574f703e85..f63d71206fa2 100644
--- third_party/libwebrtc/api/neteq/tick_timer_gn/moz.build
+++ third_party/libwebrtc/api/neteq/tick_timer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("tick_timer_gn")
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 dfdf9c995949..c5307e1d122c 100644
--- third_party/libwebrtc/api/network_state_predictor_api_gn/moz.build
+++ third_party/libwebrtc/api/network_state_predictor_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("network_state_predictor_api_gn")
diff --git third_party/libwebrtc/api/priority_gn/moz.build third_party/libwebrtc/api/priority_gn/moz.build
index bf2fa1665e7e..1048dc991346 100644
--- third_party/libwebrtc/api/priority_gn/moz.build
+++ third_party/libwebrtc/api/priority_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("priority_gn")
diff --git third_party/libwebrtc/api/ref_count_gn/moz.build third_party/libwebrtc/api/ref_count_gn/moz.build
index b348930d7ec3..6e1ce2a4baad 100644
--- third_party/libwebrtc/api/ref_count_gn/moz.build
+++ third_party/libwebrtc/api/ref_count_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("ref_count_gn")
diff --git third_party/libwebrtc/api/refcountedbase_gn/moz.build third_party/libwebrtc/api/refcountedbase_gn/moz.build
index 8f218b17aea6..0d0dc0b4711b 100644
--- third_party/libwebrtc/api/refcountedbase_gn/moz.build
+++ third_party/libwebrtc/api/refcountedbase_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("refcountedbase_gn")
diff --git third_party/libwebrtc/api/rtc_error_gn/moz.build third_party/libwebrtc/api/rtc_error_gn/moz.build
index 8a09b2f6a451..4cd767026bc4 100644
--- third_party/libwebrtc/api/rtc_error_gn/moz.build
+++ third_party/libwebrtc/api/rtc_error_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_error_gn")
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 e736b4682ea0..9f5e2d9ba4a3 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_log_gn")
diff --git third_party/libwebrtc/api/rtp_headers_gn/moz.build third_party/libwebrtc/api/rtp_headers_gn/moz.build
index fb46ff525fa5..4f0061742b36 100644
--- third_party/libwebrtc/api/rtp_headers_gn/moz.build
+++ third_party/libwebrtc/api/rtp_headers_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_headers_gn")
diff --git third_party/libwebrtc/api/rtp_packet_info_gn/moz.build third_party/libwebrtc/api/rtp_packet_info_gn/moz.build
index 3a7abf97f0ae..462e922c57e9 100644
--- third_party/libwebrtc/api/rtp_packet_info_gn/moz.build
+++ third_party/libwebrtc/api/rtp_packet_info_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_packet_info_gn")
diff --git third_party/libwebrtc/api/rtp_packet_sender_gn/moz.build third_party/libwebrtc/api/rtp_packet_sender_gn/moz.build
index 7b9074f4195f..3f90e181f653 100644
--- third_party/libwebrtc/api/rtp_packet_sender_gn/moz.build
+++ third_party/libwebrtc/api/rtp_packet_sender_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtp_packet_sender_gn")
diff --git third_party/libwebrtc/api/rtp_parameters_gn/moz.build third_party/libwebrtc/api/rtp_parameters_gn/moz.build
index 4abaae2609eb..8228db31aa88 100644
--- third_party/libwebrtc/api/rtp_parameters_gn/moz.build
+++ third_party/libwebrtc/api/rtp_parameters_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,86 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -134,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_parameters_gn")
diff --git third_party/libwebrtc/api/rtp_sender_interface_gn/moz.build third_party/libwebrtc/api/rtp_sender_interface_gn/moz.build
index 4d2b9eb891c6..b14399134c2d 100644
--- third_party/libwebrtc/api/rtp_sender_interface_gn/moz.build
+++ third_party/libwebrtc/api/rtp_sender_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtp_sender_interface_gn")
diff --git third_party/libwebrtc/api/rtp_sender_setparameters_callback_gn/moz.build third_party/libwebrtc/api/rtp_sender_setparameters_callback_gn/moz.build
index 638db7eff309..361fb3659953 100644
--- third_party/libwebrtc/api/rtp_sender_setparameters_callback_gn/moz.build
+++ third_party/libwebrtc/api/rtp_sender_setparameters_callback_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_sender_setparameters_callback_gn")
diff --git third_party/libwebrtc/api/rtp_transceiver_direction_gn/moz.build third_party/libwebrtc/api/rtp_transceiver_direction_gn/moz.build
index 2ac81053797a..ad498fba2370 100644
--- third_party/libwebrtc/api/rtp_transceiver_direction_gn/moz.build
+++ third_party/libwebrtc/api/rtp_transceiver_direction_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtp_transceiver_direction_gn")
diff --git third_party/libwebrtc/api/scoped_refptr_gn/moz.build third_party/libwebrtc/api/scoped_refptr_gn/moz.build
index 538b3be29bf7..d21843a6e841 100644
--- third_party/libwebrtc/api/scoped_refptr_gn/moz.build
+++ third_party/libwebrtc/api/scoped_refptr_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("scoped_refptr_gn")
diff --git third_party/libwebrtc/api/sequence_checker_gn/moz.build third_party/libwebrtc/api/sequence_checker_gn/moz.build
index 7191593a76b3..3d6fb81819e5 100644
--- third_party/libwebrtc/api/sequence_checker_gn/moz.build
+++ third_party/libwebrtc/api/sequence_checker_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("sequence_checker_gn")
diff --git third_party/libwebrtc/api/task_queue/default_task_queue_factory_gn/moz.build third_party/libwebrtc/api/task_queue/default_task_queue_factory_gn/moz.build
index 369ff54e9cc8..6cc93ea1aeff 100644
--- third_party/libwebrtc/api/task_queue/default_task_queue_factory_gn/moz.build
+++ third_party/libwebrtc/api/task_queue/default_task_queue_factory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("default_task_queue_factory_gn")
diff --git third_party/libwebrtc/api/task_queue/pending_task_safety_flag_gn/moz.build third_party/libwebrtc/api/task_queue/pending_task_safety_flag_gn/moz.build
index 3103b41da833..04259db6efb1 100644
--- third_party/libwebrtc/api/task_queue/pending_task_safety_flag_gn/moz.build
+++ third_party/libwebrtc/api/task_queue/pending_task_safety_flag_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("pending_task_safety_flag_gn")
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 4dfef6fa6711..c94462630755 100644
--- third_party/libwebrtc/api/task_queue/task_queue_gn/moz.build
+++ third_party/libwebrtc/api/task_queue/task_queue_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("task_queue_gn")
diff --git third_party/libwebrtc/api/transport/bandwidth_estimation_settings_gn/moz.build third_party/libwebrtc/api/transport/bandwidth_estimation_settings_gn/moz.build
index b09ad121a6af..53e93cf4ca63 100644
--- third_party/libwebrtc/api/transport/bandwidth_estimation_settings_gn/moz.build
+++ third_party/libwebrtc/api/transport/bandwidth_estimation_settings_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("bandwidth_estimation_settings_gn")
diff --git third_party/libwebrtc/api/transport/bandwidth_usage_gn/moz.build third_party/libwebrtc/api/transport/bandwidth_usage_gn/moz.build
index a6b96ce34164..d6a055dc77ba 100644
--- third_party/libwebrtc/api/transport/bandwidth_usage_gn/moz.build
+++ third_party/libwebrtc/api/transport/bandwidth_usage_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("bandwidth_usage_gn")
diff --git third_party/libwebrtc/api/transport/bitrate_settings_gn/moz.build third_party/libwebrtc/api/transport/bitrate_settings_gn/moz.build
index 1f1d1c4c736a..ce48d9240524 100644
--- third_party/libwebrtc/api/transport/bitrate_settings_gn/moz.build
+++ third_party/libwebrtc/api/transport/bitrate_settings_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("bitrate_settings_gn")
diff --git third_party/libwebrtc/api/transport/datagram_transport_interface_gn/moz.build third_party/libwebrtc/api/transport/datagram_transport_interface_gn/moz.build
index cee851fd0446..b16ccce6f104 100644
--- third_party/libwebrtc/api/transport/datagram_transport_interface_gn/moz.build
+++ third_party/libwebrtc/api/transport/datagram_transport_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("datagram_transport_interface_gn")
diff --git third_party/libwebrtc/api/transport/ecn_marking_gn/moz.build third_party/libwebrtc/api/transport/ecn_marking_gn/moz.build
index d398fe8173ce..de8ef38e2bbc 100644
--- third_party/libwebrtc/api/transport/ecn_marking_gn/moz.build
+++ third_party/libwebrtc/api/transport/ecn_marking_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("ecn_marking_gn")
diff --git third_party/libwebrtc/api/transport/goog_cc_gn/moz.build third_party/libwebrtc/api/transport/goog_cc_gn/moz.build
index 0ea320c48cb1..7f4d08190fbd 100644
--- third_party/libwebrtc/api/transport/goog_cc_gn/moz.build
+++ third_party/libwebrtc/api/transport/goog_cc_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("goog_cc_gn")
diff --git third_party/libwebrtc/api/transport/network_control_gn/moz.build third_party/libwebrtc/api/transport/network_control_gn/moz.build
index 3daf12907a25..fe17cc7e3b41 100644
--- third_party/libwebrtc/api/transport/network_control_gn/moz.build
+++ third_party/libwebrtc/api/transport/network_control_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("network_control_gn")
diff --git third_party/libwebrtc/api/transport/rtp/corruption_detection_message_gn/moz.build third_party/libwebrtc/api/transport/rtp/corruption_detection_message_gn/moz.build
index ae81701a1bd9..8f83c4414424 100644
--- third_party/libwebrtc/api/transport/rtp/corruption_detection_message_gn/moz.build
+++ third_party/libwebrtc/api/transport/rtp/corruption_detection_message_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("corruption_detection_message_gn")
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 c491583efb60..d0cc148b59ed 100644
--- third_party/libwebrtc/api/transport/rtp/dependency_descriptor_gn/moz.build
+++ third_party/libwebrtc/api/transport/rtp/dependency_descriptor_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("dependency_descriptor_gn")
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 cb0e7defe522..793859a3646e 100644
--- third_party/libwebrtc/api/transport/rtp/rtp_source_gn/moz.build
+++ third_party/libwebrtc/api/transport/rtp/rtp_source_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtp_source_gn")
diff --git third_party/libwebrtc/api/transport/stun_types_gn/moz.build third_party/libwebrtc/api/transport/stun_types_gn/moz.build
index d04fea40304d..204fddb0f9fe 100644
--- third_party/libwebrtc/api/transport/stun_types_gn/moz.build
+++ third_party/libwebrtc/api/transport/stun_types_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("stun_types_gn")
diff --git third_party/libwebrtc/api/transport_api_gn/moz.build third_party/libwebrtc/api/transport_api_gn/moz.build
index 7af13124c2db..c979fda6e5bc 100644
--- third_party/libwebrtc/api/transport_api_gn/moz.build
+++ third_party/libwebrtc/api/transport_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("transport_api_gn")
diff --git third_party/libwebrtc/api/units/data_rate_gn/moz.build third_party/libwebrtc/api/units/data_rate_gn/moz.build
index 1b35b7cf5a8a..14ba2c78be54 100644
--- third_party/libwebrtc/api/units/data_rate_gn/moz.build
+++ third_party/libwebrtc/api/units/data_rate_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("data_rate_gn")
diff --git third_party/libwebrtc/api/units/data_size_gn/moz.build third_party/libwebrtc/api/units/data_size_gn/moz.build
index 6f099efeb030..ed647bda87f0 100644
--- third_party/libwebrtc/api/units/data_size_gn/moz.build
+++ third_party/libwebrtc/api/units/data_size_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("data_size_gn")
diff --git third_party/libwebrtc/api/units/frequency_gn/moz.build third_party/libwebrtc/api/units/frequency_gn/moz.build
index deea0df50db3..d23c1b6e2035 100644
--- third_party/libwebrtc/api/units/frequency_gn/moz.build
+++ third_party/libwebrtc/api/units/frequency_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frequency_gn")
diff --git third_party/libwebrtc/api/units/time_delta_gn/moz.build third_party/libwebrtc/api/units/time_delta_gn/moz.build
index 33ad19538d59..59b23badc5ef 100644
--- third_party/libwebrtc/api/units/time_delta_gn/moz.build
+++ third_party/libwebrtc/api/units/time_delta_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("time_delta_gn")
diff --git third_party/libwebrtc/api/units/timestamp_gn/moz.build third_party/libwebrtc/api/units/timestamp_gn/moz.build
index 5f80d61516fd..73a877084b26 100644
--- third_party/libwebrtc/api/units/timestamp_gn/moz.build
+++ third_party/libwebrtc/api/units/timestamp_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("timestamp_gn")
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 5eb24e52173a..bae12fef07bf 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("builtin_video_bitrate_allocator_factory_gn")
diff --git third_party/libwebrtc/api/video/corruption_detection/filter_settings_gn/moz.build third_party/libwebrtc/api/video/corruption_detection/filter_settings_gn/moz.build
index e38f35fd89c4..7f0f4946ad7c 100644
--- third_party/libwebrtc/api/video/corruption_detection/filter_settings_gn/moz.build
+++ third_party/libwebrtc/api/video/corruption_detection/filter_settings_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("filter_settings_gn")
diff --git third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_data_gn/moz.build third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_data_gn/moz.build
index 784b4ebfa65a..5fd5f86f273b 100644
--- third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_data_gn/moz.build
+++ third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_data_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_instrumentation_data_gn")
diff --git third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_data_reader_gn/moz.build third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_data_reader_gn/moz.build
index f50de2a3968f..aac961573d3a 100644
--- third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_data_reader_gn/moz.build
+++ third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_data_reader_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_instrumentation_data_reader_gn")
diff --git third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_evaluation_gn/moz.build third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_evaluation_gn/moz.build
index 259f7cf19bd8..8e982b933563 100644
--- third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_evaluation_gn/moz.build
+++ third_party/libwebrtc/api/video/corruption_detection/frame_instrumentation_evaluation_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_instrumentation_evaluation_gn")
diff --git third_party/libwebrtc/api/video/encoded_frame_gn/moz.build third_party/libwebrtc/api/video/encoded_frame_gn/moz.build
index f43d0c641ef3..d2b102c61127 100644
--- third_party/libwebrtc/api/video/encoded_frame_gn/moz.build
+++ third_party/libwebrtc/api/video/encoded_frame_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("encoded_frame_gn")
diff --git third_party/libwebrtc/api/video/encoded_image_gn/moz.build third_party/libwebrtc/api/video/encoded_image_gn/moz.build
index 858df454d82a..85fa5f6f2ae1 100644
--- third_party/libwebrtc/api/video/encoded_image_gn/moz.build
+++ third_party/libwebrtc/api/video/encoded_image_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("encoded_image_gn")
diff --git third_party/libwebrtc/api/video/frame_buffer_gn/moz.build third_party/libwebrtc/api/video/frame_buffer_gn/moz.build
index 0e97349cfc77..068e9983902f 100644
--- third_party/libwebrtc/api/video/frame_buffer_gn/moz.build
+++ third_party/libwebrtc/api/video/frame_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_buffer_gn")
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 dbe54e47fb98..9b136ac42704 100644
--- third_party/libwebrtc/api/video/recordable_encoded_frame_gn/moz.build
+++ third_party/libwebrtc/api/video/recordable_encoded_frame_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("recordable_encoded_frame_gn")
diff --git third_party/libwebrtc/api/video/render_resolution_gn/moz.build third_party/libwebrtc/api/video/render_resolution_gn/moz.build
index 84f9a2b2c68a..d15140c641c2 100644
--- third_party/libwebrtc/api/video/render_resolution_gn/moz.build
+++ third_party/libwebrtc/api/video/render_resolution_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("render_resolution_gn")
diff --git third_party/libwebrtc/api/video/resolution_gn/moz.build third_party/libwebrtc/api/video/resolution_gn/moz.build
index 4a33d1cb0e9e..4080a7a25dd3 100644
--- third_party/libwebrtc/api/video/resolution_gn/moz.build
+++ third_party/libwebrtc/api/video/resolution_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("resolution_gn")
diff --git third_party/libwebrtc/api/video/video_adaptation_gn/moz.build third_party/libwebrtc/api/video/video_adaptation_gn/moz.build
index 6c2807380aff..ad2ccb022fdc 100644
--- third_party/libwebrtc/api/video/video_adaptation_gn/moz.build
+++ third_party/libwebrtc/api/video/video_adaptation_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_adaptation_gn")
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 a18df7dbd8f7..6343a67de50e 100644
--- third_party/libwebrtc/api/video/video_bitrate_allocation_gn/moz.build
+++ third_party/libwebrtc/api/video/video_bitrate_allocation_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_bitrate_allocation_gn")
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 5091c53d089e..a62643cf926a 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_bitrate_allocator_factory_gn")
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 37a5eb0ed8c2..175739fe4569 100644
--- third_party/libwebrtc/api/video/video_bitrate_allocator_gn/moz.build
+++ third_party/libwebrtc/api/video/video_bitrate_allocator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_bitrate_allocator_gn")
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 258360394b9b..0b37739d6af2 100644
--- third_party/libwebrtc/api/video/video_codec_constants_gn/moz.build
+++ third_party/libwebrtc/api/video/video_codec_constants_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_codec_constants_gn")
diff --git third_party/libwebrtc/api/video/video_frame_gn/moz.build third_party/libwebrtc/api/video/video_frame_gn/moz.build
index 002adff7180e..22b486c49f35 100644
--- third_party/libwebrtc/api/video/video_frame_gn/moz.build
+++ third_party/libwebrtc/api/video/video_frame_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -57,93 +66,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -151,82 +74,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_frame_gn")
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 95be4b1cae96..99647b85c184 100644
--- third_party/libwebrtc/api/video/video_frame_i010_gn/moz.build
+++ third_party/libwebrtc/api/video/video_frame_i010_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -53,93 +62,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -147,82 +70,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_frame_i010_gn")
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 874879d32abc..a472607df4b9 100644
--- third_party/libwebrtc/api/video/video_frame_metadata_gn/moz.build
+++ third_party/libwebrtc/api/video/video_frame_metadata_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_frame_metadata_gn")
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 5c47765d9f2f..e05d85a65fe4 100644
--- third_party/libwebrtc/api/video/video_frame_type_gn/moz.build
+++ third_party/libwebrtc/api/video/video_frame_type_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_frame_type_gn")
diff --git third_party/libwebrtc/api/video/video_layers_allocation_gn/moz.build third_party/libwebrtc/api/video/video_layers_allocation_gn/moz.build
index 5628699424f6..23d72244a799 100644
--- third_party/libwebrtc/api/video/video_layers_allocation_gn/moz.build
+++ third_party/libwebrtc/api/video/video_layers_allocation_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_layers_allocation_gn")
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 99588de22230..e3d29e8670c4 100644
--- third_party/libwebrtc/api/video/video_rtp_headers_gn/moz.build
+++ third_party/libwebrtc/api/video/video_rtp_headers_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_rtp_headers_gn")
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 23e709e46e9c..4df907e99963 100644
--- third_party/libwebrtc/api/video/video_stream_encoder_gn/moz.build
+++ third_party/libwebrtc/api/video/video_stream_encoder_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_stream_encoder_gn")
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 6e26714bac12..b20f7bf51dff 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("bitstream_parser_api_gn")
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 67ef507d3097..7c7190358344 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("builtin_video_decoder_factory_gn")
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 86d649512c50..b757e05614e6 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,94 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_software_fallback_wrappers_gn")
diff --git third_party/libwebrtc/api/video_codecs/scalability_mode_gn/moz.build third_party/libwebrtc/api/video_codecs/scalability_mode_gn/moz.build
index a6663bb723e5..d08276393a91 100644
--- third_party/libwebrtc/api/video_codecs/scalability_mode_gn/moz.build
+++ third_party/libwebrtc/api/video_codecs/scalability_mode_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("scalability_mode_gn")
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 32e58da25377..fb69cedb88b3 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -56,93 +65,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -150,82 +73,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_codecs_api_gn")
diff --git third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_gn/moz.build third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_gn/moz.build
index 4ace541c8629..1ba39e749117 100644
--- third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_gn/moz.build
+++ third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_encoder_factory_template_gn")
diff --git third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libaom_av1_adapter_gn/moz.build third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libaom_av1_adapter_gn/moz.build
index 2a97afcba467..cc35215f7f73 100644
--- third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libaom_av1_adapter_gn/moz.build
+++ third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libaom_av1_adapter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_encoder_factory_template_libaom_av1_adapter_gn")
diff --git third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libvpx_vp8_adapter_gn/moz.build third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libvpx_vp8_adapter_gn/moz.build
index 0ed909d22eaa..30b36e992434 100644
--- third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libvpx_vp8_adapter_gn/moz.build
+++ third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libvpx_vp8_adapter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_encoder_factory_template_libvpx_vp8_adapter_gn")
diff --git third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libvpx_vp9_adapter_gn/moz.build third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libvpx_vp9_adapter_gn/moz.build
index 35016b696d1f..c7733ec4e5b5 100644
--- third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libvpx_vp9_adapter_gn/moz.build
+++ third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_libvpx_vp9_adapter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_encoder_factory_template_libvpx_vp9_adapter_gn")
diff --git third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_open_h264_adapter_gn/moz.build third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_open_h264_adapter_gn/moz.build
index d6781fc429cb..e8a512374002 100644
--- third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_open_h264_adapter_gn/moz.build
+++ third_party/libwebrtc/api/video_codecs/video_encoder_factory_template_open_h264_adapter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_encoder_factory_template_open_h264_adapter_gn")
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 0da2c0072645..528d6c674073 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("vp8_temporal_layers_factory_gn")
diff --git third_party/libwebrtc/api/video_track_source_constraints_gn/moz.build third_party/libwebrtc/api/video_track_source_constraints_gn/moz.build
index eff44f748eb9..999796fa561f 100644
--- third_party/libwebrtc/api/video_track_source_constraints_gn/moz.build
+++ third_party/libwebrtc/api/video_track_source_constraints_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_track_source_constraints_gn")
diff --git third_party/libwebrtc/audio/audio_gn/moz.build third_party/libwebrtc/audio/audio_gn/moz.build
index 61c208cfe98b..2668ec4480d4 100644
--- third_party/libwebrtc/audio/audio_gn/moz.build
+++ third_party/libwebrtc/audio/audio_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -58,94 +67,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -153,82 +75,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_gn")
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 00a2557568ab..d2a840371942 100644
--- third_party/libwebrtc/audio/utility/audio_frame_operations_gn/moz.build
+++ third_party/libwebrtc/audio/utility/audio_frame_operations_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,93 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_frame_operations_gn")
diff --git third_party/libwebrtc/call/adaptation/resource_adaptation_gn/moz.build third_party/libwebrtc/call/adaptation/resource_adaptation_gn/moz.build
index 9c873a9f4383..97a9005397cf 100644
--- third_party/libwebrtc/call/adaptation/resource_adaptation_gn/moz.build
+++ third_party/libwebrtc/call/adaptation/resource_adaptation_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -55,93 +64,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -149,82 +72,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("resource_adaptation_gn")
diff --git third_party/libwebrtc/call/audio_sender_interface_gn/moz.build third_party/libwebrtc/call/audio_sender_interface_gn/moz.build
index 0fdbdec46999..38a38464659a 100644
--- third_party/libwebrtc/call/audio_sender_interface_gn/moz.build
+++ third_party/libwebrtc/call/audio_sender_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_sender_interface_gn")
diff --git third_party/libwebrtc/call/bitrate_allocator_gn/moz.build third_party/libwebrtc/call/bitrate_allocator_gn/moz.build
index 7b8696b587d4..10a5020edb33 100644
--- third_party/libwebrtc/call/bitrate_allocator_gn/moz.build
+++ third_party/libwebrtc/call/bitrate_allocator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("bitrate_allocator_gn")
diff --git third_party/libwebrtc/call/bitrate_configurator_gn/moz.build third_party/libwebrtc/call/bitrate_configurator_gn/moz.build
index cd5491bdefec..25c0b6e740f9 100644
--- third_party/libwebrtc/call/bitrate_configurator_gn/moz.build
+++ third_party/libwebrtc/call/bitrate_configurator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("bitrate_configurator_gn")
diff --git third_party/libwebrtc/call/call_gn/moz.build third_party/libwebrtc/call/call_gn/moz.build
index 4b923766e44a..72c3383fd96e 100644
--- third_party/libwebrtc/call/call_gn/moz.build
+++ third_party/libwebrtc/call/call_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,94 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("call_gn")
diff --git third_party/libwebrtc/call/call_interfaces_gn/moz.build third_party/libwebrtc/call/call_interfaces_gn/moz.build
index 2b39c60732c3..e60a38eeef33 100644
--- third_party/libwebrtc/call/call_interfaces_gn/moz.build
+++ third_party/libwebrtc/call/call_interfaces_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -51,94 +60,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -146,82 +68,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("call_interfaces_gn")
diff --git third_party/libwebrtc/call/payload_type_gn/moz.build third_party/libwebrtc/call/payload_type_gn/moz.build
index b92feaad097c..a2eb5b7adca2 100644
--- third_party/libwebrtc/call/payload_type_gn/moz.build
+++ third_party/libwebrtc/call/payload_type_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("payload_type_gn")
diff --git third_party/libwebrtc/call/payload_type_picker_gn/moz.build third_party/libwebrtc/call/payload_type_picker_gn/moz.build
index 71a4ce74fdb0..1efa64dbafa5 100644
--- third_party/libwebrtc/call/payload_type_picker_gn/moz.build
+++ third_party/libwebrtc/call/payload_type_picker_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("payload_type_picker_gn")
diff --git third_party/libwebrtc/call/receive_stream_interface_gn/moz.build third_party/libwebrtc/call/receive_stream_interface_gn/moz.build
index bb48e450e2a4..318dff45f0f9 100644
--- third_party/libwebrtc/call/receive_stream_interface_gn/moz.build
+++ third_party/libwebrtc/call/receive_stream_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("receive_stream_interface_gn")
diff --git third_party/libwebrtc/call/rtp_interfaces_gn/moz.build third_party/libwebrtc/call/rtp_interfaces_gn/moz.build
index bfeb90e9822d..d9502b3458ce 100644
--- third_party/libwebrtc/call/rtp_interfaces_gn/moz.build
+++ third_party/libwebrtc/call/rtp_interfaces_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_interfaces_gn")
diff --git third_party/libwebrtc/call/rtp_receiver_gn/moz.build third_party/libwebrtc/call/rtp_receiver_gn/moz.build
index 53e5ed96c15c..91f237e7a432 100644
--- third_party/libwebrtc/call/rtp_receiver_gn/moz.build
+++ third_party/libwebrtc/call/rtp_receiver_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,94 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_receiver_gn")
diff --git third_party/libwebrtc/call/rtp_sender_gn/moz.build third_party/libwebrtc/call/rtp_sender_gn/moz.build
index 3c344e2a71f3..34f4eee93bb4 100644
--- third_party/libwebrtc/call/rtp_sender_gn/moz.build
+++ third_party/libwebrtc/call/rtp_sender_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,94 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_sender_gn")
diff --git third_party/libwebrtc/call/version_gn/moz.build third_party/libwebrtc/call/version_gn/moz.build
index e1d6a6a1229c..6ad8a263227e 100644
--- third_party/libwebrtc/call/version_gn/moz.build
+++ third_party/libwebrtc/call/version_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("version_gn")
diff --git third_party/libwebrtc/call/video_receive_stream_api_gn/moz.build third_party/libwebrtc/call/video_receive_stream_api_gn/moz.build
index 201cca266c32..00e509a7b4aa 100644
--- third_party/libwebrtc/call/video_receive_stream_api_gn/moz.build
+++ third_party/libwebrtc/call/video_receive_stream_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_receive_stream_api_gn")
diff --git third_party/libwebrtc/call/video_send_stream_api_gn/moz.build third_party/libwebrtc/call/video_send_stream_api_gn/moz.build
index 6d75d15802d5..f750e52c2b20 100644
--- third_party/libwebrtc/call/video_send_stream_api_gn/moz.build
+++ third_party/libwebrtc/call/video_send_stream_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_send_stream_api_gn")
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 3588afcceba4..efee4c684b12 100644
--- third_party/libwebrtc/common_audio/common_audio_avx2_gn/moz.build
+++ third_party/libwebrtc/common_audio/common_audio_avx2_gn/moz.build
@@ -18,13 +18,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_AVX2"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -53,122 +62,9 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
     DEFINES["_DEBUG"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CXXFLAGS += [
         "-msse2"
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 a72dea0e692c..d0d04f598860 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,30 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-    SOURCES += [
-        "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse_arm.S",
-        "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12_armv7.S"
-    ]
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -158,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("common_audio_c_arm_asm_gn")
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 d75aa3581510..85f93bbcaadf 100644
--- third_party/libwebrtc/common_audio/common_audio_c_gn/moz.build
+++ third_party/libwebrtc/common_audio/common_audio_c_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -83,108 +92,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/signal_processing/complex_fft.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = 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/complex_fft.c",
-        "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = 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/complex_fft.c",
-        "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c",
-        "/third_party/libwebrtc/common_audio/signal_processing/complex_fft.c",
-        "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -192,20 +100,14 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
+    UNIFIED_SOURCES += [
+        "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c",
+        "/third_party/libwebrtc/common_audio/signal_processing/complex_fft.c",
+        "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c"
     ]
 
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
 if CONFIG["TARGET_CPU"] == "loongarch64":
 
-    DEFINES["_GNU_SOURCE"] = True
-
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c",
         "/third_party/libwebrtc/common_audio/signal_processing/complex_fft.c",
@@ -216,7 +118,6 @@ if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     SOURCES += [
         "/third_party/libwebrtc/common_audio/signal_processing/resample_by_2_mips.c"
@@ -233,8 +134,6 @@ if CONFIG["TARGET_CPU"] == "mips32":
 
 if CONFIG["TARGET_CPU"] == "mips64":
 
-    DEFINES["_GNU_SOURCE"] = True
-
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c",
         "/third_party/libwebrtc/common_audio/signal_processing/complex_fft.c",
@@ -249,78 +148,7 @@ if CONFIG["TARGET_CPU"] == "ppc64":
         "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c"
     ]
 
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    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"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-    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"] == "Android" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    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" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c",
-        "/third_party/libwebrtc/common_audio/signal_processing/complex_fft.c",
-        "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/signal_processing/complex_fft.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "riscv64":
+if CONFIG["TARGET_CPU"] == "riscv64":
 
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c",
@@ -328,13 +156,13 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "riscv64":
         "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c",
@@ -342,9 +170,9 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
         "/third_party/libwebrtc/common_audio/signal_processing/filter_ar_fast_q12.c"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/signal_processing/complex_bit_reverse.c",
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 47e1bb77f92a..5b67907b2df6 100644
--- third_party/libwebrtc/common_audio/common_audio_cc_gn/moz.build
+++ third_party/libwebrtc/common_audio/common_audio_cc_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("common_audio_cc_gn")
diff --git third_party/libwebrtc/common_audio/common_audio_gn/moz.build third_party/libwebrtc/common_audio/common_audio_gn/moz.build
index 4b2f40786f1b..9649eb186b74 100644
--- third_party/libwebrtc/common_audio/common_audio_gn/moz.build
+++ third_party/libwebrtc/common_audio/common_audio_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -59,93 +68,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -153,82 +76,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("common_audio_gn")
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 1c183693402d..52efab61eed2 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
@@ -13,13 +13,24 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_ARCH_ARM64"] = True
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_HAS_NEON"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__ARM_NEON__"] = "1"
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,131 +60,6 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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["__ARM_NEON__"] = "1"
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-    DEFINES["__STD_C"] = True
-
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
     DEFINES["_DEBUG"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
 Library("common_audio_neon_c_gn")
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 9c94e51dfd8f..b3d1eae8da85 100644
--- third_party/libwebrtc/common_audio/common_audio_neon_gn/moz.build
+++ third_party/libwebrtc/common_audio/common_audio_neon_gn/moz.build
@@ -13,13 +13,24 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_ARCH_ARM64"] = True
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_HAS_NEON"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__ARM_NEON__"] = "1"
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,138 +59,6 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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["__ARM_NEON__"] = "1"
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
-
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
     DEFINES["_DEBUG"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
 Library("common_audio_neon_gn")
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 8ce96ca06673..6703ddb08c0e 100644
--- third_party/libwebrtc/common_audio/common_audio_sse2_gn/moz.build
+++ third_party/libwebrtc/common_audio/common_audio_sse2_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_AVX2"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,144 +57,16 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
     DEFINES["_DEBUG"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2",
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CXXFLAGS += [
         "-msse2",
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
     CXXFLAGS += [
         "-msse2"
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 accaf02cc53f..9c4b7ce7e534 100644
--- third_party/libwebrtc/common_audio/fir_filter_factory_gn/moz.build
+++ third_party/libwebrtc/common_audio/fir_filter_factory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("fir_filter_factory_gn")
diff --git third_party/libwebrtc/common_audio/fir_filter_gn/moz.build third_party/libwebrtc/common_audio/fir_filter_gn/moz.build
index 785075282cd4..5e006e643f40 100644
--- third_party/libwebrtc/common_audio/fir_filter_gn/moz.build
+++ third_party/libwebrtc/common_audio/fir_filter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("fir_filter_gn")
diff --git third_party/libwebrtc/common_audio/sinc_resampler_gn/moz.build third_party/libwebrtc/common_audio/sinc_resampler_gn/moz.build
index 15e2cd1c8e4d..31ec751b206c 100644
--- third_party/libwebrtc/common_audio/sinc_resampler_gn/moz.build
+++ third_party/libwebrtc/common_audio/sinc_resampler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("sinc_resampler_gn")
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 cab1d4bdd6df..aa3b4773526a 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -144,122 +67,38 @@ if CONFIG["TARGET_CPU"] == "aarch64":
         "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_neon.cc"
     ]
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_neon.cc"
-    ]
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_mips.cc"
     ]
 
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc"
-    ]
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc"
-    ]
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2",
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-    CXXFLAGS += [
-        "-msse2",
-        "-msse2"
+    UNIFIED_SOURCES += [
+        "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD" and CONFIG["TARGET_CPU"] == "x86_64":
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-    CXXFLAGS += [
-        "-msse2"
+    UNIFIED_SOURCES += [
+        "/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc"
     ]
 
 Library("fft_size_128_gn")
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 913e7fa3a754..4018659e1055 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("fft_size_256_gn")
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 6045726afc80..969d9eb06c39 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = 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"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = 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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,20 +59,12 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-    SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S"
+    UNIFIED_SOURCES += [
+        "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
     ]
 
 if CONFIG["TARGET_CPU"] == "loongarch64":
 
-    DEFINES["_GNU_SOURCE"] = True
-
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
     ]
@@ -159,7 +73,6 @@ if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_mips.c"
@@ -167,8 +80,6 @@ if CONFIG["TARGET_CPU"] == "mips32":
 
 if CONFIG["TARGET_CPU"] == "mips64":
 
-    DEFINES["_GNU_SOURCE"] = True
-
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
     ]
@@ -179,89 +90,27 @@ if CONFIG["TARGET_CPU"] == "ppc64":
         "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
     ]
 
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
+if CONFIG["TARGET_CPU"] == "riscv64":
 
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
     ]
 
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "riscv64":
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
     UNIFIED_SOURCES += [
         "/third_party/libwebrtc/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c"
diff --git third_party/libwebrtc/common_video/common_video_gn/moz.build third_party/libwebrtc/common_video/common_video_gn/moz.build
index 29f0179f0773..4ee8b246ab59 100644
--- third_party/libwebrtc/common_video/common_video_gn/moz.build
+++ third_party/libwebrtc/common_video/common_video_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -58,93 +67,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -152,82 +75,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("common_video_gn")
diff --git third_party/libwebrtc/common_video/corruption_score_calculator_gn/moz.build third_party/libwebrtc/common_video/corruption_score_calculator_gn/moz.build
index d6dca2520c59..530a94e8643b 100644
--- third_party/libwebrtc/common_video/corruption_score_calculator_gn/moz.build
+++ third_party/libwebrtc/common_video/corruption_score_calculator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("corruption_score_calculator_gn")
diff --git third_party/libwebrtc/common_video/frame_counts_gn/moz.build third_party/libwebrtc/common_video/frame_counts_gn/moz.build
index 4d4150d00c2a..7242f0d8a3ae 100644
--- third_party/libwebrtc/common_video/frame_counts_gn/moz.build
+++ third_party/libwebrtc/common_video/frame_counts_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("frame_counts_gn")
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 8a8df2cad0f0..940b58e66a82 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("generic_frame_descriptor_gn")
diff --git third_party/libwebrtc/dcsctp_gn/moz.build third_party/libwebrtc/dcsctp_gn/moz.build
index e36ba8e99307..d5c1d389564b 100644
--- third_party/libwebrtc/dcsctp_gn/moz.build
+++ third_party/libwebrtc/dcsctp_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("dcsctp_gn")
diff --git third_party/libwebrtc/experiments/registered_field_trials_gn/moz.build third_party/libwebrtc/experiments/registered_field_trials_gn/moz.build
index c01a31a5b7da..164662ca337c 100644
--- third_party/libwebrtc/experiments/registered_field_trials_gn/moz.build
+++ third_party/libwebrtc/experiments/registered_field_trials_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("registered_field_trials_gn")
diff --git third_party/libwebrtc/experiments/registered_field_trials_header_gn/moz.build third_party/libwebrtc/experiments/registered_field_trials_header_gn/moz.build
index edb8e084a33a..e2236e78c4a0 100644
--- third_party/libwebrtc/experiments/registered_field_trials_header_gn/moz.build
+++ third_party/libwebrtc/experiments/registered_field_trials_header_gn/moz.build
@@ -32,9 +32,4 @@ LOCAL_INCLUDES += [
     "/tools/profiler/public"
 ]
 
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["UNICODE"] = True
-    DEFINES["_UNICODE"] = True
-
 Library("registered_field_trials_header_gn")
diff --git third_party/libwebrtc/logging/rtc_event_audio_gn/moz.build third_party/libwebrtc/logging/rtc_event_audio_gn/moz.build
index 158436eafa45..251655a1a226 100644
--- third_party/libwebrtc/logging/rtc_event_audio_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_event_audio_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -50,93 +59,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -144,82 +67,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_audio_gn")
diff --git third_party/libwebrtc/logging/rtc_event_bwe_gn/moz.build third_party/libwebrtc/logging/rtc_event_bwe_gn/moz.build
index 1ac713b1e2a5..552eb9cf4167 100644
--- third_party/libwebrtc/logging/rtc_event_bwe_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_event_bwe_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -51,93 +60,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -145,82 +68,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_bwe_gn")
diff --git third_party/libwebrtc/logging/rtc_event_field_gn/moz.build third_party/libwebrtc/logging/rtc_event_field_gn/moz.build
index c1305a84a6cc..3087fdcc327a 100644
--- third_party/libwebrtc/logging/rtc_event_field_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_event_field_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_field_gn")
diff --git third_party/libwebrtc/logging/rtc_event_log_parse_status_gn/moz.build third_party/libwebrtc/logging/rtc_event_log_parse_status_gn/moz.build
index 81e5642488fb..27983ddaa07f 100644
--- third_party/libwebrtc/logging/rtc_event_log_parse_status_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_event_log_parse_status_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtc_event_log_parse_status_gn")
diff --git third_party/libwebrtc/logging/rtc_event_number_encodings_gn/moz.build third_party/libwebrtc/logging/rtc_event_number_encodings_gn/moz.build
index 68c681097dd3..f050b1ed6acd 100644
--- third_party/libwebrtc/logging/rtc_event_number_encodings_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_event_number_encodings_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,86 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -135,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_number_encodings_gn")
diff --git third_party/libwebrtc/logging/rtc_event_pacing_gn/moz.build third_party/libwebrtc/logging/rtc_event_pacing_gn/moz.build
index 8e54172d3ffc..15705b114eb9 100644
--- third_party/libwebrtc/logging/rtc_event_pacing_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_event_pacing_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_pacing_gn")
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 3e27015753fd..7a52b559595d 100644
--- third_party/libwebrtc/logging/rtc_event_rtp_rtcp_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_event_rtp_rtcp_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_rtp_rtcp_gn")
diff --git third_party/libwebrtc/logging/rtc_event_video_gn/moz.build third_party/libwebrtc/logging/rtc_event_video_gn/moz.build
index 79fa2f18c369..42638e9c1a58 100644
--- third_party/libwebrtc/logging/rtc_event_video_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_event_video_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_video_gn")
diff --git third_party/libwebrtc/logging/rtc_stream_config_gn/moz.build third_party/libwebrtc/logging/rtc_stream_config_gn/moz.build
index 4567caafbe26..2017f2c23000 100644
--- third_party/libwebrtc/logging/rtc_stream_config_gn/moz.build
+++ third_party/libwebrtc/logging/rtc_stream_config_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_stream_config_gn")
diff --git third_party/libwebrtc/media/adapted_video_track_source_gn/moz.build third_party/libwebrtc/media/adapted_video_track_source_gn/moz.build
index 170ceb38ea18..ff3ef7c10365 100644
--- third_party/libwebrtc/media/adapted_video_track_source_gn/moz.build
+++ third_party/libwebrtc/media/adapted_video_track_source_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("adapted_video_track_source_gn")
diff --git third_party/libwebrtc/media/audio_source_gn/moz.build third_party/libwebrtc/media/audio_source_gn/moz.build
index f1168831de90..5fd47ccaeddd 100644
--- third_party/libwebrtc/media/audio_source_gn/moz.build
+++ third_party/libwebrtc/media/audio_source_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_source_gn")
diff --git third_party/libwebrtc/media/codec_gn/moz.build third_party/libwebrtc/media/codec_gn/moz.build
index 4dbfaebba1b4..ac11b1371193 100644
--- third_party/libwebrtc/media/codec_gn/moz.build
+++ third_party/libwebrtc/media/codec_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("codec_gn")
diff --git third_party/libwebrtc/media/media_channel_gn/moz.build third_party/libwebrtc/media/media_channel_gn/moz.build
index 0848daf93ca9..6dab893e0066 100644
--- third_party/libwebrtc/media/media_channel_gn/moz.build
+++ third_party/libwebrtc/media/media_channel_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("media_channel_gn")
diff --git third_party/libwebrtc/media/media_channel_impl_gn/moz.build third_party/libwebrtc/media/media_channel_impl_gn/moz.build
index e758c604f5f3..a59748d1b38c 100644
--- third_party/libwebrtc/media/media_channel_impl_gn/moz.build
+++ third_party/libwebrtc/media/media_channel_impl_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("media_channel_impl_gn")
diff --git third_party/libwebrtc/media/media_constants_gn/moz.build third_party/libwebrtc/media/media_constants_gn/moz.build
index 95445fbdf6e8..68728dd78931 100644
--- third_party/libwebrtc/media/media_constants_gn/moz.build
+++ third_party/libwebrtc/media/media_constants_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("media_constants_gn")
diff --git third_party/libwebrtc/media/media_engine_gn/moz.build third_party/libwebrtc/media/media_engine_gn/moz.build
index cf139814ceb9..eaff43e12948 100644
--- third_party/libwebrtc/media/media_engine_gn/moz.build
+++ third_party/libwebrtc/media/media_engine_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("media_engine_gn")
diff --git third_party/libwebrtc/media/rid_description_gn/moz.build third_party/libwebrtc/media/rid_description_gn/moz.build
index 0989e698875d..2e232c6ada46 100644
--- third_party/libwebrtc/media/rid_description_gn/moz.build
+++ third_party/libwebrtc/media/rid_description_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rid_description_gn")
diff --git third_party/libwebrtc/media/rtc_audio_video_gn/moz.build third_party/libwebrtc/media/rtc_audio_video_gn/moz.build
index 72d03172392a..235284ab4f03 100644
--- third_party/libwebrtc/media/rtc_audio_video_gn/moz.build
+++ third_party/libwebrtc/media/rtc_audio_video_gn/moz.build
@@ -14,12 +14,21 @@ DEFINES["HAVE_WEBRTC_VIDEO"] = True
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,98 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "ole32",
-        "oleaut32",
-        "secur32",
-        "strmiids",
-        "user32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -147,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_audio_video_gn")
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 f72d9c49f1de..7254f017e2f2 100644
--- third_party/libwebrtc/media/rtc_internal_video_codecs_gn/moz.build
+++ third_party/libwebrtc/media/rtc_internal_video_codecs_gn/moz.build
@@ -14,12 +14,21 @@ DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
 DEFINES["RTC_USE_LIBAOM_AV1_ENCODER"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,94 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_internal_video_codecs_gn")
diff --git third_party/libwebrtc/media/rtc_media_base_gn/moz.build third_party/libwebrtc/media/rtc_media_base_gn/moz.build
index f465cb96722d..7110338b2381 100644
--- third_party/libwebrtc/media/rtc_media_base_gn/moz.build
+++ third_party/libwebrtc/media/rtc_media_base_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtc_media_base_gn")
diff --git third_party/libwebrtc/media/rtc_media_config_gn/moz.build third_party/libwebrtc/media/rtc_media_config_gn/moz.build
index ea8062a2e446..7b25a9566dbe 100644
--- third_party/libwebrtc/media/rtc_media_config_gn/moz.build
+++ third_party/libwebrtc/media/rtc_media_config_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtc_media_config_gn")
diff --git third_party/libwebrtc/media/rtc_media_gn/moz.build third_party/libwebrtc/media/rtc_media_gn/moz.build
index 0feaa31871e0..d506d7e4b811 100644
--- third_party/libwebrtc/media/rtc_media_gn/moz.build
+++ third_party/libwebrtc/media/rtc_media_gn/moz.build
@@ -14,12 +14,21 @@ DEFINES["HAVE_WEBRTC_VIDEO"] = True
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -43,98 +52,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "ole32",
-        "oleaut32",
-        "secur32",
-        "strmiids",
-        "user32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,25 +60,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -170,40 +73,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtc_media_gn")
diff --git third_party/libwebrtc/media/rtc_sdp_video_format_utils_gn/moz.build third_party/libwebrtc/media/rtc_sdp_video_format_utils_gn/moz.build
index a1618fa38d5e..9969fddbb391 100644
--- third_party/libwebrtc/media/rtc_sdp_video_format_utils_gn/moz.build
+++ third_party/libwebrtc/media/rtc_sdp_video_format_utils_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_sdp_video_format_utils_gn")
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 077f256b7ae4..1fce89407712 100644
--- third_party/libwebrtc/media/rtc_simulcast_encoder_adapter_gn/moz.build
+++ third_party/libwebrtc/media/rtc_simulcast_encoder_adapter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_simulcast_encoder_adapter_gn")
diff --git third_party/libwebrtc/media/rtp_utils_gn/moz.build third_party/libwebrtc/media/rtp_utils_gn/moz.build
index 718787db4fdc..148d2e911e47 100644
--- third_party/libwebrtc/media/rtp_utils_gn/moz.build
+++ third_party/libwebrtc/media/rtp_utils_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtp_utils_gn")
diff --git third_party/libwebrtc/media/stream_params_gn/moz.build third_party/libwebrtc/media/stream_params_gn/moz.build
index 54aeb0b59974..af579ccfc539 100644
--- third_party/libwebrtc/media/stream_params_gn/moz.build
+++ third_party/libwebrtc/media/stream_params_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("stream_params_gn")
diff --git third_party/libwebrtc/media/video_adapter_gn/moz.build third_party/libwebrtc/media/video_adapter_gn/moz.build
index b69a51a5983d..ededc9780d49 100644
--- third_party/libwebrtc/media/video_adapter_gn/moz.build
+++ third_party/libwebrtc/media/video_adapter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_adapter_gn")
diff --git third_party/libwebrtc/media/video_broadcaster_gn/moz.build third_party/libwebrtc/media/video_broadcaster_gn/moz.build
index f615256ba4ed..c1f7fc585462 100644
--- third_party/libwebrtc/media/video_broadcaster_gn/moz.build
+++ third_party/libwebrtc/media/video_broadcaster_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_broadcaster_gn")
diff --git third_party/libwebrtc/media/video_common_gn/moz.build third_party/libwebrtc/media/video_common_gn/moz.build
index 8fe45f5a5bd6..cea55451b02a 100644
--- third_party/libwebrtc/media/video_common_gn/moz.build
+++ third_party/libwebrtc/media/video_common_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_common_gn")
diff --git third_party/libwebrtc/media/video_source_base_gn/moz.build third_party/libwebrtc/media/video_source_base_gn/moz.build
index 0c67351e481a..b7102601a5f8 100644
--- third_party/libwebrtc/media/video_source_base_gn/moz.build
+++ third_party/libwebrtc/media/video_source_base_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_source_base_gn")
diff --git third_party/libwebrtc/modules/async_audio_processing/async_audio_processing_gn/moz.build third_party/libwebrtc/modules/async_audio_processing/async_audio_processing_gn/moz.build
index 910b12a46a63..9220db367d82 100644
--- third_party/libwebrtc/modules/async_audio_processing/async_audio_processing_gn/moz.build
+++ third_party/libwebrtc/modules/async_audio_processing/async_audio_processing_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("async_audio_processing_gn")
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 9c56b76d17a5..442c62b648b5 100644
--- third_party/libwebrtc/modules/audio_coding/audio_coding_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/audio_coding_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_coding_gn")
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 489b534c2fb3..7a4d82a43b5e 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_coding_module_typedefs_gn")
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 28a4474f3b01..c44eaba16b4e 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_coding_opus_common_gn")
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 c334503506ad..d0c66e82a230 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_encoder_cng_gn")
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 a8342784a2e6..9b789e0e576c 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_network_adaptor_config_gn")
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 98b4ab3b43dc..ccae536ad564 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -56,93 +65,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -150,82 +73,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_network_adaptor_gn")
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 b83a1cfcfb20..131a60705075 100644
--- third_party/libwebrtc/modules/audio_coding/g711_c_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/g711_c_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("g711_c_gn")
diff --git third_party/libwebrtc/modules/audio_coding/g711_gn/moz.build third_party/libwebrtc/modules/audio_coding/g711_gn/moz.build
index 1675e90d8790..d01e4b686418 100644
--- third_party/libwebrtc/modules/audio_coding/g711_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/g711_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("g711_gn")
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 fa99447ca050..44978ebedb1d 100644
--- third_party/libwebrtc/modules/audio_coding/g722_c_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/g722_c_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("g722_c_gn")
diff --git third_party/libwebrtc/modules/audio_coding/g722_gn/moz.build third_party/libwebrtc/modules/audio_coding/g722_gn/moz.build
index fa074502a127..4f9ad9cd4a62 100644
--- third_party/libwebrtc/modules/audio_coding/g722_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/g722_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("g722_gn")
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 deddbd7bc6a3..279051a8188f 100644
--- third_party/libwebrtc/modules/audio_coding/isac_bwinfo_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/isac_bwinfo_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("isac_bwinfo_gn")
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 9a2813ef474b..975128b1fe25 100644
--- third_party/libwebrtc/modules/audio_coding/isac_vad_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/isac_vad_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,82 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -132,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("isac_vad_gn")
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 68845ebff19a..1463a804bbff 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("legacy_encoded_audio_frame_gn")
diff --git third_party/libwebrtc/modules/audio_coding/neteq_gn/moz.build third_party/libwebrtc/modules/audio_coding/neteq_gn/moz.build
index b7100e120ab2..7e31677674ef 100644
--- third_party/libwebrtc/modules/audio_coding/neteq_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/neteq_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -81,93 +90,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -175,82 +98,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("neteq_gn")
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 1f9fc4f74a1a..8dfe667be13c 100644
--- third_party/libwebrtc/modules/audio_coding/pcm16b_c_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/pcm16b_c_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("pcm16b_c_gn")
diff --git third_party/libwebrtc/modules/audio_coding/pcm16b_gn/moz.build third_party/libwebrtc/modules/audio_coding/pcm16b_gn/moz.build
index db4b694011a3..8abc614eedbe 100644
--- third_party/libwebrtc/modules/audio_coding/pcm16b_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/pcm16b_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,93 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("pcm16b_gn")
diff --git third_party/libwebrtc/modules/audio_coding/red_gn/moz.build third_party/libwebrtc/modules/audio_coding/red_gn/moz.build
index 7896cb765a18..f16ef0cde7d2 100644
--- third_party/libwebrtc/modules/audio_coding/red_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/red_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("red_gn")
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 d81c924c7314..bf58ee8f6ccc 100644
--- third_party/libwebrtc/modules/audio_coding/webrtc_cng_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/webrtc_cng_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_cng_gn")
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 c79834bb21b0..1d99ea5b574c 100644
--- third_party/libwebrtc/modules/audio_coding/webrtc_multiopus_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/webrtc_multiopus_gn/moz.build
@@ -13,6 +13,9 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_CODEC_OPUS"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
@@ -20,7 +23,13 @@ DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
 DEFINES["WEBRTC_OPUS_SUPPORT_120MS_PTIME"] = "1"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -50,93 +59,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -144,82 +67,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_multiopus_gn")
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 359c64bca323..ca89800b1f98 100644
--- third_party/libwebrtc/modules/audio_coding/webrtc_opus_gn/moz.build
+++ third_party/libwebrtc/modules/audio_coding/webrtc_opus_gn/moz.build
@@ -13,6 +13,9 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_CODEC_OPUS"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
@@ -20,7 +23,13 @@ DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
 DEFINES["WEBRTC_OPUS_SUPPORT_120MS_PTIME"] = "1"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -50,93 +59,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -144,82 +67,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_opus_gn")
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 e255da9f0e5d..cbdb8e61184f 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
@@ -13,6 +13,9 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_CODEC_OPUS"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
@@ -20,7 +23,13 @@ DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
 DEFINES["WEBRTC_OPUS_SUPPORT_120MS_PTIME"] = "1"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,86 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_opus_wrapper_gn")
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 32a52b9ad4dc..1812ab6bedf8 100644
--- third_party/libwebrtc/modules/audio_device/audio_device_gn/moz.build
+++ third_party/libwebrtc/modules/audio_device/audio_device_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_device_gn")
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 84025f54a42e..67a9ba3e660f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_frame_manipulator_gn")
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 266eeae7423d..29d13fa8a836 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
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_mixer_impl_gn")
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 67dbd0364954..af1781edae5a 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("adaptive_fir_filter_erl_gn")
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 826757be30b2..248e97af3f24 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("adaptive_fir_filter_gn")
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 841514fe7c05..07f83ec4dd88 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
@@ -18,14 +18,23 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_AVX2"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -57,122 +66,9 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
     DEFINES["_DEBUG"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CXXFLAGS += [
         "-msse2"
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 8ee5cb9e07a8..87efd357dcbd 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("aec3_common_gn")
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 0a4f5b6f98bf..2f6d1401854f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("aec3_fft_gn")
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 7ba40bca2b1a..ab0e74825f70 100644
--- third_party/libwebrtc/modules/audio_processing/aec3/aec3_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/aec3/aec3_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -103,93 +112,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -197,82 +120,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("aec3_gn")
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 f65afa9ac2f6..46165a8d7f41 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("fft_data_gn")
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 511f5e83ffca..803c26a3f14e 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("matched_filter_gn")
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 dd3a8042526c..a61dbeb42dac 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("render_buffer_gn")
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 1a8f09ed9c10..4ebff1919c6f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("vector_math_gn")
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 0fc8981378df..411bcb480900 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("aec_dump_gn")
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 8856ebd34b1d..58073c04a13f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("null_aec_dump_factory_gn")
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 27439b35bb70..02b5f3aa25f7 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("aec_dump_interface_gn")
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 60d496606730..f7b819222e3d 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,102 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -151,27 +65,12 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["__ARM_NEON__"] = "1"
 
     SOURCES += [
-        "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_neon.cc"
-    ]
-
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-    SOURCES += [
+        "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc",
         "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_neon.cc"
     ]
 
 if CONFIG["TARGET_CPU"] == "loongarch64":
 
-    DEFINES["_GNU_SOURCE"] = True
-
     SOURCES += [
         "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
     ]
@@ -180,7 +79,6 @@ if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     SOURCES += [
         "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_mips.cc"
@@ -188,8 +86,6 @@ if CONFIG["TARGET_CPU"] == "mips32":
 
 if CONFIG["TARGET_CPU"] == "mips64":
 
-    DEFINES["_GNU_SOURCE"] = True
-
     SOURCES += [
         "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
     ]
@@ -200,77 +96,27 @@ if CONFIG["TARGET_CPU"] == "ppc64":
         "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
     ]
 
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
+if CONFIG["TARGET_CPU"] == "riscv64":
 
     SOURCES += [
         "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "riscv64":
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
     SOURCES += [
         "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
     SOURCES += [
         "/third_party/libwebrtc/modules/audio_processing/aecm/aecm_core_c.cc"
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 b3eada70e070..1e05f9215cb7 100644
--- third_party/libwebrtc/modules/audio_processing/agc/agc_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc/agc_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("agc_gn")
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 8e992e81b365..04869edc3c5f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("gain_control_interface_gn")
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 5cb20550eb9b..63d3222f12fc 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("legacy_agc_gn")
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 60bc520f030d..3539b6f3f359 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,93 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("level_estimation_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/adaptive_digital_gain_controller_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/adaptive_digital_gain_controller_gn/moz.build
index 2330433745f4..f613f26874c6 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/adaptive_digital_gain_controller_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/adaptive_digital_gain_controller_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("adaptive_digital_gain_controller_gn")
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 d5c67b371823..3092974ef246 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("biquad_filter_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor_gn/moz.build
index 667b65137559..2f73f17c2555 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("clipping_predictor_gn")
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 e1a0baae554c..9b86a297b3bf 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/common_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/common_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("common_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/cpu_features_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/cpu_features_gn/moz.build
index be4610aa0cf4..95ae3f5c0f93 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/cpu_features_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/cpu_features_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("cpu_features_gn")
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 2e53dee9e378..3d538b54dcb6 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
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("fixed_digital_gn")
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 0301076b89fd..7fc8cd8541ce 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("gain_applier_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/gain_map_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/gain_map_gn/moz.build
index fc03d1e950c9..925eefbff872 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/gain_map_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/gain_map_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("gain_map_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/input_volume_controller_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/input_volume_controller_gn/moz.build
index 3312eb9b2687..7475d4f5fcc9 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/input_volume_controller_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/input_volume_controller_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,93 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("input_volume_controller_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter_gn/moz.build
index eeb45cb8db7a..767564b38e70 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("input_volume_stats_reporter_gn")
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 78a1ea36bea8..aef58f171a81 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
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("noise_level_estimator_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_auto_correlation_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_auto_correlation_gn/moz.build
index 1de463d8cf15..590703ff90d7 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_auto_correlation_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_auto_correlation_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rnn_vad_auto_correlation_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_common_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_common_gn/moz.build
index 570b4d1a7bb2..77b99ab85ab7 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_common_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_common_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rnn_vad_common_gn")
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 73cf1d07a5c3..7b7869c1cc0f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rnn_vad_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_layers_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_layers_gn/moz.build
index efb1ea3b48bb..784bf34261ff 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_layers_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_layers_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rnn_vad_layers_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_lp_residual_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_lp_residual_gn/moz.build
index 4fefa7795aa0..9b8a2d18952e 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_lp_residual_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_lp_residual_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rnn_vad_lp_residual_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_pitch_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_pitch_gn/moz.build
index e5b6ee12a51f..bb89272d797c 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_pitch_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_pitch_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rnn_vad_pitch_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_ring_buffer_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_ring_buffer_gn/moz.build
index 4375c115591f..de7a77543eb5 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_ring_buffer_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_ring_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rnn_vad_ring_buffer_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_sequence_buffer_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_sequence_buffer_gn/moz.build
index 3fb4fa37a59d..a2ec0e64002f 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_sequence_buffer_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_sequence_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rnn_vad_sequence_buffer_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_spectral_features_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_spectral_features_gn/moz.build
index cf0ed3ecaf31..611573ee4186 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_spectral_features_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_spectral_features_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rnn_vad_spectral_features_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_symmetric_matrix_buffer_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_symmetric_matrix_buffer_gn/moz.build
index e0efdff86364..d3eef1484e27 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_symmetric_matrix_buffer_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_vad_symmetric_matrix_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rnn_vad_symmetric_matrix_buffer_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2_gn/moz.build
index 67d0bfcbe14d..9df5c4c6c530 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2_gn/moz.build
@@ -18,13 +18,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_AVX2"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -52,122 +61,9 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
     DEFINES["_DEBUG"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CXXFLAGS += [
         "-msse2"
diff --git third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_gn/moz.build
index f7c42e9e9d61..4ebff1919c6f 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("vector_math_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/saturation_protector_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/saturation_protector_gn/moz.build
index 1bdd827e45aa..fde13760ef04 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/saturation_protector_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/saturation_protector_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,93 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("saturation_protector_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/speech_level_estimator_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/speech_level_estimator_gn/moz.build
index b159467faa87..3de8cc3c3437 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/speech_level_estimator_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/speech_level_estimator_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("speech_level_estimator_gn")
diff --git third_party/libwebrtc/modules/audio_processing/agc2/vad_wrapper_gn/moz.build third_party/libwebrtc/modules/audio_processing/agc2/vad_wrapper_gn/moz.build
index 88f39d6c59ae..1c7395007405 100644
--- third_party/libwebrtc/modules/audio_processing/agc2/vad_wrapper_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/agc2/vad_wrapper_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("vad_wrapper_gn")
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 9cf92bd2a934..998b3c95ab71 100644
--- third_party/libwebrtc/modules/audio_processing/apm_logging_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/apm_logging_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("apm_logging_gn")
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 17ed3d672a03..1c1b8d4143d8 100644
--- third_party/libwebrtc/modules/audio_processing/audio_buffer_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/audio_buffer_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_buffer_gn")
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 c1c5e0b27d94..b56d3e9d131c 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_frame_proxies_gn")
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 1a41d352a6b7..c2d5f48fe19f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("audio_frame_view_gn")
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 cbf16e2d8d5a..7204f516a50d 100644
--- third_party/libwebrtc/modules/audio_processing/audio_processing_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/audio_processing_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -52,93 +61,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -146,82 +69,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("audio_processing_gn")
diff --git third_party/libwebrtc/modules/audio_processing/capture_levels_adjuster/capture_levels_adjuster_gn/moz.build third_party/libwebrtc/modules/audio_processing/capture_levels_adjuster/capture_levels_adjuster_gn/moz.build
index 566fa702e086..8df1dc59bb19 100644
--- third_party/libwebrtc/modules/audio_processing/capture_levels_adjuster/capture_levels_adjuster_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/capture_levels_adjuster/capture_levels_adjuster_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("capture_levels_adjuster_gn")
diff --git third_party/libwebrtc/modules/audio_processing/gain_controller2_gn/moz.build third_party/libwebrtc/modules/audio_processing/gain_controller2_gn/moz.build
index 52e13f77d65e..2a4fd4b2f230 100644
--- third_party/libwebrtc/modules/audio_processing/gain_controller2_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/gain_controller2_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("gain_controller2_gn")
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 a1c9ddba74f3..0f0e8130fc1d 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("high_pass_filter_gn")
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 913766a7301e..d7e4306b8748 100644
--- third_party/libwebrtc/modules/audio_processing/ns/ns_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/ns/ns_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -59,93 +68,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -153,82 +76,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("ns_gn")
diff --git third_party/libwebrtc/modules/audio_processing/post_filter_gn/moz.build third_party/libwebrtc/modules/audio_processing/post_filter_gn/moz.build
index adbf42b91139..595a0ad0d37c 100644
--- third_party/libwebrtc/modules/audio_processing/post_filter_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/post_filter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("post_filter_gn")
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 bcdec468bd11..2c78ef2b8605 100644
--- third_party/libwebrtc/modules/audio_processing/rms_level_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/rms_level_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rms_level_gn")
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 d0c4e5e064dc..159e9cf582d7 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("cascaded_biquad_filter_gn")
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 e56b8a7cc52c..a037bee529b4 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,86 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -134,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("legacy_delay_estimator_gn")
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 4d177ba51e76..1352dcf9dd77 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("pffft_wrapper_gn")
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 b75e258645f5..47eebf564575 100644
--- third_party/libwebrtc/modules/audio_processing/vad/vad_gn/moz.build
+++ third_party/libwebrtc/modules/audio_processing/vad/vad_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -53,93 +62,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -147,82 +70,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("vad_gn")
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 3c4421782f08..3db34e302b65 100644
--- third_party/libwebrtc/modules/congestion_controller/congestion_controller_gn/moz.build
+++ third_party/libwebrtc/modules/congestion_controller/congestion_controller_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,94 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("congestion_controller_gn")
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 c3eac770d4a4..44e65e3af3dd 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("alr_detector_gn")
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 21fff249f2b7..6535a0ec9e81 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,94 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("delay_based_bwe_gn")
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 a77055ccdac9..9475b31f9aaa 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -51,93 +60,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -145,82 +68,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("estimators_gn")
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 0a9814333b31..212b0ad6dd21 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("goog_cc_gn")
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 aac6b3bd8559..837ba3ec6c9f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("link_capacity_estimator_gn")
diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/loss_based_bwe_v2_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/loss_based_bwe_v2_gn/moz.build
index 966c3862293a..f458c2372ba0 100644
--- third_party/libwebrtc/modules/congestion_controller/goog_cc/loss_based_bwe_v2_gn/moz.build
+++ third_party/libwebrtc/modules/congestion_controller/goog_cc/loss_based_bwe_v2_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("loss_based_bwe_v2_gn")
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 ff8f2a440a1f..063cb6f8f88d 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("probe_controller_gn")
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 50844ee8832c..37b71e85844f 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("pushback_controller_gn")
diff --git third_party/libwebrtc/modules/congestion_controller/goog_cc/send_side_bwe_gn/moz.build third_party/libwebrtc/modules/congestion_controller/goog_cc/send_side_bwe_gn/moz.build
index fc3f36198875..162fbab4195f 100644
--- third_party/libwebrtc/modules/congestion_controller/goog_cc/send_side_bwe_gn/moz.build
+++ third_party/libwebrtc/modules/congestion_controller/goog_cc/send_side_bwe_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("send_side_bwe_gn")
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 2360a15491dc..5f1a2ac7442a 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("control_handler_gn")
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 d29224be7452..f3bcafd8ad85 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("transport_feedback_gn")
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 e7579297f794..3a83dde9190a 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
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_AVX2"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,102 +56,16 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
     DEFINES["_DEBUG"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CXXFLAGS += [
         "-msse2",
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
     CXXFLAGS += [
         "-msse2"
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 9e856db8df87..78652d03cb96 100644
--- third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build
+++ third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build
@@ -26,12 +26,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -84,180 +93,14 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/mac/desktop_configuration_monitor.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/mac/full_screen_mac_application_handler.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/mac/window_list_utils.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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"
-    ]
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "d3d11",
-        "dwmapi",
-        "dxgi",
-        "iphlpapi",
-        "secur32",
-        "shcore",
-        "winmm"
-    ]
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/cropping_window_capturer_win.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_frame_win.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_win.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_win.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/cursor.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/d3d_device.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/desktop.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/desktop_capture_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/display_configuration_monitor.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/dxgi_context.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/dxgi_frame.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/dxgi_texture.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/dxgi_texture_mapping.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/dxgi_texture_staging.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/full_screen_win_application_handler.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/scoped_thread_desktop.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/screen_capture_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/selected_window_context.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/wgc_capture_session.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/wgc_capture_source.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/wgc_desktop_frame.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/window_capture_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/win/window_capturer_win_gdi.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_win.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/window_finder_win.cc"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["WEBRTC_ARCH_ARM64"] = True
     DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["__ARM_NEON__"] = "1"
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -265,7 +108,8 @@ if CONFIG["TARGET_CPU"] == "arm":
     ]
 
     SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
     ]
 
     UNIFIED_SOURCES += [
@@ -275,34 +119,9 @@ if CONFIG["TARGET_CPU"] == "arm":
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc"
-    ]
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["WEBRTC_USE_X11"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-    OS_LIBS += [
-        "X11",
-        "Xcomposite",
-        "Xdamage",
-        "Xext",
-        "Xfixes",
-        "Xrandr",
-        "Xrender"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
 if CONFIG["TARGET_CPU"] == "mips32":
@@ -310,7 +129,6 @@ if CONFIG["TARGET_CPU"] == "mips32":
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -318,7 +136,8 @@ if CONFIG["TARGET_CPU"] == "mips32":
     ]
 
     SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
     ]
 
     UNIFIED_SOURCES += [
@@ -328,13 +147,14 @@ if CONFIG["TARGET_CPU"] == "mips32":
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
 if CONFIG["TARGET_CPU"] == "mips64":
 
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -342,7 +162,8 @@ if CONFIG["TARGET_CPU"] == "mips64":
     ]
 
     SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
     ]
 
     UNIFIED_SOURCES += [
@@ -352,117 +173,19 @@ if CONFIG["TARGET_CPU"] == "mips64":
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc"
-    ]
-
-if CONFIG["TARGET_CPU"] == "ppc64":
-
-    DEFINES["WEBRTC_USE_X11"] = True
-
-    OS_LIBS += [
-        "X11",
-        "Xcomposite",
-        "Xdamage",
-        "Xext",
-        "Xfixes",
-        "Xrandr",
-        "Xrender"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-    LOCAL_INCLUDES += [
-        "/third_party/libepoxy/libepoxy/include/",
-        "/third_party/libwebrtc/third_party/libepoxy/libepoxy/include/"
-    ]
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "riscv64":
-
-    DEFINES["WEBRTC_USE_X11"] = True
-
-    OS_LIBS += [
-        "X11",
-        "Xcomposite",
-        "Xdamage",
-        "Xext",
-        "Xfixes",
-        "Xrandr",
-        "Xrender"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -470,7 +193,8 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
     ]
 
     SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
     ]
 
     UNIFIED_SOURCES += [
@@ -480,13 +204,15 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.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" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -494,7 +220,8 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
     ]
 
     SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
     ]
 
     UNIFIED_SOURCES += [
@@ -504,10 +231,12 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc",
         "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
+if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD":
 
     DEFINES["WEBRTC_USE_X11"] = True
 
@@ -533,134 +262,61 @@ if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGE
         "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
     ]
 
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_USE_X11"] = True
-
-    OS_LIBS += [
-        "X11",
-        "Xcomposite",
-        "Xdamage",
-        "Xext",
-        "Xfixes",
-        "Xrandr",
-        "Xrender"
-    ]
+if not CONFIG["MOZ_X11"] and CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "loongarch64":
 
     UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_null.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_null.cc"
     ]
 
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "mips32":
-
-    DEFINES["WEBRTC_USE_X11"] = True
+if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "loongarch64":
 
-    OS_LIBS += [
-        "X11",
-        "Xcomposite",
-        "Xdamage",
-        "Xext",
-        "Xfixes",
-        "Xrandr",
-        "Xrender"
+    SOURCES += [
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
     ]
 
     UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["WEBRTC_USE_X11"] = True
-
-    OS_LIBS += [
-        "X11",
-        "Xcomposite",
-        "Xdamage",
-        "Xext",
-        "Xfixes",
-        "Xrandr",
-        "Xrender"
-    ]
+if not CONFIG["MOZ_X11"] and CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "ppc64":
 
     UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_null.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_null.cc"
     ]
 
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "ppc64":
 
-    DEFINES["WEBRTC_USE_X11"] = True
-
-    OS_LIBS += [
-        "X11",
-        "Xcomposite",
-        "Xdamage",
-        "Xext",
-        "Xfixes",
-        "Xrandr",
-        "Xrender"
+    SOURCES += [
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
     ]
 
     UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if not CONFIG["MOZ_X11"] and CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "riscv64":
 
-    DEFINES["WEBRTC_USE_X11"] = True
+    UNIFIED_SOURCES += [
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_null.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_null.cc"
+    ]
 
-    OS_LIBS += [
-        "X11",
-        "Xcomposite",
-        "Xdamage",
-        "Xext",
-        "Xfixes",
-        "Xrandr",
-        "Xrender"
+if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "riscv64":
+
+    SOURCES += [
+        "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc"
     ]
 
     UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/shared_x_display.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_finder_x11.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_list_utils.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_atom_cache.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc",
-        "/third_party/libwebrtc/modules/desktop_capture/linux/x11/x_window_property.cc"
+        "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
+        "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
 Library("desktop_capture_gn")
diff --git third_party/libwebrtc/modules/desktop_capture/desktop_capture_objc_gn/moz.build third_party/libwebrtc/modules/desktop_capture/desktop_capture_objc_gn/moz.build
deleted file mode 100644
index e27c2d700063..000000000000
--- third_party/libwebrtc/modules/desktop_capture/desktop_capture_objc_gn/moz.build
+++ /dev/null
@@ -1,81 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-CMMFLAGS += [
-    "-fobjc-arc"
-]
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MAC"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/third_party/libwebrtc/sdk/objc/",
-    "/third_party/libwebrtc/sdk/objc/base/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/modules/desktop_capture/mac/desktop_configuration.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_cgimage.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_iosurface.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_provider.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/mac/sck_picker_handle.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/mac/screen_capturer_mac.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/mac/screen_capturer_sck.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_darwin.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/window_capturer_mac.mm",
-    "/third_party/libwebrtc/modules/desktop_capture/window_finder_mac.mm"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("desktop_capture_objc_gn")
diff --git third_party/libwebrtc/modules/desktop_capture/primitives_gn/moz.build third_party/libwebrtc/modules/desktop_capture/primitives_gn/moz.build
index 9d966c83f568..fe4c0e8d1fb2 100644
--- third_party/libwebrtc/modules/desktop_capture/primitives_gn/moz.build
+++ third_party/libwebrtc/modules/desktop_capture/primitives_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -52,75 +61,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -128,69 +69,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("primitives_gn")
diff --git third_party/libwebrtc/modules/module_api_gn/moz.build third_party/libwebrtc/modules/module_api_gn/moz.build
index 88c4f9659e24..57cdaa5b4aa7 100644
--- third_party/libwebrtc/modules/module_api_gn/moz.build
+++ third_party/libwebrtc/modules/module_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("module_api_gn")
diff --git third_party/libwebrtc/modules/module_api_public_gn/moz.build third_party/libwebrtc/modules/module_api_public_gn/moz.build
index 60a59ac68ba0..5cadc26111a4 100644
--- third_party/libwebrtc/modules/module_api_public_gn/moz.build
+++ third_party/libwebrtc/modules/module_api_public_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("module_api_public_gn")
diff --git third_party/libwebrtc/modules/module_fec_api_gn/moz.build third_party/libwebrtc/modules/module_fec_api_gn/moz.build
index af36f290a1db..bbb06a63bfc0 100644
--- third_party/libwebrtc/modules/module_fec_api_gn/moz.build
+++ third_party/libwebrtc/modules/module_fec_api_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("module_fec_api_gn")
diff --git third_party/libwebrtc/modules/pacing/interval_budget_gn/moz.build third_party/libwebrtc/modules/pacing/interval_budget_gn/moz.build
index 1a5e2ac45c89..b9cc24f035e6 100644
--- third_party/libwebrtc/modules/pacing/interval_budget_gn/moz.build
+++ third_party/libwebrtc/modules/pacing/interval_budget_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("interval_budget_gn")
diff --git third_party/libwebrtc/modules/pacing/pacing_gn/moz.build third_party/libwebrtc/modules/pacing/pacing_gn/moz.build
index f9e685490ccc..9c976398855b 100644
--- third_party/libwebrtc/modules/pacing/pacing_gn/moz.build
+++ third_party/libwebrtc/modules/pacing/pacing_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -53,94 +62,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -148,82 +70,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("pacing_gn")
diff --git third_party/libwebrtc/modules/portal/portal_gn/moz.build third_party/libwebrtc/modules/portal/portal_gn/moz.build
index a50648a9760d..c23281dee375 100644
--- third_party/libwebrtc/modules/portal/portal_gn/moz.build
+++ third_party/libwebrtc/modules/portal/portal_gn/moz.build
@@ -26,21 +26,18 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["USE_AURA"] = "1"
 DEFINES["USE_GLIB"] = "1"
 DEFINES["USE_OZONE"] = "1"
-DEFINES["USE_UDEV"] = True
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_LINUX"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
 DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
 DEFINES["WEBRTC_USE_PIPEWIRE"] = True
 DEFINES["_FILE_OFFSET_BITS"] = "64"
-DEFINES["_GNU_SOURCE"] = True
 DEFINES["_LARGEFILE64_SOURCE"] = True
 DEFINES["_LARGEFILE_SOURCE"] = True
 DEFINES["__STDC_CONSTANT_MACROS"] = True
@@ -84,16 +81,6 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
diff --git third_party/libwebrtc/modules/remote_bitrate_estimator/congestion_control_feedback_generator_gn/moz.build third_party/libwebrtc/modules/remote_bitrate_estimator/congestion_control_feedback_generator_gn/moz.build
index 5f89c5fb33ad..23e0dcd377fa 100644
--- third_party/libwebrtc/modules/remote_bitrate_estimator/congestion_control_feedback_generator_gn/moz.build
+++ third_party/libwebrtc/modules/remote_bitrate_estimator/congestion_control_feedback_generator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("congestion_control_feedback_generator_gn")
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 44a231954c82..bf00b83cbc62 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -55,93 +64,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -149,82 +72,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("remote_bitrate_estimator_gn")
diff --git third_party/libwebrtc/modules/remote_bitrate_estimator/rtp_transport_feedback_generator_gn/moz.build third_party/libwebrtc/modules/remote_bitrate_estimator/rtp_transport_feedback_generator_gn/moz.build
index 72f3f6d79b1f..319c8f69ecf6 100644
--- third_party/libwebrtc/modules/remote_bitrate_estimator/rtp_transport_feedback_generator_gn/moz.build
+++ third_party/libwebrtc/modules/remote_bitrate_estimator/rtp_transport_feedback_generator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtp_transport_feedback_generator_gn")
diff --git third_party/libwebrtc/modules/remote_bitrate_estimator/transport_sequence_number_feedback_generator_gn/moz.build third_party/libwebrtc/modules/remote_bitrate_estimator/transport_sequence_number_feedback_generator_gn/moz.build
index e445120c239a..add7af188efb 100644
--- third_party/libwebrtc/modules/remote_bitrate_estimator/transport_sequence_number_feedback_generator_gn/moz.build
+++ third_party/libwebrtc/modules/remote_bitrate_estimator/transport_sequence_number_feedback_generator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("transport_sequence_number_feedback_generator_gn")
diff --git third_party/libwebrtc/modules/rtp_rtcp/leb128_gn/moz.build third_party/libwebrtc/modules/rtp_rtcp/leb128_gn/moz.build
index 863003cc6dba..f373e77842eb 100644
--- third_party/libwebrtc/modules/rtp_rtcp/leb128_gn/moz.build
+++ third_party/libwebrtc/modules/rtp_rtcp/leb128_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("leb128_gn")
diff --git third_party/libwebrtc/modules/rtp_rtcp/ntp_time_util_gn/moz.build third_party/libwebrtc/modules/rtp_rtcp/ntp_time_util_gn/moz.build
index fb98c4bc6b0a..059bd85c05f4 100644
--- third_party/libwebrtc/modules/rtp_rtcp/ntp_time_util_gn/moz.build
+++ third_party/libwebrtc/modules/rtp_rtcp/ntp_time_util_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("ntp_time_util_gn")
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 fdec383ccab9..3abb078532e3 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -90,93 +99,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -184,82 +107,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_rtcp_format_gn")
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 3a7e03c6c39a..f22cc7aee488 100644
--- third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_gn/moz.build
+++ third_party/libwebrtc/modules/rtp_rtcp/rtp_rtcp_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -100,94 +109,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -195,82 +117,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_rtcp_gn")
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 e9dd4a5fb67c..95494a301fdf 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_video_header_gn")
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 4e3b42f6558b..ad4e476910dc 100644
--- third_party/libwebrtc/modules/third_party/fft/fft_gn/moz.build
+++ third_party/libwebrtc/modules/third_party/fft/fft_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("fft_gn")
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 92205c179088..f2769d4fd4d2 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("g711_3p_gn")
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 18a478d539ee..af5dea7e19d3 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -50,82 +59,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +67,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("g722_3p_gn")
diff --git third_party/libwebrtc/modules/utility/utility_gn/moz.build third_party/libwebrtc/modules/utility/utility_gn/moz.build
index 39011ae5e091..422703862311 100644
--- third_party/libwebrtc/modules/utility/utility_gn/moz.build
+++ third_party/libwebrtc/modules/utility/utility_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,90 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/utility/source/helpers_android.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -161,52 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("utility_gn")
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 ed3ef3b74c07..d03874fab0d2 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
@@ -18,12 +18,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -39,6 +48,10 @@ LOCAL_INCLUDES += [
 ]
 
 UNIFIED_SOURCES += [
+    "/third_party/libwebrtc/modules/video_capture/linux/device_info_linux.cc",
+    "/third_party/libwebrtc/modules/video_capture/linux/device_info_v4l2.cc",
+    "/third_party/libwebrtc/modules/video_capture/linux/video_capture_linux.cc",
+    "/third_party/libwebrtc/modules/video_capture/linux/video_capture_v4l2.cc",
     "/third_party/libwebrtc/modules/video_capture/video_capture_options.cc"
 ]
 
@@ -51,166 +64,14 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = 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/device_info_v4l2.cc",
-        "/third_party/libwebrtc/modules/video_capture/linux/video_capture_linux.cc",
-        "/third_party/libwebrtc/modules/video_capture/linux/video_capture_v4l2.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = 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/device_info_v4l2.cc",
-        "/third_party/libwebrtc/modules/video_capture/linux/video_capture_linux.cc",
-        "/third_party/libwebrtc/modules/video_capture/linux/video_capture_v4l2.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "ole32",
-        "oleaut32",
-        "secur32",
-        "strmiids",
-        "user32",
-        "winmm"
-    ]
-
-    SOURCES += [
-        "/third_party/libwebrtc/modules/video_capture/windows/device_info_ds.cc",
-        "/third_party/libwebrtc/modules/video_capture/windows/help_functions_ds.cc",
-        "/third_party/libwebrtc/modules/video_capture/windows/sink_filter_ds.cc"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/video_capture/windows/video_capture_ds.cc",
-        "/third_party/libwebrtc/modules/video_capture/windows/video_capture_factory_windows.cc"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["WEBRTC_ARCH_ARM64"] = True
     DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips32":
-
-    DEFINES["MIPS32_LE"] = True
-    DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-    LOCAL_INCLUDES += [
-        "/third_party/libepoxy/libepoxy/include/",
-        "/third_party/libwebrtc/third_party/libepoxy/libepoxy/include/"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/modules/video_capture/linux/camera_portal.cc",
-        "/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc",
-        "/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc",
-        "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
-    ]
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["__ARM_NEON__"] = "1"
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -224,44 +85,11 @@ if CONFIG["TARGET_CPU"] == "mips64":
         "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
     ]
 
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
+if CONFIG["TARGET_CPU"] == "mips32":
 
+    DEFINES["MIPS32_LE"] = True
+    DEFINES["MIPS_FPU_LE"] = True
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -275,10 +103,9 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
         "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
+if CONFIG["TARGET_CPU"] == "mips64":
 
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -292,14 +119,14 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
         "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CXXFLAGS += [
         "-msse2"
     ]
 
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
@@ -313,10 +140,10 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
         "/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
     DEFINES["WEBRTC_USE_PIPEWIRE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
     LOCAL_INCLUDES += [
         "/third_party/libepoxy/libepoxy/include/",
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 7d2cb6e37fb9..d773975e789d 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -50,93 +59,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -144,82 +67,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_capture_module_gn")
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 1e7b10688f3e..0c9e69f6d9ce 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("chain_diff_calculator_gn")
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 05cfb2a8de36..730f9581e95a 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("codec_globals_headers_gn")
diff --git third_party/libwebrtc/modules/video_coding/codecs/av1/av1_svc_config_gn/moz.build third_party/libwebrtc/modules/video_coding/codecs/av1/av1_svc_config_gn/moz.build
index 1f07c3406aa5..ce5dd4056087 100644
--- third_party/libwebrtc/modules/video_coding/codecs/av1/av1_svc_config_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/codecs/av1/av1_svc_config_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("av1_svc_config_gn")
diff --git third_party/libwebrtc/modules/video_coding/codecs/av1/dav1d_decoder_gn/moz.build third_party/libwebrtc/modules/video_coding/codecs/av1/dav1d_decoder_gn/moz.build
index c1c8b0a7c64e..858945cd9a2e 100644
--- third_party/libwebrtc/modules/video_coding/codecs/av1/dav1d_decoder_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/codecs/av1/dav1d_decoder_gn/moz.build
@@ -16,12 +16,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -53,93 +62,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -147,82 +70,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("dav1d_decoder_gn")
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 1b1bb0aebb9f..de9c51fe107e 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
@@ -16,12 +16,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,94 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -144,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("aom_av1_encoder_gn")
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 3d9b5c87e574..d9dd5185ae93 100644
--- third_party/libwebrtc/modules/video_coding/encoded_frame_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/encoded_frame_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("encoded_frame_gn")
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 c6f81b4ed4d4..b4bfea458e5c 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_dependencies_calculator_gn")
diff --git third_party/libwebrtc/modules/video_coding/frame_helpers_gn/moz.build third_party/libwebrtc/modules/video_coding/frame_helpers_gn/moz.build
index 251b15e896bf..3d298942614e 100644
--- third_party/libwebrtc/modules/video_coding/frame_helpers_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/frame_helpers_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_helpers_gn")
diff --git third_party/libwebrtc/modules/video_coding/frame_sampler_gn/moz.build third_party/libwebrtc/modules/video_coding/frame_sampler_gn/moz.build
index 0b9bedb1d288..aeb9164b7b97 100644
--- third_party/libwebrtc/modules/video_coding/frame_sampler_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/frame_sampler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_sampler_gn")
diff --git third_party/libwebrtc/modules/video_coding/h264_sprop_parameter_sets_gn/moz.build third_party/libwebrtc/modules/video_coding/h264_sprop_parameter_sets_gn/moz.build
index d71cb5796e1d..a13914a39e24 100644
--- third_party/libwebrtc/modules/video_coding/h264_sprop_parameter_sets_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/h264_sprop_parameter_sets_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("h264_sprop_parameter_sets_gn")
diff --git third_party/libwebrtc/modules/video_coding/h26x_packet_buffer_gn/moz.build third_party/libwebrtc/modules/video_coding/h26x_packet_buffer_gn/moz.build
index e672f30de7f8..a6581971c3ff 100644
--- third_party/libwebrtc/modules/video_coding/h26x_packet_buffer_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/h26x_packet_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("h26x_packet_buffer_gn")
diff --git third_party/libwebrtc/modules/video_coding/nack_requester_gn/moz.build third_party/libwebrtc/modules/video_coding/nack_requester_gn/moz.build
index 4d6c27a8cc9f..0f47848b2873 100644
--- third_party/libwebrtc/modules/video_coding/nack_requester_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/nack_requester_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("nack_requester_gn")
diff --git third_party/libwebrtc/modules/video_coding/packet_buffer_gn/moz.build third_party/libwebrtc/modules/video_coding/packet_buffer_gn/moz.build
index 7583fd14da48..250ae7177cda 100644
--- third_party/libwebrtc/modules/video_coding/packet_buffer_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/packet_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("packet_buffer_gn")
diff --git third_party/libwebrtc/modules/video_coding/svc/scalability_mode_util_gn/moz.build third_party/libwebrtc/modules/video_coding/svc/scalability_mode_util_gn/moz.build
index 16a769513750..d073b9ad375e 100644
--- third_party/libwebrtc/modules/video_coding/svc/scalability_mode_util_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/svc/scalability_mode_util_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("scalability_mode_util_gn")
diff --git third_party/libwebrtc/modules/video_coding/svc/scalability_structures_gn/moz.build third_party/libwebrtc/modules/video_coding/svc/scalability_structures_gn/moz.build
index 5540aa87f9c9..3ab93bb4ad62 100644
--- third_party/libwebrtc/modules/video_coding/svc/scalability_structures_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/svc/scalability_structures_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -53,93 +62,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -147,82 +70,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("scalability_structures_gn")
diff --git third_party/libwebrtc/modules/video_coding/svc/scalable_video_controller_gn/moz.build third_party/libwebrtc/modules/video_coding/svc/scalable_video_controller_gn/moz.build
index adbdcd25b8ac..eef0f099b359 100644
--- third_party/libwebrtc/modules/video_coding/svc/scalable_video_controller_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/svc/scalable_video_controller_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("scalable_video_controller_gn")
diff --git third_party/libwebrtc/modules/video_coding/svc/simulcast_to_svc_converter_gn/moz.build third_party/libwebrtc/modules/video_coding/svc/simulcast_to_svc_converter_gn/moz.build
index f58ee6d17f4f..a2bb00a16786 100644
--- third_party/libwebrtc/modules/video_coding/svc/simulcast_to_svc_converter_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/svc/simulcast_to_svc_converter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("simulcast_to_svc_converter_gn")
diff --git third_party/libwebrtc/modules/video_coding/svc/svc_rate_allocator_gn/moz.build third_party/libwebrtc/modules/video_coding/svc/svc_rate_allocator_gn/moz.build
index 3429ebfbe312..544297c36cfe 100644
--- third_party/libwebrtc/modules/video_coding/svc/svc_rate_allocator_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/svc/svc_rate_allocator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("svc_rate_allocator_gn")
diff --git third_party/libwebrtc/modules/video_coding/timing/decode_time_percentile_filter_gn/moz.build third_party/libwebrtc/modules/video_coding/timing/decode_time_percentile_filter_gn/moz.build
index 27c38ed7b639..bf60f4bd2dc5 100644
--- third_party/libwebrtc/modules/video_coding/timing/decode_time_percentile_filter_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/timing/decode_time_percentile_filter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("decode_time_percentile_filter_gn")
diff --git third_party/libwebrtc/modules/video_coding/timing/frame_delay_variation_kalman_filter_gn/moz.build third_party/libwebrtc/modules/video_coding/timing/frame_delay_variation_kalman_filter_gn/moz.build
index c84fe43bf7ce..06e4fdb58172 100644
--- third_party/libwebrtc/modules/video_coding/timing/frame_delay_variation_kalman_filter_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/timing/frame_delay_variation_kalman_filter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_delay_variation_kalman_filter_gn")
diff --git third_party/libwebrtc/modules/video_coding/timing/inter_frame_delay_variation_calculator_gn/moz.build third_party/libwebrtc/modules/video_coding/timing/inter_frame_delay_variation_calculator_gn/moz.build
index d33868bac4b2..2cae7d1663d2 100644
--- third_party/libwebrtc/modules/video_coding/timing/inter_frame_delay_variation_calculator_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/timing/inter_frame_delay_variation_calculator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("inter_frame_delay_variation_calculator_gn")
diff --git third_party/libwebrtc/modules/video_coding/timing/jitter_estimator_gn/moz.build third_party/libwebrtc/modules/video_coding/timing/jitter_estimator_gn/moz.build
index 9f08b514eb3f..63970d48a4ff 100644
--- third_party/libwebrtc/modules/video_coding/timing/jitter_estimator_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/timing/jitter_estimator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("jitter_estimator_gn")
diff --git third_party/libwebrtc/modules/video_coding/timing/rtt_filter_gn/moz.build third_party/libwebrtc/modules/video_coding/timing/rtt_filter_gn/moz.build
index 092bdff85b3c..3ec4af4c6cbe 100644
--- third_party/libwebrtc/modules/video_coding/timing/rtt_filter_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/timing/rtt_filter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtt_filter_gn")
diff --git third_party/libwebrtc/modules/video_coding/timing/timestamp_extrapolator_gn/moz.build third_party/libwebrtc/modules/video_coding/timing/timestamp_extrapolator_gn/moz.build
index 9de0f87aa8ec..8d9fcf670160 100644
--- third_party/libwebrtc/modules/video_coding/timing/timestamp_extrapolator_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/timing/timestamp_extrapolator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("timestamp_extrapolator_gn")
diff --git third_party/libwebrtc/modules/video_coding/timing/timing_module_gn/moz.build third_party/libwebrtc/modules/video_coding/timing/timing_module_gn/moz.build
index 496eb2282038..226b3928e1e8 100644
--- third_party/libwebrtc/modules/video_coding/timing/timing_module_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/timing/timing_module_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("timing_module_gn")
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 a39517365ba9..49f00b43c0d7 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,93 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_codec_interface_gn")
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 44792bb4ce07..2fc63265c596 100644
--- third_party/libwebrtc/modules/video_coding/video_coding_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/video_coding_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -59,94 +68,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -154,82 +76,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_coding_gn")
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 3942f92586f6..0636656c36d1 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -58,94 +67,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -153,82 +75,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_coding_utility_gn")
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 17a993bfc02c..aa23c6c09134 100644
--- third_party/libwebrtc/modules/video_coding/webrtc_h264_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/webrtc_h264_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -51,94 +60,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -146,82 +68,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_h264_gn")
diff --git third_party/libwebrtc/modules/video_coding/webrtc_libvpx_interface_gn/moz.build third_party/libwebrtc/modules/video_coding/webrtc_libvpx_interface_gn/moz.build
index 1646d8078da0..a96575721cb6 100644
--- third_party/libwebrtc/modules/video_coding/webrtc_libvpx_interface_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/webrtc_libvpx_interface_gn/moz.build
@@ -16,12 +16,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,86 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_libvpx_interface_gn")
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 0fc3d55cad43..9ed831f4be8b 100644
--- third_party/libwebrtc/modules/video_coding/webrtc_vp8_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/webrtc_vp8_gn/moz.build
@@ -16,12 +16,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -52,94 +61,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -147,82 +69,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_vp8_gn")
diff --git third_party/libwebrtc/modules/video_coding/webrtc_vp8_scalability_gn/moz.build third_party/libwebrtc/modules/video_coding/webrtc_vp8_scalability_gn/moz.build
index 264dd08bc9a5..b0719d66ae1f 100644
--- third_party/libwebrtc/modules/video_coding/webrtc_vp8_scalability_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/webrtc_vp8_scalability_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_vp8_scalability_gn")
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 c3f86866b4e4..940bd6044109 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -51,94 +60,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -146,82 +68,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_vp8_temporal_layers_gn")
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 92d397f83465..c72091405763 100644
--- third_party/libwebrtc/modules/video_coding/webrtc_vp9_gn/moz.build
+++ third_party/libwebrtc/modules/video_coding/webrtc_vp9_gn/moz.build
@@ -16,12 +16,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -54,94 +63,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -149,82 +71,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_vp9_gn")
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 efec0c59e146..c41bffcdf583 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("webrtc_vp9_helpers_gn")
diff --git third_party/libwebrtc/moz.build third_party/libwebrtc/moz.build
index a91b2002fc6f..7795b213903b 100644
--- third_party/libwebrtc/moz.build
+++ third_party/libwebrtc/moz.build
@@ -292,6 +292,8 @@ DIRS += [
     "/third_party/libwebrtc/modules/congestion_controller/goog_cc/send_side_bwe_gn",
     "/third_party/libwebrtc/modules/congestion_controller/rtp/control_handler_gn",
     "/third_party/libwebrtc/modules/congestion_controller/rtp/transport_feedback_gn",
+    "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
+    "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
     "/third_party/libwebrtc/modules/module_api_gn",
     "/third_party/libwebrtc/modules/module_api_public_gn",
     "/third_party/libwebrtc/modules/module_fec_api_gn",
@@ -517,138 +519,30 @@ DIRS += [
     "/third_party/libwebrtc/webrtc_gn"
 ]
 
-if CONFIG["OS_TARGET"] == "Android":
-
-    DIRS += [
-        "/third_party/libwebrtc/rtc_base/ifaddrs_android_gn",
-        "/third_party/libwebrtc/third_party/cpu_features/ndk_compat_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DIRS += [
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_objc_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
-        "/third_party/libwebrtc/rtc_base/system/cocoa_threading_gn",
-        "/third_party/libwebrtc/rtc_base/system/gcd_helpers_gn",
-        "/third_party/libwebrtc/sdk/base_objc_gn",
-        "/third_party/libwebrtc/sdk/helpers_objc_gn",
-        "/third_party/libwebrtc/sdk/videocapture_objc_gn",
-        "/third_party/libwebrtc/sdk/videoframebuffer_objc_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DIRS += [
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DIRS += [
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
-        "/third_party/libwebrtc/rtc_base/win/create_direct3d_device_gn",
-        "/third_party/libwebrtc/rtc_base/win/get_activation_factory_gn",
-        "/third_party/libwebrtc/rtc_base/win/hstring_gn",
-        "/third_party/libwebrtc/rtc_base/win/windows_version_gn",
-        "/third_party/libwebrtc/rtc_base/win32_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DIRS += [
-        "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
-        "/third_party/libwebrtc/common_audio/common_audio_neon_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "arm":
-
-    DIRS += [
-        "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
-        "/third_party/libwebrtc/common_audio/common_audio_neon_gn",
-        "/third_party/libwebrtc/rtc_base/system/asm_defines_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    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/audio_processing/agc2/rnn_vad/vector_math_avx2_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    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/audio_processing/agc2/rnn_vad/vector_math_avx2_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DIRS += [
-        "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
-        "/third_party/libwebrtc/common_audio/common_audio_neon_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    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/audio_processing/agc2/rnn_vad/vector_math_avx2_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
+if CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "aarch64":
 
     DIRS += [
         "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
         "/third_party/libwebrtc/common_audio/common_audio_neon_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/modules/portal/portal_gn",
         "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
+if CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "mips32":
 
     DIRS += [
-        "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
-        "/third_party/libwebrtc/common_audio/common_audio_neon_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
-        "/third_party/libwebrtc/modules/portal/portal_gn",
-        "/third_party/libwebrtc/rtc_base/system/asm_defines_gn",
-        "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "mips32":
-
-    DIRS += [
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/modules/portal/portal_gn",
         "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "mips64":
+if CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "mips64":
 
     DIRS += [
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/modules/portal/portal_gn",
         "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "x86":
 
     DIRS += [
         "/third_party/libwebrtc/common_audio/common_audio_avx2_gn",
@@ -656,13 +550,11 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
         "/third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn",
         "/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2_gn",
         "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/modules/portal/portal_gn",
         "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["OS_TARGET"] == "FreeBSD" and CONFIG["TARGET_CPU"] == "x86_64":
 
     DIRS += [
         "/third_party/libwebrtc/common_audio/common_audio_avx2_gn",
@@ -670,73 +562,6 @@ if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
         "/third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn",
         "/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2_gn",
         "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/modules/portal/portal_gn",
         "/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn"
     ]
-
-if CONFIG["OS_TARGET"] == "OpenBSD" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DIRS += [
-        "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
-        "/third_party/libwebrtc/common_audio/common_audio_neon_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "OpenBSD" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    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/audio_processing/agc2/rnn_vad/vector_math_avx2_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "WINNT" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DIRS += [
-        "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
-        "/third_party/libwebrtc/common_audio/common_audio_neon_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "WINNT" and CONFIG["TARGET_CPU"] == "x86":
-
-    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/audio_processing/agc2/rnn_vad/vector_math_avx2_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn"
-    ]
-
-if CONFIG["OS_TARGET"] == "WINNT" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    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/audio_processing/agc2/rnn_vad/vector_math_avx2_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn"
-    ]
-
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DIRS += [
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
-    ]
-
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "ppc64":
-
-    DIRS += [
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
-    ]
-
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "riscv64":
-
-    DIRS += [
-        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
-        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
-    ]
diff --git third_party/libwebrtc/net/dcsctp/common/internal_types_gn/moz.build third_party/libwebrtc/net/dcsctp/common/internal_types_gn/moz.build
index a2ef7098a26f..1e8a475473f4 100644
--- third_party/libwebrtc/net/dcsctp/common/internal_types_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/common/internal_types_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("internal_types_gn")
diff --git third_party/libwebrtc/net/dcsctp/common/math_gn/moz.build third_party/libwebrtc/net/dcsctp/common/math_gn/moz.build
index 6be46fd27bf6..400de7c7e0e2 100644
--- third_party/libwebrtc/net/dcsctp/common/math_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/common/math_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("math_gn")
diff --git third_party/libwebrtc/net/dcsctp/common/sequence_numbers_gn/moz.build third_party/libwebrtc/net/dcsctp/common/sequence_numbers_gn/moz.build
index 4a44c05a257b..c073abe0d419 100644
--- third_party/libwebrtc/net/dcsctp/common/sequence_numbers_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/common/sequence_numbers_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("sequence_numbers_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/bounded_io_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/bounded_io_gn/moz.build
index 35f9304a8ad6..9bc9113555e5 100644
--- third_party/libwebrtc/net/dcsctp/packet/bounded_io_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/bounded_io_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("bounded_io_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/chunk_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/chunk_gn/moz.build
index 24a6a24e0850..21dfb53299c9 100644
--- third_party/libwebrtc/net/dcsctp/packet/chunk_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/chunk_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -63,93 +72,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -157,82 +80,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("chunk_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/chunk_validators_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/chunk_validators_gn/moz.build
index 9f8072ccbb75..7af95f92aa07 100644
--- third_party/libwebrtc/net/dcsctp/packet/chunk_validators_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/chunk_validators_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("chunk_validators_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/crc32c_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/crc32c_gn/moz.build
index 5d73b1db51a4..b41b8efa0ee2 100644
--- third_party/libwebrtc/net/dcsctp/packet/crc32c_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/crc32c_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("crc32c_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/data_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/data_gn/moz.build
index 1c7b585c2926..6c8a16c55f90 100644
--- third_party/libwebrtc/net/dcsctp/packet/data_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/data_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("data_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/error_cause_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/error_cause_gn/moz.build
index b905fa35f1fe..0746b390cdbd 100644
--- third_party/libwebrtc/net/dcsctp/packet/error_cause_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/error_cause_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -59,93 +68,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -153,82 +76,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("error_cause_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/parameter_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/parameter_gn/moz.build
index 287f439c6c0f..a7fcad364e6e 100644
--- third_party/libwebrtc/net/dcsctp/packet/parameter_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/parameter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -57,93 +66,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -151,82 +74,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("parameter_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/sctp_packet_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/sctp_packet_gn/moz.build
index 58f18e34123b..d40508c6cbb6 100644
--- third_party/libwebrtc/net/dcsctp/packet/sctp_packet_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/sctp_packet_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("sctp_packet_gn")
diff --git third_party/libwebrtc/net/dcsctp/packet/tlv_trait_gn/moz.build third_party/libwebrtc/net/dcsctp/packet/tlv_trait_gn/moz.build
index 102e2a7ffedc..01ec317b6b9e 100644
--- third_party/libwebrtc/net/dcsctp/packet/tlv_trait_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/packet/tlv_trait_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("tlv_trait_gn")
diff --git third_party/libwebrtc/net/dcsctp/public/factory_gn/moz.build third_party/libwebrtc/net/dcsctp/public/factory_gn/moz.build
index ec8ad25e6576..88e84b3e84a8 100644
--- third_party/libwebrtc/net/dcsctp/public/factory_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/public/factory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("factory_gn")
diff --git third_party/libwebrtc/net/dcsctp/public/socket_gn/moz.build third_party/libwebrtc/net/dcsctp/public/socket_gn/moz.build
index f6bde482dd40..db4159f8c467 100644
--- third_party/libwebrtc/net/dcsctp/public/socket_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/public/socket_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("socket_gn")
diff --git third_party/libwebrtc/net/dcsctp/public/types_gn/moz.build third_party/libwebrtc/net/dcsctp/public/types_gn/moz.build
index ec5c0d8b1d8e..b63c73c26ce7 100644
--- third_party/libwebrtc/net/dcsctp/public/types_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/public/types_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("types_gn")
diff --git third_party/libwebrtc/net/dcsctp/rx/data_tracker_gn/moz.build third_party/libwebrtc/net/dcsctp/rx/data_tracker_gn/moz.build
index 2f36a17ef96e..42cdf1668378 100644
--- third_party/libwebrtc/net/dcsctp/rx/data_tracker_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/rx/data_tracker_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("data_tracker_gn")
diff --git third_party/libwebrtc/net/dcsctp/rx/interleaved_reassembly_streams_gn/moz.build third_party/libwebrtc/net/dcsctp/rx/interleaved_reassembly_streams_gn/moz.build
index 01fdbebef3f1..78750a2c45d7 100644
--- third_party/libwebrtc/net/dcsctp/rx/interleaved_reassembly_streams_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/rx/interleaved_reassembly_streams_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("interleaved_reassembly_streams_gn")
diff --git third_party/libwebrtc/net/dcsctp/rx/reassembly_queue_gn/moz.build third_party/libwebrtc/net/dcsctp/rx/reassembly_queue_gn/moz.build
index abb5e61463bb..ca8b574b754c 100644
--- third_party/libwebrtc/net/dcsctp/rx/reassembly_queue_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/rx/reassembly_queue_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("reassembly_queue_gn")
diff --git third_party/libwebrtc/net/dcsctp/rx/reassembly_streams_gn/moz.build third_party/libwebrtc/net/dcsctp/rx/reassembly_streams_gn/moz.build
index 5c644b5665bd..d1b59bdd2da1 100644
--- third_party/libwebrtc/net/dcsctp/rx/reassembly_streams_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/rx/reassembly_streams_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("reassembly_streams_gn")
diff --git third_party/libwebrtc/net/dcsctp/rx/traditional_reassembly_streams_gn/moz.build third_party/libwebrtc/net/dcsctp/rx/traditional_reassembly_streams_gn/moz.build
index b60265ff2dec..10b2024e6c32 100644
--- third_party/libwebrtc/net/dcsctp/rx/traditional_reassembly_streams_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/rx/traditional_reassembly_streams_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("traditional_reassembly_streams_gn")
diff --git third_party/libwebrtc/net/dcsctp/socket/context_gn/moz.build third_party/libwebrtc/net/dcsctp/socket/context_gn/moz.build
index c5353dc2fcc8..34abeccb759b 100644
--- third_party/libwebrtc/net/dcsctp/socket/context_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/socket/context_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("context_gn")
diff --git third_party/libwebrtc/net/dcsctp/socket/dcsctp_socket_gn/moz.build third_party/libwebrtc/net/dcsctp/socket/dcsctp_socket_gn/moz.build
index bc87aa461b0d..4ae0b2d6bff5 100644
--- third_party/libwebrtc/net/dcsctp/socket/dcsctp_socket_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/socket/dcsctp_socket_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,93 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("dcsctp_socket_gn")
diff --git third_party/libwebrtc/net/dcsctp/socket/heartbeat_handler_gn/moz.build third_party/libwebrtc/net/dcsctp/socket/heartbeat_handler_gn/moz.build
index 4106ee13d217..a3f8705427b1 100644
--- third_party/libwebrtc/net/dcsctp/socket/heartbeat_handler_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/socket/heartbeat_handler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("heartbeat_handler_gn")
diff --git third_party/libwebrtc/net/dcsctp/socket/packet_sender_gn/moz.build third_party/libwebrtc/net/dcsctp/socket/packet_sender_gn/moz.build
index c900f2fd9491..70830cfb07de 100644
--- third_party/libwebrtc/net/dcsctp/socket/packet_sender_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/socket/packet_sender_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("packet_sender_gn")
diff --git third_party/libwebrtc/net/dcsctp/socket/stream_reset_handler_gn/moz.build third_party/libwebrtc/net/dcsctp/socket/stream_reset_handler_gn/moz.build
index 737f639236a3..e5f4c3f7489a 100644
--- third_party/libwebrtc/net/dcsctp/socket/stream_reset_handler_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/socket/stream_reset_handler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("stream_reset_handler_gn")
diff --git third_party/libwebrtc/net/dcsctp/socket/transmission_control_block_gn/moz.build third_party/libwebrtc/net/dcsctp/socket/transmission_control_block_gn/moz.build
index f9cd1cdea19c..96f1c1bf0f2c 100644
--- third_party/libwebrtc/net/dcsctp/socket/transmission_control_block_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/socket/transmission_control_block_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("transmission_control_block_gn")
diff --git third_party/libwebrtc/net/dcsctp/timer/task_queue_timeout_gn/moz.build third_party/libwebrtc/net/dcsctp/timer/task_queue_timeout_gn/moz.build
index 6fcab1231d30..5c9317afe4d3 100644
--- third_party/libwebrtc/net/dcsctp/timer/task_queue_timeout_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/timer/task_queue_timeout_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("task_queue_timeout_gn")
diff --git third_party/libwebrtc/net/dcsctp/timer/timer_gn/moz.build third_party/libwebrtc/net/dcsctp/timer/timer_gn/moz.build
index df73a1896e86..719a013e1786 100644
--- third_party/libwebrtc/net/dcsctp/timer/timer_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/timer/timer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("timer_gn")
diff --git third_party/libwebrtc/net/dcsctp/tx/outstanding_data_gn/moz.build third_party/libwebrtc/net/dcsctp/tx/outstanding_data_gn/moz.build
index df2340a8c348..3451c619b955 100644
--- third_party/libwebrtc/net/dcsctp/tx/outstanding_data_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/tx/outstanding_data_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("outstanding_data_gn")
diff --git third_party/libwebrtc/net/dcsctp/tx/retransmission_error_counter_gn/moz.build third_party/libwebrtc/net/dcsctp/tx/retransmission_error_counter_gn/moz.build
index 24095b9b7822..89c34a2b8d23 100644
--- third_party/libwebrtc/net/dcsctp/tx/retransmission_error_counter_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/tx/retransmission_error_counter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("retransmission_error_counter_gn")
diff --git third_party/libwebrtc/net/dcsctp/tx/retransmission_queue_gn/moz.build third_party/libwebrtc/net/dcsctp/tx/retransmission_queue_gn/moz.build
index d79764e11a90..2265d6f5a636 100644
--- third_party/libwebrtc/net/dcsctp/tx/retransmission_queue_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/tx/retransmission_queue_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("retransmission_queue_gn")
diff --git third_party/libwebrtc/net/dcsctp/tx/retransmission_timeout_gn/moz.build third_party/libwebrtc/net/dcsctp/tx/retransmission_timeout_gn/moz.build
index 01617b6f94ad..4ea9e30a8326 100644
--- third_party/libwebrtc/net/dcsctp/tx/retransmission_timeout_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/tx/retransmission_timeout_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("retransmission_timeout_gn")
diff --git third_party/libwebrtc/net/dcsctp/tx/rr_send_queue_gn/moz.build third_party/libwebrtc/net/dcsctp/tx/rr_send_queue_gn/moz.build
index 2b0975a91d11..241a5bce6bed 100644
--- third_party/libwebrtc/net/dcsctp/tx/rr_send_queue_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/tx/rr_send_queue_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rr_send_queue_gn")
diff --git third_party/libwebrtc/net/dcsctp/tx/send_queue_gn/moz.build third_party/libwebrtc/net/dcsctp/tx/send_queue_gn/moz.build
index a30ad32cc439..bf96c2aa78be 100644
--- third_party/libwebrtc/net/dcsctp/tx/send_queue_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/tx/send_queue_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("send_queue_gn")
diff --git third_party/libwebrtc/net/dcsctp/tx/stream_scheduler_gn/moz.build third_party/libwebrtc/net/dcsctp/tx/stream_scheduler_gn/moz.build
index 5452a33e24a7..391eee8efa91 100644
--- third_party/libwebrtc/net/dcsctp/tx/stream_scheduler_gn/moz.build
+++ third_party/libwebrtc/net/dcsctp/tx/stream_scheduler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("stream_scheduler_gn")
diff --git third_party/libwebrtc/rtc_base/async_dns_resolver_gn/moz.build third_party/libwebrtc/rtc_base/async_dns_resolver_gn/moz.build
index 1a25bc4c9c08..88ed8df84a75 100644
--- third_party/libwebrtc/rtc_base/async_dns_resolver_gn/moz.build
+++ third_party/libwebrtc/rtc_base/async_dns_resolver_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("async_dns_resolver_gn")
diff --git third_party/libwebrtc/rtc_base/async_packet_socket_gn/moz.build third_party/libwebrtc/rtc_base/async_packet_socket_gn/moz.build
index be56799b7857..0297bad15075 100644
--- third_party/libwebrtc/rtc_base/async_packet_socket_gn/moz.build
+++ third_party/libwebrtc/rtc_base/async_packet_socket_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("async_packet_socket_gn")
diff --git third_party/libwebrtc/rtc_base/base64_gn/moz.build third_party/libwebrtc/rtc_base/base64_gn/moz.build
index d726a432a8f7..171770ac0390 100644
--- third_party/libwebrtc/rtc_base/base64_gn/moz.build
+++ third_party/libwebrtc/rtc_base/base64_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("base64_gn")
diff --git third_party/libwebrtc/rtc_base/bit_buffer_gn/moz.build third_party/libwebrtc/rtc_base/bit_buffer_gn/moz.build
index 50cb2ab77aea..710d01f74d07 100644
--- third_party/libwebrtc/rtc_base/bit_buffer_gn/moz.build
+++ third_party/libwebrtc/rtc_base/bit_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("bit_buffer_gn")
diff --git third_party/libwebrtc/rtc_base/bitrate_tracker_gn/moz.build third_party/libwebrtc/rtc_base/bitrate_tracker_gn/moz.build
index b9f2220d4f48..6924940a7cf4 100644
--- third_party/libwebrtc/rtc_base/bitrate_tracker_gn/moz.build
+++ third_party/libwebrtc/rtc_base/bitrate_tracker_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("bitrate_tracker_gn")
diff --git third_party/libwebrtc/rtc_base/bitstream_reader_gn/moz.build third_party/libwebrtc/rtc_base/bitstream_reader_gn/moz.build
index 26817ca09a7d..226a24f7107e 100644
--- third_party/libwebrtc/rtc_base/bitstream_reader_gn/moz.build
+++ third_party/libwebrtc/rtc_base/bitstream_reader_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("bitstream_reader_gn")
diff --git third_party/libwebrtc/rtc_base/buffer_gn/moz.build third_party/libwebrtc/rtc_base/buffer_gn/moz.build
index a454fcb0ee69..2925b692abfc 100644
--- third_party/libwebrtc/rtc_base/buffer_gn/moz.build
+++ third_party/libwebrtc/rtc_base/buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("buffer_gn")
diff --git third_party/libwebrtc/rtc_base/byte_buffer_gn/moz.build third_party/libwebrtc/rtc_base/byte_buffer_gn/moz.build
index 23d723da5d0b..0cf3653ec23b 100644
--- third_party/libwebrtc/rtc_base/byte_buffer_gn/moz.build
+++ third_party/libwebrtc/rtc_base/byte_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("byte_buffer_gn")
diff --git third_party/libwebrtc/rtc_base/byte_order_gn/moz.build third_party/libwebrtc/rtc_base/byte_order_gn/moz.build
index 74f384c22bb6..0e5f9e105309 100644
--- third_party/libwebrtc/rtc_base/byte_order_gn/moz.build
+++ third_party/libwebrtc/rtc_base/byte_order_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("byte_order_gn")
diff --git third_party/libwebrtc/rtc_base/checks_gn/moz.build third_party/libwebrtc/rtc_base/checks_gn/moz.build
index 8e1b70c997d0..3f23845f5297 100644
--- third_party/libwebrtc/rtc_base/checks_gn/moz.build
+++ third_party/libwebrtc/rtc_base/checks_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("checks_gn")
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 88cee7f44516..76da6d251187 100644
--- third_party/libwebrtc/rtc_base/compile_assert_c_gn/moz.build
+++ third_party/libwebrtc/rtc_base/compile_assert_c_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("compile_assert_c_gn")
diff --git third_party/libwebrtc/rtc_base/containers/flat_containers_internal_gn/moz.build third_party/libwebrtc/rtc_base/containers/flat_containers_internal_gn/moz.build
index c7bd4f21f6e3..ebd7d2e99290 100644
--- third_party/libwebrtc/rtc_base/containers/flat_containers_internal_gn/moz.build
+++ third_party/libwebrtc/rtc_base/containers/flat_containers_internal_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("flat_containers_internal_gn")
diff --git third_party/libwebrtc/rtc_base/containers/flat_map_gn/moz.build third_party/libwebrtc/rtc_base/containers/flat_map_gn/moz.build
index a0c76957de3d..ccb70c641b40 100644
--- third_party/libwebrtc/rtc_base/containers/flat_map_gn/moz.build
+++ third_party/libwebrtc/rtc_base/containers/flat_map_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("flat_map_gn")
diff --git third_party/libwebrtc/rtc_base/containers/flat_set_gn/moz.build third_party/libwebrtc/rtc_base/containers/flat_set_gn/moz.build
index 9705d844e9e6..c603c3162a19 100644
--- third_party/libwebrtc/rtc_base/containers/flat_set_gn/moz.build
+++ third_party/libwebrtc/rtc_base/containers/flat_set_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("flat_set_gn")
diff --git third_party/libwebrtc/rtc_base/copy_on_write_buffer_gn/moz.build third_party/libwebrtc/rtc_base/copy_on_write_buffer_gn/moz.build
index 7c795ea71573..f9d453b462bf 100644
--- third_party/libwebrtc/rtc_base/copy_on_write_buffer_gn/moz.build
+++ third_party/libwebrtc/rtc_base/copy_on_write_buffer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("copy_on_write_buffer_gn")
diff --git third_party/libwebrtc/rtc_base/cpu_info_gn/moz.build third_party/libwebrtc/rtc_base/cpu_info_gn/moz.build
index 2b0cf4fb67b1..0e53770baf5f 100644
--- third_party/libwebrtc/rtc_base/cpu_info_gn/moz.build
+++ third_party/libwebrtc/rtc_base/cpu_info_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("cpu_info_gn")
diff --git third_party/libwebrtc/rtc_base/criticalsection_gn/moz.build third_party/libwebrtc/rtc_base/criticalsection_gn/moz.build
index c032b1a986a3..3a591ec6e96c 100644
--- third_party/libwebrtc/rtc_base/criticalsection_gn/moz.build
+++ third_party/libwebrtc/rtc_base/criticalsection_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("criticalsection_gn")
diff --git third_party/libwebrtc/rtc_base/denormal_disabler_gn/moz.build third_party/libwebrtc/rtc_base/denormal_disabler_gn/moz.build
index 266f0b403372..a7632439b491 100644
--- third_party/libwebrtc/rtc_base/denormal_disabler_gn/moz.build
+++ third_party/libwebrtc/rtc_base/denormal_disabler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("denormal_disabler_gn")
diff --git third_party/libwebrtc/rtc_base/divide_round_gn/moz.build third_party/libwebrtc/rtc_base/divide_round_gn/moz.build
index f947044a70c5..cef2ec4afcd9 100644
--- third_party/libwebrtc/rtc_base/divide_round_gn/moz.build
+++ third_party/libwebrtc/rtc_base/divide_round_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("divide_round_gn")
diff --git third_party/libwebrtc/rtc_base/dscp_gn/moz.build third_party/libwebrtc/rtc_base/dscp_gn/moz.build
index a21e8af3a982..d16a56b3c8be 100644
--- third_party/libwebrtc/rtc_base/dscp_gn/moz.build
+++ third_party/libwebrtc/rtc_base/dscp_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("dscp_gn")
diff --git third_party/libwebrtc/rtc_base/event_tracer_gn/moz.build third_party/libwebrtc/rtc_base/event_tracer_gn/moz.build
index d70f8d5bf102..0ed150dc70b7 100644
--- third_party/libwebrtc/rtc_base/event_tracer_gn/moz.build
+++ third_party/libwebrtc/rtc_base/event_tracer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("event_tracer_gn")
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 d5ccba752185..1353fd9971e1 100644
--- third_party/libwebrtc/rtc_base/experiments/alr_experiment_gn/moz.build
+++ third_party/libwebrtc/rtc_base/experiments/alr_experiment_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("alr_experiment_gn")
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 cce401c6f0b3..55178aa20743 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("balanced_degradation_settings_gn")
diff --git third_party/libwebrtc/rtc_base/experiments/encoder_info_settings_gn/moz.build third_party/libwebrtc/rtc_base/experiments/encoder_info_settings_gn/moz.build
index ebeb77db3013..bf97dcb17792 100644
--- third_party/libwebrtc/rtc_base/experiments/encoder_info_settings_gn/moz.build
+++ third_party/libwebrtc/rtc_base/experiments/encoder_info_settings_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("encoder_info_settings_gn")
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 c6806c13de0a..18300e83b968 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,93 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -143,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("field_trial_parser_gn")
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 75a2fd41366c..ea85ffff3111 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("keyframe_interval_settings_experiment_gn")
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 07a834739abc..6526a4d69c90 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("min_video_bitrate_experiment_gn")
diff --git third_party/libwebrtc/rtc_base/experiments/normalize_simulcast_size_experiment_gn/moz.build third_party/libwebrtc/rtc_base/experiments/normalize_simulcast_size_experiment_gn/moz.build
index c804a04edc64..6270ba546b1f 100644
--- third_party/libwebrtc/rtc_base/experiments/normalize_simulcast_size_experiment_gn/moz.build
+++ third_party/libwebrtc/rtc_base/experiments/normalize_simulcast_size_experiment_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("normalize_simulcast_size_experiment_gn")
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 4b8ce6541aad..fca99f2e0a66 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("quality_scaler_settings_gn")
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 0930ef0477bc..175e3ff531e2 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("quality_scaling_experiment_gn")
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 be79eb29ffe7..092a2cb2d143 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
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rate_control_settings_gn")
diff --git third_party/libwebrtc/rtc_base/frequency_tracker_gn/moz.build third_party/libwebrtc/rtc_base/frequency_tracker_gn/moz.build
index 6172f4d96dfa..ad4e108a796b 100644
--- third_party/libwebrtc/rtc_base/frequency_tracker_gn/moz.build
+++ third_party/libwebrtc/rtc_base/frequency_tracker_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frequency_tracker_gn")
diff --git third_party/libwebrtc/rtc_base/gtest_prod_gn/moz.build third_party/libwebrtc/rtc_base/gtest_prod_gn/moz.build
index 82a66f9119cd..96a8ea39c266 100644
--- third_party/libwebrtc/rtc_base/gtest_prod_gn/moz.build
+++ third_party/libwebrtc/rtc_base/gtest_prod_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("gtest_prod_gn")
diff --git third_party/libwebrtc/rtc_base/histogram_percentile_counter_gn/moz.build third_party/libwebrtc/rtc_base/histogram_percentile_counter_gn/moz.build
index 833688440249..f10a11715812 100644
--- third_party/libwebrtc/rtc_base/histogram_percentile_counter_gn/moz.build
+++ third_party/libwebrtc/rtc_base/histogram_percentile_counter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("histogram_percentile_counter_gn")
diff --git third_party/libwebrtc/rtc_base/ifaddrs_android_gn/moz.build third_party/libwebrtc/rtc_base/ifaddrs_android_gn/moz.build
deleted file mode 100644
index 7b10ad2fedfe..000000000000
--- third_party/libwebrtc/rtc_base/ifaddrs_android_gn/moz.build
+++ /dev/null
@@ -1,95 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["ANDROID"] = True
-DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-DEFINES["HAVE_SYS_UIO_H"] = True
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ANDROID"] = True
-DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_LINUX"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["_GNU_SOURCE"] = True
-DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-OS_LIBS += [
-    "GLESv2",
-    "log"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/rtc_base/ifaddrs_android.cc"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("ifaddrs_android_gn")
diff --git third_party/libwebrtc/rtc_base/ignore_wundef_gn/moz.build third_party/libwebrtc/rtc_base/ignore_wundef_gn/moz.build
index 6456e230bfa9..8d9f02cb22b4 100644
--- third_party/libwebrtc/rtc_base/ignore_wundef_gn/moz.build
+++ third_party/libwebrtc/rtc_base/ignore_wundef_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("ignore_wundef_gn")
diff --git third_party/libwebrtc/rtc_base/ip_address_gn/moz.build third_party/libwebrtc/rtc_base/ip_address_gn/moz.build
index 202fd27525b6..77529d538252 100644
--- third_party/libwebrtc/rtc_base/ip_address_gn/moz.build
+++ third_party/libwebrtc/rtc_base/ip_address_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("ip_address_gn")
diff --git third_party/libwebrtc/rtc_base/logging_gn/moz.build third_party/libwebrtc/rtc_base/logging_gn/moz.build
index 659c105eeb02..d4b59daa7d6f 100644
--- third_party/libwebrtc/rtc_base/logging_gn/moz.build
+++ third_party/libwebrtc/rtc_base/logging_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
 DEFINES["WEBRTC_APM_DEBUG_DUMP"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,93 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("logging_gn")
diff --git third_party/libwebrtc/rtc_base/macromagic_gn/moz.build third_party/libwebrtc/rtc_base/macromagic_gn/moz.build
index c12cf66ea418..ca5ca6a0d967 100644
--- third_party/libwebrtc/rtc_base/macromagic_gn/moz.build
+++ third_party/libwebrtc/rtc_base/macromagic_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("macromagic_gn")
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 764b220dcf8f..2a12495bcdf6 100644
--- third_party/libwebrtc/rtc_base/memory/aligned_malloc_gn/moz.build
+++ third_party/libwebrtc/rtc_base/memory/aligned_malloc_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("aligned_malloc_gn")
diff --git third_party/libwebrtc/rtc_base/mod_ops_gn/moz.build third_party/libwebrtc/rtc_base/mod_ops_gn/moz.build
index 0750ed9e64f9..e741274c96a3 100644
--- third_party/libwebrtc/rtc_base/mod_ops_gn/moz.build
+++ third_party/libwebrtc/rtc_base/mod_ops_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("mod_ops_gn")
diff --git third_party/libwebrtc/rtc_base/moving_max_counter_gn/moz.build third_party/libwebrtc/rtc_base/moving_max_counter_gn/moz.build
index 5461d491dff4..3f8532394ef4 100644
--- third_party/libwebrtc/rtc_base/moving_max_counter_gn/moz.build
+++ third_party/libwebrtc/rtc_base/moving_max_counter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("moving_max_counter_gn")
diff --git third_party/libwebrtc/rtc_base/net_helpers_gn/moz.build third_party/libwebrtc/rtc_base/net_helpers_gn/moz.build
index 9ec122a9ce5f..27ce5039d3c6 100644
--- third_party/libwebrtc/rtc_base/net_helpers_gn/moz.build
+++ third_party/libwebrtc/rtc_base/net_helpers_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("net_helpers_gn")
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 d3b3da72d146..c44bd3b53ae0 100644
--- third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build
+++ third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("sent_packet_gn")
diff --git third_party/libwebrtc/rtc_base/network_constants_gn/moz.build third_party/libwebrtc/rtc_base/network_constants_gn/moz.build
index 31053e12ea4a..fe1e8a9ea932 100644
--- third_party/libwebrtc/rtc_base/network_constants_gn/moz.build
+++ third_party/libwebrtc/rtc_base/network_constants_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("network_constants_gn")
diff --git third_party/libwebrtc/rtc_base/network_route_gn/moz.build third_party/libwebrtc/rtc_base/network_route_gn/moz.build
index 06557cf9497d..db90cbe755bb 100644
--- third_party/libwebrtc/rtc_base/network_route_gn/moz.build
+++ third_party/libwebrtc/rtc_base/network_route_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("network_route_gn")
diff --git third_party/libwebrtc/rtc_base/null_socket_server_gn/moz.build third_party/libwebrtc/rtc_base/null_socket_server_gn/moz.build
index beffd8445b78..693b43b106dc 100644
--- third_party/libwebrtc/rtc_base/null_socket_server_gn/moz.build
+++ third_party/libwebrtc/rtc_base/null_socket_server_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("null_socket_server_gn")
diff --git third_party/libwebrtc/rtc_base/one_time_event_gn/moz.build third_party/libwebrtc/rtc_base/one_time_event_gn/moz.build
index df5836570385..150831277c97 100644
--- third_party/libwebrtc/rtc_base/one_time_event_gn/moz.build
+++ third_party/libwebrtc/rtc_base/one_time_event_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("one_time_event_gn")
diff --git third_party/libwebrtc/rtc_base/platform_thread_gn/moz.build third_party/libwebrtc/rtc_base/platform_thread_gn/moz.build
index 9df9a5970796..96b61f54cadd 100644
--- third_party/libwebrtc/rtc_base/platform_thread_gn/moz.build
+++ third_party/libwebrtc/rtc_base/platform_thread_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("platform_thread_gn")
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 483fc3f4157a..de5e498e7276 100644
--- third_party/libwebrtc/rtc_base/platform_thread_types_gn/moz.build
+++ third_party/libwebrtc/rtc_base/platform_thread_types_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("platform_thread_types_gn")
diff --git third_party/libwebrtc/rtc_base/protobuf_utils_gn/moz.build third_party/libwebrtc/rtc_base/protobuf_utils_gn/moz.build
index 978991e022cc..9b750326f9fd 100644
--- third_party/libwebrtc/rtc_base/protobuf_utils_gn/moz.build
+++ third_party/libwebrtc/rtc_base/protobuf_utils_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("protobuf_utils_gn")
diff --git third_party/libwebrtc/rtc_base/race_checker_gn/moz.build third_party/libwebrtc/rtc_base/race_checker_gn/moz.build
index 40f116cdf02f..fd5b113818a0 100644
--- third_party/libwebrtc/rtc_base/race_checker_gn/moz.build
+++ third_party/libwebrtc/rtc_base/race_checker_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("race_checker_gn")
diff --git third_party/libwebrtc/rtc_base/random_gn/moz.build third_party/libwebrtc/rtc_base/random_gn/moz.build
index 91128f649d33..994b0123cb5b 100644
--- third_party/libwebrtc/rtc_base/random_gn/moz.build
+++ third_party/libwebrtc/rtc_base/random_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("random_gn")
diff --git third_party/libwebrtc/rtc_base/rate_limiter_gn/moz.build third_party/libwebrtc/rtc_base/rate_limiter_gn/moz.build
index e41ea09b0ea2..4599539f7bbd 100644
--- third_party/libwebrtc/rtc_base/rate_limiter_gn/moz.build
+++ third_party/libwebrtc/rtc_base/rate_limiter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rate_limiter_gn")
diff --git third_party/libwebrtc/rtc_base/rate_statistics_gn/moz.build third_party/libwebrtc/rtc_base/rate_statistics_gn/moz.build
index 71d485c13568..a544f01597c0 100644
--- third_party/libwebrtc/rtc_base/rate_statistics_gn/moz.build
+++ third_party/libwebrtc/rtc_base/rate_statistics_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rate_statistics_gn")
diff --git third_party/libwebrtc/rtc_base/rate_tracker_gn/moz.build third_party/libwebrtc/rtc_base/rate_tracker_gn/moz.build
index 75698c8db945..c4fea54c2bff 100644
--- third_party/libwebrtc/rtc_base/rate_tracker_gn/moz.build
+++ third_party/libwebrtc/rtc_base/rate_tracker_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rate_tracker_gn")
diff --git third_party/libwebrtc/rtc_base/refcount_gn/moz.build third_party/libwebrtc/rtc_base/refcount_gn/moz.build
index 310f48f6fe48..7967acbb2978 100644
--- third_party/libwebrtc/rtc_base/refcount_gn/moz.build
+++ third_party/libwebrtc/rtc_base/refcount_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("refcount_gn")
diff --git third_party/libwebrtc/rtc_base/rolling_accumulator_gn/moz.build third_party/libwebrtc/rtc_base/rolling_accumulator_gn/moz.build
index 8e1ad3270d6a..c1de16b7663d 100644
--- third_party/libwebrtc/rtc_base/rolling_accumulator_gn/moz.build
+++ third_party/libwebrtc/rtc_base/rolling_accumulator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rolling_accumulator_gn")
diff --git third_party/libwebrtc/rtc_base/rtc_event_gn/moz.build third_party/libwebrtc/rtc_base/rtc_event_gn/moz.build
index 5a2ddf7b5535..52f42d277da4 100644
--- third_party/libwebrtc/rtc_base/rtc_event_gn/moz.build
+++ third_party/libwebrtc/rtc_base/rtc_event_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_event_gn")
diff --git third_party/libwebrtc/rtc_base/rtc_numerics_gn/moz.build third_party/libwebrtc/rtc_base/rtc_numerics_gn/moz.build
index 31383355abe5..41f7c59fb1c4 100644
--- third_party/libwebrtc/rtc_base/rtc_numerics_gn/moz.build
+++ third_party/libwebrtc/rtc_base/rtc_numerics_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,86 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -135,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtc_numerics_gn")
diff --git third_party/libwebrtc/rtc_base/rtp_to_ntp_estimator_gn/moz.build third_party/libwebrtc/rtc_base/rtp_to_ntp_estimator_gn/moz.build
index 6f2a3c9ce63d..ee9aa8bf7c35 100644
--- third_party/libwebrtc/rtc_base/rtp_to_ntp_estimator_gn/moz.build
+++ third_party/libwebrtc/rtc_base/rtp_to_ntp_estimator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("rtp_to_ntp_estimator_gn")
diff --git third_party/libwebrtc/rtc_base/safe_compare_gn/moz.build third_party/libwebrtc/rtc_base/safe_compare_gn/moz.build
index 1fccec1b3d1d..7a289dcd81cb 100644
--- third_party/libwebrtc/rtc_base/safe_compare_gn/moz.build
+++ third_party/libwebrtc/rtc_base/safe_compare_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("safe_compare_gn")
diff --git third_party/libwebrtc/rtc_base/safe_conversions_gn/moz.build third_party/libwebrtc/rtc_base/safe_conversions_gn/moz.build
index 4b1fe52dbb29..37d087dca314 100644
--- third_party/libwebrtc/rtc_base/safe_conversions_gn/moz.build
+++ third_party/libwebrtc/rtc_base/safe_conversions_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("safe_conversions_gn")
diff --git third_party/libwebrtc/rtc_base/safe_minmax_gn/moz.build third_party/libwebrtc/rtc_base/safe_minmax_gn/moz.build
index 19c9d560e6b0..b02b90eb7f8a 100644
--- third_party/libwebrtc/rtc_base/safe_minmax_gn/moz.build
+++ third_party/libwebrtc/rtc_base/safe_minmax_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("safe_minmax_gn")
diff --git third_party/libwebrtc/rtc_base/sample_counter_gn/moz.build third_party/libwebrtc/rtc_base/sample_counter_gn/moz.build
index 2d6ffc700392..5657837196da 100644
--- third_party/libwebrtc/rtc_base/sample_counter_gn/moz.build
+++ third_party/libwebrtc/rtc_base/sample_counter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("sample_counter_gn")
diff --git third_party/libwebrtc/rtc_base/sanitizer_gn/moz.build third_party/libwebrtc/rtc_base/sanitizer_gn/moz.build
index 89ba6be7893d..65fc7a6bdcca 100644
--- third_party/libwebrtc/rtc_base/sanitizer_gn/moz.build
+++ third_party/libwebrtc/rtc_base/sanitizer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("sanitizer_gn")
diff --git third_party/libwebrtc/rtc_base/socket_address_gn/moz.build third_party/libwebrtc/rtc_base/socket_address_gn/moz.build
index 41f48aed0ade..0a3d78361f9c 100644
--- third_party/libwebrtc/rtc_base/socket_address_gn/moz.build
+++ third_party/libwebrtc/rtc_base/socket_address_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("socket_address_gn")
diff --git third_party/libwebrtc/rtc_base/socket_factory_gn/moz.build third_party/libwebrtc/rtc_base/socket_factory_gn/moz.build
index 7bb549d27ba9..4a07e285ccb1 100644
--- third_party/libwebrtc/rtc_base/socket_factory_gn/moz.build
+++ third_party/libwebrtc/rtc_base/socket_factory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("socket_factory_gn")
diff --git third_party/libwebrtc/rtc_base/socket_gn/moz.build third_party/libwebrtc/rtc_base/socket_gn/moz.build
index d2ec55c32168..cccc8cb30d11 100644
--- third_party/libwebrtc/rtc_base/socket_gn/moz.build
+++ third_party/libwebrtc/rtc_base/socket_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("socket_gn")
diff --git third_party/libwebrtc/rtc_base/socket_server_gn/moz.build third_party/libwebrtc/rtc_base/socket_server_gn/moz.build
index ac5a10fa4495..4d79666d6d70 100644
--- third_party/libwebrtc/rtc_base/socket_server_gn/moz.build
+++ third_party/libwebrtc/rtc_base/socket_server_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("socket_server_gn")
diff --git third_party/libwebrtc/rtc_base/ssl_adapter_gn/moz.build third_party/libwebrtc/rtc_base/ssl_adapter_gn/moz.build
index d8170674c353..c2cf27cc74ea 100644
--- third_party/libwebrtc/rtc_base/ssl_adapter_gn/moz.build
+++ third_party/libwebrtc/rtc_base/ssl_adapter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("ssl_adapter_gn")
diff --git third_party/libwebrtc/rtc_base/stringutils_gn/moz.build third_party/libwebrtc/rtc_base/stringutils_gn/moz.build
index 138bd260049f..204742c0f9e7 100644
--- third_party/libwebrtc/rtc_base/stringutils_gn/moz.build
+++ third_party/libwebrtc/rtc_base/stringutils_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -50,86 +59,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,82 +67,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("stringutils_gn")
diff --git third_party/libwebrtc/rtc_base/strong_alias_gn/moz.build third_party/libwebrtc/rtc_base/strong_alias_gn/moz.build
index 6eaec231f687..274bcc3ee6a5 100644
--- third_party/libwebrtc/rtc_base/strong_alias_gn/moz.build
+++ third_party/libwebrtc/rtc_base/strong_alias_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("strong_alias_gn")
diff --git third_party/libwebrtc/rtc_base/swap_queue_gn/moz.build third_party/libwebrtc/rtc_base/swap_queue_gn/moz.build
index 45f5b0fe25db..94b1bec9ec91 100644
--- third_party/libwebrtc/rtc_base/swap_queue_gn/moz.build
+++ third_party/libwebrtc/rtc_base/swap_queue_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("swap_queue_gn")
diff --git third_party/libwebrtc/rtc_base/synchronization/mutex_gn/moz.build third_party/libwebrtc/rtc_base/synchronization/mutex_gn/moz.build
index ddf62c785a8b..38c55315511d 100644
--- third_party/libwebrtc/rtc_base/synchronization/mutex_gn/moz.build
+++ third_party/libwebrtc/rtc_base/synchronization/mutex_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("mutex_gn")
diff --git third_party/libwebrtc/rtc_base/synchronization/sequence_checker_internal_gn/moz.build third_party/libwebrtc/rtc_base/synchronization/sequence_checker_internal_gn/moz.build
index 49fefc605d17..837261699c1f 100644
--- third_party/libwebrtc/rtc_base/synchronization/sequence_checker_internal_gn/moz.build
+++ third_party/libwebrtc/rtc_base/synchronization/sequence_checker_internal_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("sequence_checker_internal_gn")
diff --git third_party/libwebrtc/rtc_base/synchronization/yield_gn/moz.build third_party/libwebrtc/rtc_base/synchronization/yield_gn/moz.build
index a23ba76960b9..7bc90e8a38bc 100644
--- third_party/libwebrtc/rtc_base/synchronization/yield_gn/moz.build
+++ third_party/libwebrtc/rtc_base/synchronization/yield_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("yield_gn")
diff --git third_party/libwebrtc/rtc_base/synchronization/yield_policy_gn/moz.build third_party/libwebrtc/rtc_base/synchronization/yield_policy_gn/moz.build
index bbfc46863f7e..7a3a8c9d8392 100644
--- third_party/libwebrtc/rtc_base/synchronization/yield_policy_gn/moz.build
+++ third_party/libwebrtc/rtc_base/synchronization/yield_policy_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("yield_policy_gn")
diff --git third_party/libwebrtc/rtc_base/system/arch_gn/moz.build third_party/libwebrtc/rtc_base/system/arch_gn/moz.build
index 545f0a4b0e51..aaccd7613890 100644
--- third_party/libwebrtc/rtc_base/system/arch_gn/moz.build
+++ third_party/libwebrtc/rtc_base/system/arch_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("arch_gn")
diff --git third_party/libwebrtc/rtc_base/system/asm_defines_gn/moz.build third_party/libwebrtc/rtc_base/system/asm_defines_gn/moz.build
deleted file mode 100644
index 6941a44d7273..000000000000
--- third_party/libwebrtc/rtc_base/system/asm_defines_gn/moz.build
+++ /dev/null
@@ -1,74 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ARCH_ARM"] = True
-DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_HAS_NEON"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_LINUX"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["_GNU_SOURCE"] = True
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-
-Library("asm_defines_gn")
diff --git third_party/libwebrtc/rtc_base/system/cocoa_threading_gn/moz.build third_party/libwebrtc/rtc_base/system/cocoa_threading_gn/moz.build
deleted file mode 100644
index eb25c5bb304e..000000000000
--- third_party/libwebrtc/rtc_base/system/cocoa_threading_gn/moz.build
+++ /dev/null
@@ -1,69 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-CMMFLAGS += [
-    "-fobjc-arc"
-]
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MAC"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/rtc_base/system/cocoa_threading.mm"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("cocoa_threading_gn")
diff --git third_party/libwebrtc/rtc_base/system/file_wrapper_gn/moz.build third_party/libwebrtc/rtc_base/system/file_wrapper_gn/moz.build
index 63fa2b96e6b0..10e16e536ab8 100644
--- third_party/libwebrtc/rtc_base/system/file_wrapper_gn/moz.build
+++ third_party/libwebrtc/rtc_base/system/file_wrapper_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("file_wrapper_gn")
diff --git third_party/libwebrtc/rtc_base/system/gcd_helpers_gn/moz.build third_party/libwebrtc/rtc_base/system/gcd_helpers_gn/moz.build
deleted file mode 100644
index 96aeffe5015f..000000000000
--- third_party/libwebrtc/rtc_base/system/gcd_helpers_gn/moz.build
+++ /dev/null
@@ -1,69 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-CMFLAGS += [
-    "-fobjc-arc"
-]
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MAC"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/rtc_base/system/gcd_helpers.m"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("gcd_helpers_gn")
diff --git third_party/libwebrtc/rtc_base/system/ignore_warnings_gn/moz.build third_party/libwebrtc/rtc_base/system/ignore_warnings_gn/moz.build
index 09e048b3a0a9..9de0ab6e74a2 100644
--- third_party/libwebrtc/rtc_base/system/ignore_warnings_gn/moz.build
+++ third_party/libwebrtc/rtc_base/system/ignore_warnings_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("ignore_warnings_gn")
diff --git third_party/libwebrtc/rtc_base/system/inline_gn/moz.build third_party/libwebrtc/rtc_base/system/inline_gn/moz.build
index 8d7e24fe9ae8..353d3dbece53 100644
--- third_party/libwebrtc/rtc_base/system/inline_gn/moz.build
+++ third_party/libwebrtc/rtc_base/system/inline_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("inline_gn")
diff --git third_party/libwebrtc/rtc_base/system/no_unique_address_gn/moz.build third_party/libwebrtc/rtc_base/system/no_unique_address_gn/moz.build
index 47f76b807d12..7632cd32cd36 100644
--- third_party/libwebrtc/rtc_base/system/no_unique_address_gn/moz.build
+++ third_party/libwebrtc/rtc_base/system/no_unique_address_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("no_unique_address_gn")
diff --git third_party/libwebrtc/rtc_base/system/rtc_export_gn/moz.build third_party/libwebrtc/rtc_base/system/rtc_export_gn/moz.build
index b5447466b541..80be20f613c2 100644
--- third_party/libwebrtc/rtc_base/system/rtc_export_gn/moz.build
+++ third_party/libwebrtc/rtc_base/system/rtc_export_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtc_export_gn")
diff --git third_party/libwebrtc/rtc_base/system/unused_gn/moz.build third_party/libwebrtc/rtc_base/system/unused_gn/moz.build
index 5348c6d421f6..aa077e5ab912 100644
--- third_party/libwebrtc/rtc_base/system/unused_gn/moz.build
+++ third_party/libwebrtc/rtc_base/system/unused_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("unused_gn")
diff --git third_party/libwebrtc/rtc_base/system/warn_current_thread_is_deadlocked_gn/moz.build third_party/libwebrtc/rtc_base/system/warn_current_thread_is_deadlocked_gn/moz.build
index d2bdd0c2e561..851d3877f698 100644
--- third_party/libwebrtc/rtc_base/system/warn_current_thread_is_deadlocked_gn/moz.build
+++ third_party/libwebrtc/rtc_base/system/warn_current_thread_is_deadlocked_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("warn_current_thread_is_deadlocked_gn")
diff --git third_party/libwebrtc/rtc_base/task_utils/repeating_task_gn/moz.build third_party/libwebrtc/rtc_base/task_utils/repeating_task_gn/moz.build
index 611cef5f0aa9..7ac103b14652 100644
--- third_party/libwebrtc/rtc_base/task_utils/repeating_task_gn/moz.build
+++ third_party/libwebrtc/rtc_base/task_utils/repeating_task_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("repeating_task_gn")
diff --git third_party/libwebrtc/rtc_base/third_party/sigslot/sigslot_gn/moz.build third_party/libwebrtc/rtc_base/third_party/sigslot/sigslot_gn/moz.build
index 4fdd6ceba1cf..cf57b774f7c7 100644
--- third_party/libwebrtc/rtc_base/third_party/sigslot/sigslot_gn/moz.build
+++ third_party/libwebrtc/rtc_base/third_party/sigslot/sigslot_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("sigslot_gn")
diff --git third_party/libwebrtc/rtc_base/threading_gn/moz.build third_party/libwebrtc/rtc_base/threading_gn/moz.build
index 4365ae46ca4c..12f8868a8704 100644
--- third_party/libwebrtc/rtc_base/threading_gn/moz.build
+++ third_party/libwebrtc/rtc_base/threading_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -49,110 +58,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/rtc_base/physical_socket_server.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/rtc_base/physical_socket_server.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = 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/physical_socket_server.cc"
-    ]
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
-
-    UNIFIED_SOURCES += [
-        "/third_party/libwebrtc/rtc_base/physical_socket_server.cc"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -160,82 +66,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("threading_gn")
diff --git third_party/libwebrtc/rtc_base/timeutils_gn/moz.build third_party/libwebrtc/rtc_base/timeutils_gn/moz.build
index 4b8acb938c23..d445327106b5 100644
--- third_party/libwebrtc/rtc_base/timeutils_gn/moz.build
+++ third_party/libwebrtc/rtc_base/timeutils_gn/moz.build
@@ -13,13 +13,22 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_EXCLUDE_SYSTEM_TIME"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -48,93 +57,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +65,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("timeutils_gn")
diff --git third_party/libwebrtc/rtc_base/type_traits_gn/moz.build third_party/libwebrtc/rtc_base/type_traits_gn/moz.build
index 70461b8aa319..2acfd98eda8a 100644
--- third_party/libwebrtc/rtc_base/type_traits_gn/moz.build
+++ third_party/libwebrtc/rtc_base/type_traits_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("type_traits_gn")
diff --git third_party/libwebrtc/rtc_base/unique_id_generator_gn/moz.build third_party/libwebrtc/rtc_base/unique_id_generator_gn/moz.build
index 65eeebb09ea9..c37beeccab19 100644
--- third_party/libwebrtc/rtc_base/unique_id_generator_gn/moz.build
+++ third_party/libwebrtc/rtc_base/unique_id_generator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("unique_id_generator_gn")
diff --git third_party/libwebrtc/rtc_base/units/unit_base_gn/moz.build third_party/libwebrtc/rtc_base/units/unit_base_gn/moz.build
index f33182ae409a..6b9bd21729b4 100644
--- third_party/libwebrtc/rtc_base/units/unit_base_gn/moz.build
+++ third_party/libwebrtc/rtc_base/units/unit_base_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,86 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -157,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("unit_base_gn")
diff --git third_party/libwebrtc/rtc_base/weak_ptr_gn/moz.build third_party/libwebrtc/rtc_base/weak_ptr_gn/moz.build
index ab5a9a7c184c..ba80c70caacb 100644
--- third_party/libwebrtc/rtc_base/weak_ptr_gn/moz.build
+++ third_party/libwebrtc/rtc_base/weak_ptr_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("weak_ptr_gn")
diff --git third_party/libwebrtc/rtc_base/win/create_direct3d_device_gn/moz.build third_party/libwebrtc/rtc_base/win/create_direct3d_device_gn/moz.build
deleted file mode 100644
index 6fefcd32d2ce..000000000000
--- third_party/libwebrtc/rtc_base/win/create_direct3d_device_gn/moz.build
+++ /dev/null
@@ -1,91 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-DEFINES["NOMINMAX"] = True
-DEFINES["NTDDI_VERSION"] = "0x0A000000"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["PSAPI_VERSION"] = "2"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["RTC_ENABLE_WIN_WGC"] = True
-DEFINES["UNICODE"] = True
-DEFINES["USE_AURA"] = "1"
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["WEBRTC_WIN"] = True
-DEFINES["WIN32"] = True
-DEFINES["WIN32_LEAN_AND_MEAN"] = True
-DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-DEFINES["WINVER"] = "0x0A00"
-DEFINES["_ATL_NO_OPENGL"] = True
-DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-DEFINES["_CRT_RAND_S"] = True
-DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-DEFINES["_HAS_EXCEPTIONS"] = "0"
-DEFINES["_HAS_NODISCARD"] = True
-DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-DEFINES["_SECURE_ATL"] = True
-DEFINES["_UNICODE"] = True
-DEFINES["_WIN32_WINNT"] = "0x0A00"
-DEFINES["_WINDOWS"] = True
-DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-DEFINES["__STD_C"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/rtc_base/win/create_direct3d_device.cc"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("create_direct3d_device_gn")
diff --git third_party/libwebrtc/rtc_base/win/get_activation_factory_gn/moz.build third_party/libwebrtc/rtc_base/win/get_activation_factory_gn/moz.build
deleted file mode 100644
index e47a0e579d4a..000000000000
--- third_party/libwebrtc/rtc_base/win/get_activation_factory_gn/moz.build
+++ /dev/null
@@ -1,91 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-DEFINES["NOMINMAX"] = True
-DEFINES["NTDDI_VERSION"] = "0x0A000000"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["PSAPI_VERSION"] = "2"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["RTC_ENABLE_WIN_WGC"] = True
-DEFINES["UNICODE"] = True
-DEFINES["USE_AURA"] = "1"
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["WEBRTC_WIN"] = True
-DEFINES["WIN32"] = True
-DEFINES["WIN32_LEAN_AND_MEAN"] = True
-DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-DEFINES["WINVER"] = "0x0A00"
-DEFINES["_ATL_NO_OPENGL"] = True
-DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-DEFINES["_CRT_RAND_S"] = True
-DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-DEFINES["_HAS_EXCEPTIONS"] = "0"
-DEFINES["_HAS_NODISCARD"] = True
-DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-DEFINES["_SECURE_ATL"] = True
-DEFINES["_UNICODE"] = True
-DEFINES["_WIN32_WINNT"] = "0x0A00"
-DEFINES["_WINDOWS"] = True
-DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-DEFINES["__STD_C"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/rtc_base/win/get_activation_factory.cc"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("get_activation_factory_gn")
diff --git third_party/libwebrtc/rtc_base/win/hstring_gn/moz.build third_party/libwebrtc/rtc_base/win/hstring_gn/moz.build
deleted file mode 100644
index 348b1af0ac91..000000000000
--- third_party/libwebrtc/rtc_base/win/hstring_gn/moz.build
+++ /dev/null
@@ -1,91 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-DEFINES["NOMINMAX"] = True
-DEFINES["NTDDI_VERSION"] = "0x0A000000"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["PSAPI_VERSION"] = "2"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["RTC_ENABLE_WIN_WGC"] = True
-DEFINES["UNICODE"] = True
-DEFINES["USE_AURA"] = "1"
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["WEBRTC_WIN"] = True
-DEFINES["WIN32"] = True
-DEFINES["WIN32_LEAN_AND_MEAN"] = True
-DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-DEFINES["WINVER"] = "0x0A00"
-DEFINES["_ATL_NO_OPENGL"] = True
-DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-DEFINES["_CRT_RAND_S"] = True
-DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-DEFINES["_HAS_EXCEPTIONS"] = "0"
-DEFINES["_HAS_NODISCARD"] = True
-DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-DEFINES["_SECURE_ATL"] = True
-DEFINES["_UNICODE"] = True
-DEFINES["_WIN32_WINNT"] = "0x0A00"
-DEFINES["_WINDOWS"] = True
-DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-DEFINES["__STD_C"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-SOURCES += [
-    "/third_party/libwebrtc/rtc_base/win/hstring.cc"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("hstring_gn")
diff --git third_party/libwebrtc/rtc_base/win/windows_version_gn/moz.build third_party/libwebrtc/rtc_base/win/windows_version_gn/moz.build
deleted file mode 100644
index 0d55a7962fdf..000000000000
--- third_party/libwebrtc/rtc_base/win/windows_version_gn/moz.build
+++ /dev/null
@@ -1,91 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-DEFINES["NOMINMAX"] = True
-DEFINES["NTDDI_VERSION"] = "0x0A000000"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["PSAPI_VERSION"] = "2"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["RTC_ENABLE_WIN_WGC"] = True
-DEFINES["UNICODE"] = True
-DEFINES["USE_AURA"] = "1"
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["WEBRTC_WIN"] = True
-DEFINES["WIN32"] = True
-DEFINES["WIN32_LEAN_AND_MEAN"] = True
-DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-DEFINES["WINVER"] = "0x0A00"
-DEFINES["_ATL_NO_OPENGL"] = True
-DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-DEFINES["_CRT_RAND_S"] = True
-DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-DEFINES["_HAS_EXCEPTIONS"] = "0"
-DEFINES["_HAS_NODISCARD"] = True
-DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-DEFINES["_SECURE_ATL"] = True
-DEFINES["_UNICODE"] = True
-DEFINES["_WIN32_WINNT"] = "0x0A00"
-DEFINES["_WINDOWS"] = True
-DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-DEFINES["__STD_C"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/rtc_base/win/windows_version.cc"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("windows_version_gn")
diff --git third_party/libwebrtc/rtc_base/win32_gn/moz.build third_party/libwebrtc/rtc_base/win32_gn/moz.build
deleted file mode 100644
index 449ccd350e31..000000000000
--- third_party/libwebrtc/rtc_base/win32_gn/moz.build
+++ /dev/null
@@ -1,98 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-DEFINES["NOMINMAX"] = True
-DEFINES["NTDDI_VERSION"] = "0x0A000000"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["PSAPI_VERSION"] = "2"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["RTC_ENABLE_WIN_WGC"] = True
-DEFINES["UNICODE"] = True
-DEFINES["USE_AURA"] = "1"
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["WEBRTC_WIN"] = True
-DEFINES["WIN32"] = True
-DEFINES["WIN32_LEAN_AND_MEAN"] = True
-DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-DEFINES["WINVER"] = "0x0A00"
-DEFINES["_ATL_NO_OPENGL"] = True
-DEFINES["_CRT_NONSTDC_NO_DEPRECATE"] = True
-DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-DEFINES["_CRT_RAND_S"] = True
-DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-DEFINES["_HAS_EXCEPTIONS"] = "0"
-DEFINES["_HAS_NODISCARD"] = True
-DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-DEFINES["_SECURE_ATL"] = True
-DEFINES["_UNICODE"] = True
-DEFINES["_WIN32_WINNT"] = "0x0A00"
-DEFINES["_WINDOWS"] = True
-DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-DEFINES["__STD_C"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-OS_LIBS += [
-    "crypt32",
-    "iphlpapi",
-    "secur32"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/rtc_base/win32.cc"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("win32_gn")
diff --git third_party/libwebrtc/rtc_base/zero_memory_gn/moz.build third_party/libwebrtc/rtc_base/zero_memory_gn/moz.build
index 4255663efd35..50a0a0266df0 100644
--- third_party/libwebrtc/rtc_base/zero_memory_gn/moz.build
+++ third_party/libwebrtc/rtc_base/zero_memory_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("zero_memory_gn")
diff --git third_party/libwebrtc/sdk/base_objc_gn/moz.build third_party/libwebrtc/sdk/base_objc_gn/moz.build
deleted file mode 100644
index 096fecb4c418..000000000000
--- third_party/libwebrtc/sdk/base_objc_gn/moz.build
+++ /dev/null
@@ -1,82 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-CMFLAGS += [
-    "-fobjc-arc"
-]
-
-CMMFLAGS += [
-    "-fobjc-arc"
-]
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MAC"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/third_party/libwebrtc/sdk/objc/",
-    "/third_party/libwebrtc/sdk/objc/base/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/sdk/objc/base/RTCEncodedImage.m",
-    "/third_party/libwebrtc/sdk/objc/base/RTCLogging.mm",
-    "/third_party/libwebrtc/sdk/objc/base/RTCVideoCapturer.m",
-    "/third_party/libwebrtc/sdk/objc/base/RTCVideoCodecInfo.m",
-    "/third_party/libwebrtc/sdk/objc/base/RTCVideoEncoderFactory.mm",
-    "/third_party/libwebrtc/sdk/objc/base/RTCVideoEncoderQpThresholds.m",
-    "/third_party/libwebrtc/sdk/objc/base/RTCVideoEncoderSettings.m",
-    "/third_party/libwebrtc/sdk/objc/base/RTCVideoFrame.mm"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("base_objc_gn")
diff --git third_party/libwebrtc/sdk/helpers_objc_gn/moz.build third_party/libwebrtc/sdk/helpers_objc_gn/moz.build
deleted file mode 100644
index 3a84d3e3c208..000000000000
--- third_party/libwebrtc/sdk/helpers_objc_gn/moz.build
+++ /dev/null
@@ -1,77 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-CMFLAGS += [
-    "-fobjc-arc"
-]
-
-CMMFLAGS += [
-    "-fobjc-arc"
-]
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MAC"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/third_party/libwebrtc/sdk/objc/",
-    "/third_party/libwebrtc/sdk/objc/base/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/sdk/objc/helpers/AVCaptureSession+DevicePosition.mm",
-    "/third_party/libwebrtc/sdk/objc/helpers/NSString+StdString.mm",
-    "/third_party/libwebrtc/sdk/objc/helpers/RTCDispatcher.m"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("helpers_objc_gn")
diff --git third_party/libwebrtc/sdk/videocapture_objc_gn/moz.build third_party/libwebrtc/sdk/videocapture_objc_gn/moz.build
deleted file mode 100644
index fa087172c452..000000000000
--- third_party/libwebrtc/sdk/videocapture_objc_gn/moz.build
+++ /dev/null
@@ -1,72 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-CMFLAGS += [
-    "-fobjc-arc"
-]
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MAC"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/third_party/libwebrtc/sdk/objc/",
-    "/third_party/libwebrtc/sdk/objc/base/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/sdk/objc/components/capturer/RTCCameraVideoCapturer.m",
-    "/third_party/libwebrtc/sdk/objc/components/capturer/RTCFileVideoCapturer.m"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("videocapture_objc_gn")
diff --git third_party/libwebrtc/sdk/videoframebuffer_objc_gn/moz.build third_party/libwebrtc/sdk/videoframebuffer_objc_gn/moz.build
deleted file mode 100644
index 64809b92e3e7..000000000000
--- third_party/libwebrtc/sdk/videoframebuffer_objc_gn/moz.build
+++ /dev/null
@@ -1,75 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-CMMFLAGS += [
-    "-fobjc-arc"
-]
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
-DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
-DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
-DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
-DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
-DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_MAC"] = True
-DEFINES["WEBRTC_MOZILLA_BUILD"] = True
-DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
-DEFINES["WEBRTC_POSIX"] = True
-DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/media/libyuv/",
-    "/media/libyuv/libyuv/include/",
-    "/third_party/abseil-cpp/",
-    "/third_party/libwebrtc/",
-    "/third_party/libwebrtc/sdk/objc/",
-    "/third_party/libwebrtc/sdk/objc/base/",
-    "/tools/profiler/public"
-]
-
-UNIFIED_SOURCES += [
-    "/third_party/libwebrtc/sdk/objc/api/video_frame_buffer/RTCNativeI420Buffer.mm",
-    "/third_party/libwebrtc/sdk/objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.mm",
-    "/third_party/libwebrtc/sdk/objc/components/video_frame_buffer/RTCCVPixelBuffer.mm"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["WEBRTC_ARCH_ARM64"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-    DEFINES["__ARM_NEON__"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-Library("videoframebuffer_objc_gn")
diff --git third_party/libwebrtc/system_wrappers/field_trial_gn/moz.build third_party/libwebrtc/system_wrappers/field_trial_gn/moz.build
index 8181131fd636..82f015feb950 100644
--- third_party/libwebrtc/system_wrappers/field_trial_gn/moz.build
+++ third_party/libwebrtc/system_wrappers/field_trial_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("field_trial_gn")
diff --git third_party/libwebrtc/system_wrappers/metrics_gn/moz.build third_party/libwebrtc/system_wrappers/metrics_gn/moz.build
index 3e1292f36a2a..a9b4f9f9fd1e 100644
--- third_party/libwebrtc/system_wrappers/metrics_gn/moz.build
+++ third_party/libwebrtc/system_wrappers/metrics_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("metrics_gn")
diff --git third_party/libwebrtc/system_wrappers/system_wrappers_gn/moz.build third_party/libwebrtc/system_wrappers/system_wrappers_gn/moz.build
index 46a6c47b9195..e4744c0609ef 100644
--- third_party/libwebrtc/system_wrappers/system_wrappers_gn/moz.build
+++ third_party/libwebrtc/system_wrappers/system_wrappers_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("system_wrappers_gn")
diff --git third_party/libwebrtc/test/rtp_test_utils_gn/moz.build third_party/libwebrtc/test/rtp_test_utils_gn/moz.build
index 2e86a77b581e..9eae6e64d62d 100644
--- third_party/libwebrtc/test/rtp_test_utils_gn/moz.build
+++ third_party/libwebrtc/test/rtp_test_utils_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,94 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -137,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -165,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rtp_test_utils_gn")
diff --git third_party/libwebrtc/third_party/cpu_features/ndk_compat_gn/moz.build third_party/libwebrtc/third_party/cpu_features/ndk_compat_gn/moz.build
deleted file mode 100644
index b7d9cb6142bd..000000000000
--- third_party/libwebrtc/third_party/cpu_features/ndk_compat_gn/moz.build
+++ /dev/null
@@ -1,47 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-  ### This moz.build was AUTOMATICALLY GENERATED from a GN config,  ###
-  ### DO NOT edit it by hand.                                       ###
-
-COMPILE_FLAGS["OS_INCLUDES"] = []
-AllowCompilerWarnings()
-
-DEFINES["ANDROID"] = True
-DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-DEFINES["HAVE_SYS_UIO_H"] = True
-DEFINES["_GNU_SOURCE"] = True
-DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-DEFINES["__STDC_CONSTANT_MACROS"] = True
-DEFINES["__STDC_FORMAT_MACROS"] = True
-
-FINAL_LIBRARY = "xul"
-
-
-LOCAL_INCLUDES += [
-    "!/dist/include/libwebrtc_overrides",
-    "!/ipc/ipdl/_ipdlheaders",
-    "!/third_party/libwebrtc/gen",
-    "/ipc/chromium/src",
-    "/third_party/libwebrtc/",
-    "/tools/profiler/public"
-]
-
-if not CONFIG["MOZ_DEBUG"]:
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0"
-    DEFINES["NDEBUG"] = True
-    DEFINES["NVALGRIND"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1":
-
-    DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["__ARM_NEON__"] = "1"
-
-Library("ndk_compat_gn")
diff --git third_party/libwebrtc/third_party/crc32c/crc32c_arm64_gn/moz.build third_party/libwebrtc/third_party/crc32c/crc32c_arm64_gn/moz.build
index a0d1e7a84956..6b30b605cef1 100644
--- third_party/libwebrtc/third_party/crc32c/crc32c_arm64_gn/moz.build
+++ third_party/libwebrtc/third_party/crc32c/crc32c_arm64_gn/moz.build
@@ -14,6 +14,15 @@ DEFINES["CRC32C_TESTS_BUILT_WITH_GLOG"] = "0"
 DEFINES["HAVE_ARM64_CRC32C"] = "0"
 DEFINES["HAVE_BUILTIN_PREFETCH"] = "1"
 DEFINES["HAVE_SSE42"] = "0"
+DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
+DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,107 +51,24 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "1"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "1"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "1"
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["HAVE_MM_PREFETCH"] = "0"
-
 if CONFIG["TARGET_CPU"] == "loongarch64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "mips64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "ppc64":
 
@@ -154,56 +80,14 @@ if CONFIG["TARGET_CPU"] == "riscv64":
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["HAVE_MM_PREFETCH"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["HAVE_MM_PREFETCH"] = "1"
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["HAVE_MM_PREFETCH"] = "1"
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["HAVE_MM_PREFETCH"] = "1"
 
 Library("crc32c_arm64_gn")
diff --git third_party/libwebrtc/third_party/crc32c/crc32c_gn/moz.build third_party/libwebrtc/third_party/crc32c/crc32c_gn/moz.build
index 31ce063d9097..a7185ebcf11d 100644
--- third_party/libwebrtc/third_party/crc32c/crc32c_gn/moz.build
+++ third_party/libwebrtc/third_party/crc32c/crc32c_gn/moz.build
@@ -14,6 +14,15 @@ DEFINES["CRC32C_TESTS_BUILT_WITH_GLOG"] = "0"
 DEFINES["HAVE_ARM64_CRC32C"] = "0"
 DEFINES["HAVE_BUILTIN_PREFETCH"] = "1"
 DEFINES["HAVE_SSE42"] = "0"
+DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
+DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -43,107 +52,24 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "1"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "1"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "1"
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["HAVE_MM_PREFETCH"] = "0"
-
 if CONFIG["TARGET_CPU"] == "loongarch64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "mips64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "ppc64":
 
@@ -155,56 +81,14 @@ if CONFIG["TARGET_CPU"] == "riscv64":
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["HAVE_MM_PREFETCH"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["HAVE_MM_PREFETCH"] = "1"
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["HAVE_MM_PREFETCH"] = "1"
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["HAVE_MM_PREFETCH"] = "1"
 
 Library("crc32c_gn")
diff --git third_party/libwebrtc/third_party/crc32c/crc32c_internal_headers_gn/moz.build third_party/libwebrtc/third_party/crc32c/crc32c_internal_headers_gn/moz.build
index 35330ec53ea7..0ab76c5c37a9 100644
--- third_party/libwebrtc/third_party/crc32c/crc32c_internal_headers_gn/moz.build
+++ third_party/libwebrtc/third_party/crc32c/crc32c_internal_headers_gn/moz.build
@@ -9,6 +9,14 @@
 COMPILE_FLAGS["OS_INCLUDES"] = []
 AllowCompilerWarnings()
 
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
+
 FINAL_LIBRARY = "xul"
 
 
@@ -30,120 +38,10 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips32":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("crc32c_internal_headers_gn")
diff --git third_party/libwebrtc/third_party/crc32c/crc32c_sse42_gn/moz.build third_party/libwebrtc/third_party/crc32c/crc32c_sse42_gn/moz.build
index b166c70f47e2..dd67af212e47 100644
--- third_party/libwebrtc/third_party/crc32c/crc32c_sse42_gn/moz.build
+++ third_party/libwebrtc/third_party/crc32c/crc32c_sse42_gn/moz.build
@@ -14,6 +14,15 @@ DEFINES["CRC32C_TESTS_BUILT_WITH_GLOG"] = "0"
 DEFINES["HAVE_ARM64_CRC32C"] = "0"
 DEFINES["HAVE_BUILTIN_PREFETCH"] = "1"
 DEFINES["HAVE_SSE42"] = "0"
+DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
+DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,107 +51,24 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "1"
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "1"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "1"
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["HAVE_STRONG_GETAUXVAL"] = "0"
-    DEFINES["HAVE_WEAK_GETAUXVAL"] = "0"
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["HAVE_MM_PREFETCH"] = "0"
-
 if CONFIG["TARGET_CPU"] == "loongarch64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "mips64":
 
     DEFINES["HAVE_MM_PREFETCH"] = "0"
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "ppc64":
 
@@ -154,56 +80,14 @@ if CONFIG["TARGET_CPU"] == "riscv64":
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["HAVE_MM_PREFETCH"] = "1"
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["HAVE_MM_PREFETCH"] = "1"
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["HAVE_MM_PREFETCH"] = "1"
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["HAVE_MM_PREFETCH"] = "1"
 
 Library("crc32c_sse42_gn")
diff --git third_party/libwebrtc/third_party/dav1d/dav1d_gn/moz.build third_party/libwebrtc/third_party/dav1d/dav1d_gn/moz.build
index 535f30143955..9b3a8baecfa4 100644
--- third_party/libwebrtc/third_party/dav1d/dav1d_gn/moz.build
+++ third_party/libwebrtc/third_party/dav1d/dav1d_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -44,82 +53,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -127,25 +61,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -155,40 +74,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("dav1d_gn")
diff --git third_party/libwebrtc/third_party/libaom/libaom_gn/moz.build third_party/libwebrtc/third_party/libaom/libaom_gn/moz.build
index 12c3f72b5b06..f4cc587c8a36 100644
--- third_party/libwebrtc/third_party/libaom/libaom_gn/moz.build
+++ third_party/libwebrtc/third_party/libaom/libaom_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,82 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -125,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -153,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("aom_gn")
diff --git third_party/libwebrtc/third_party/libepoxy/libepoxy_gn/moz.build third_party/libwebrtc/third_party/libepoxy/libepoxy_gn/moz.build
index e2c9ea11a576..2a72b5041e77 100644
--- third_party/libwebrtc/third_party/libepoxy/libepoxy_gn/moz.build
+++ third_party/libwebrtc/third_party/libepoxy/libepoxy_gn/moz.build
@@ -13,20 +13,17 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
-DEFINES["USE_AURA"] = "1"
 DEFINES["USE_GLIB"] = "1"
 DEFINES["USE_OZONE"] = "1"
-DEFINES["USE_UDEV"] = True
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
-DEFINES["WEBRTC_LINUX"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
 DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
 DEFINES["_FILE_OFFSET_BITS"] = "64"
-DEFINES["_GNU_SOURCE"] = True
 DEFINES["_LARGEFILE64_SOURCE"] = True
 DEFINES["_LARGEFILE_SOURCE"] = True
 DEFINES["__STDC_CONSTANT_MACROS"] = True
@@ -64,12 +61,6 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
diff --git third_party/libwebrtc/third_party/libyuv/libyuv_gn/moz.build third_party/libwebrtc/third_party/libyuv/libyuv_gn/moz.build
index d4cfc3821ac8..defbc3e51a23 100644
--- third_party/libwebrtc/third_party/libyuv/libyuv_gn/moz.build
+++ third_party/libwebrtc/third_party/libyuv/libyuv_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -44,82 +53,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -127,25 +61,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -155,40 +74,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("yuv_gn")
diff --git third_party/libwebrtc/third_party/opus/opus_gn/moz.build third_party/libwebrtc/third_party/opus/opus_gn/moz.build
index bfeaa56b05af..d8e71c4280d9 100644
--- third_party/libwebrtc/third_party/opus/opus_gn/moz.build
+++ third_party/libwebrtc/third_party/opus/opus_gn/moz.build
@@ -9,6 +9,14 @@
 COMPILE_FLAGS["OS_INCLUDES"] = []
 AllowCompilerWarnings()
 
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
+
 FINAL_LIBRARY = "xul"
 
 
@@ -30,120 +38,10 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips32":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("opus_gn")
diff --git third_party/libwebrtc/third_party/pffft/pffft_gn/moz.build third_party/libwebrtc/third_party/pffft/pffft_gn/moz.build
index fa6a7850dc2f..328baf0e1eac 100644
--- third_party/libwebrtc/third_party/pffft/pffft_gn/moz.build
+++ third_party/libwebrtc/third_party/pffft/pffft_gn/moz.build
@@ -9,6 +9,14 @@
 COMPILE_FLAGS["OS_INCLUDES"] = []
 AllowCompilerWarnings()
 
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
+
 FINAL_LIBRARY = "xul"
 
 
@@ -34,95 +42,23 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_USE_MATH_DEFINES"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CFLAGS += [
-        "-mfpu=neon"
-    ]
-
 if CONFIG["TARGET_CPU"] == "loongarch64":
 
     DEFINES["PFFFT_SIMD_DISABLE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["PFFFT_SIMD_DISABLE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "mips64":
 
     DEFINES["PFFFT_SIMD_DISABLE"] = True
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "ppc64":
 
@@ -132,50 +68,10 @@ if CONFIG["TARGET_CPU"] == "riscv64":
 
     DEFINES["PFFFT_SIMD_DISABLE"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("pffft_gn")
diff --git third_party/libwebrtc/third_party/rnnoise/rnn_vad_gn/moz.build third_party/libwebrtc/third_party/rnnoise/rnn_vad_gn/moz.build
index 11dbf4942190..d44acce8cafa 100644
--- third_party/libwebrtc/third_party/rnnoise/rnn_vad_gn/moz.build
+++ third_party/libwebrtc/third_party/rnnoise/rnn_vad_gn/moz.build
@@ -9,6 +9,14 @@
 COMPILE_FLAGS["OS_INCLUDES"] = []
 AllowCompilerWarnings()
 
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
+
 FINAL_LIBRARY = "xul"
 
 
@@ -34,136 +42,16 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "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"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips32":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
+if CONFIG["TARGET_CPU"] == "x86":
 
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("rnn_vad_gn")
diff --git third_party/libwebrtc/video/adaptation/video_adaptation_gn/moz.build third_party/libwebrtc/video/adaptation/video_adaptation_gn/moz.build
index 63fce4361b2b..dad5ed7fa01c 100644
--- third_party/libwebrtc/video/adaptation/video_adaptation_gn/moz.build
+++ third_party/libwebrtc/video/adaptation/video_adaptation_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -54,94 +63,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -149,82 +71,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_adaptation_gn")
diff --git third_party/libwebrtc/video/config/encoder_config_gn/moz.build third_party/libwebrtc/video/config/encoder_config_gn/moz.build
index 74145a92544d..22716e70e484 100644
--- third_party/libwebrtc/video/config/encoder_config_gn/moz.build
+++ third_party/libwebrtc/video/config/encoder_config_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("encoder_config_gn")
diff --git third_party/libwebrtc/video/config/streams_config_gn/moz.build third_party/libwebrtc/video/config/streams_config_gn/moz.build
index 8bce9bd5ba2a..e266ecab0cd5 100644
--- third_party/libwebrtc/video/config/streams_config_gn/moz.build
+++ third_party/libwebrtc/video/config/streams_config_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -47,94 +56,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -142,82 +64,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("streams_config_gn")
diff --git third_party/libwebrtc/video/corruption_detection/corruption_classifier_gn/moz.build third_party/libwebrtc/video/corruption_detection/corruption_classifier_gn/moz.build
index 5a77553e544c..0a93ce3fe690 100644
--- third_party/libwebrtc/video/corruption_detection/corruption_classifier_gn/moz.build
+++ third_party/libwebrtc/video/corruption_detection/corruption_classifier_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("corruption_classifier_gn")
diff --git third_party/libwebrtc/video/corruption_detection/frame_instrumentation_generator_gn/moz.build third_party/libwebrtc/video/corruption_detection/frame_instrumentation_generator_gn/moz.build
index c97eea9edd89..dc3563b3626c 100644
--- third_party/libwebrtc/video/corruption_detection/frame_instrumentation_generator_gn/moz.build
+++ third_party/libwebrtc/video/corruption_detection/frame_instrumentation_generator_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_instrumentation_generator_gn")
diff --git third_party/libwebrtc/video/corruption_detection/generic_mapping_functions_gn/moz.build third_party/libwebrtc/video/corruption_detection/generic_mapping_functions_gn/moz.build
index 35e4e34af56e..6e62859f71aa 100644
--- third_party/libwebrtc/video/corruption_detection/generic_mapping_functions_gn/moz.build
+++ third_party/libwebrtc/video/corruption_detection/generic_mapping_functions_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("generic_mapping_functions_gn")
diff --git third_party/libwebrtc/video/corruption_detection/halton_frame_sampler_gn/moz.build third_party/libwebrtc/video/corruption_detection/halton_frame_sampler_gn/moz.build
index 37c645c71910..01010a22e813 100644
--- third_party/libwebrtc/video/corruption_detection/halton_frame_sampler_gn/moz.build
+++ third_party/libwebrtc/video/corruption_detection/halton_frame_sampler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("halton_frame_sampler_gn")
diff --git third_party/libwebrtc/video/corruption_detection/halton_sequence_gn/moz.build third_party/libwebrtc/video/corruption_detection/halton_sequence_gn/moz.build
index 1c216e73bcbc..bd61c3dcb4fe 100644
--- third_party/libwebrtc/video/corruption_detection/halton_sequence_gn/moz.build
+++ third_party/libwebrtc/video/corruption_detection/halton_sequence_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,86 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -133,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("halton_sequence_gn")
diff --git third_party/libwebrtc/video/corruption_detection/video_frame_sampler_gn/moz.build third_party/libwebrtc/video/corruption_detection/video_frame_sampler_gn/moz.build
index 6c81ca519e96..53a0aecf15a7 100644
--- third_party/libwebrtc/video/corruption_detection/video_frame_sampler_gn/moz.build
+++ third_party/libwebrtc/video/corruption_detection/video_frame_sampler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_frame_sampler_gn")
diff --git third_party/libwebrtc/video/decode_synchronizer_gn/moz.build third_party/libwebrtc/video/decode_synchronizer_gn/moz.build
index 8d00bc66d4d7..37dd43f219d7 100644
--- third_party/libwebrtc/video/decode_synchronizer_gn/moz.build
+++ third_party/libwebrtc/video/decode_synchronizer_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("decode_synchronizer_gn")
diff --git third_party/libwebrtc/video/frame_cadence_adapter_gn/moz.build third_party/libwebrtc/video/frame_cadence_adapter_gn/moz.build
index 0764c59c2ae1..76d308fbc122 100644
--- third_party/libwebrtc/video/frame_cadence_adapter_gn/moz.build
+++ third_party/libwebrtc/video/frame_cadence_adapter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_cadence_adapter_gn")
diff --git third_party/libwebrtc/video/frame_decode_scheduler_gn/moz.build third_party/libwebrtc/video/frame_decode_scheduler_gn/moz.build
index ebfa0cf8e98b..083623da19ed 100644
--- third_party/libwebrtc/video/frame_decode_scheduler_gn/moz.build
+++ third_party/libwebrtc/video/frame_decode_scheduler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("frame_decode_scheduler_gn")
diff --git third_party/libwebrtc/video/frame_decode_timing_gn/moz.build third_party/libwebrtc/video/frame_decode_timing_gn/moz.build
index dff6817185a6..a6391ed1d6d9 100644
--- third_party/libwebrtc/video/frame_decode_timing_gn/moz.build
+++ third_party/libwebrtc/video/frame_decode_timing_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_decode_timing_gn")
diff --git third_party/libwebrtc/video/frame_dumping_decoder_gn/moz.build third_party/libwebrtc/video/frame_dumping_decoder_gn/moz.build
index 227df191f979..60e92d4b43b8 100644
--- third_party/libwebrtc/video/frame_dumping_decoder_gn/moz.build
+++ third_party/libwebrtc/video/frame_dumping_decoder_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_dumping_decoder_gn")
diff --git third_party/libwebrtc/video/frame_dumping_encoder_gn/moz.build third_party/libwebrtc/video/frame_dumping_encoder_gn/moz.build
index 8d0c58f78dc2..e80fc74c8dfc 100644
--- third_party/libwebrtc/video/frame_dumping_encoder_gn/moz.build
+++ third_party/libwebrtc/video/frame_dumping_encoder_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("frame_dumping_encoder_gn")
diff --git third_party/libwebrtc/video/render/incoming_video_stream_gn/moz.build third_party/libwebrtc/video/render/incoming_video_stream_gn/moz.build
index 4635e7a8e62f..0611183c55ca 100644
--- third_party/libwebrtc/video/render/incoming_video_stream_gn/moz.build
+++ third_party/libwebrtc/video/render/incoming_video_stream_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("incoming_video_stream_gn")
diff --git third_party/libwebrtc/video/render/video_render_frames_gn/moz.build third_party/libwebrtc/video/render/video_render_frames_gn/moz.build
index d0063c8e73d3..a4d236fc549c 100644
--- third_party/libwebrtc/video/render/video_render_frames_gn/moz.build
+++ third_party/libwebrtc/video/render/video_render_frames_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_render_frames_gn")
diff --git third_party/libwebrtc/video/task_queue_frame_decode_scheduler_gn/moz.build third_party/libwebrtc/video/task_queue_frame_decode_scheduler_gn/moz.build
index ab2e1394bc6f..17b977e8823b 100644
--- third_party/libwebrtc/video/task_queue_frame_decode_scheduler_gn/moz.build
+++ third_party/libwebrtc/video/task_queue_frame_decode_scheduler_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("task_queue_frame_decode_scheduler_gn")
diff --git third_party/libwebrtc/video/unique_timestamp_counter_gn/moz.build third_party/libwebrtc/video/unique_timestamp_counter_gn/moz.build
index a18e7c809be4..15326cffbbdd 100644
--- third_party/libwebrtc/video/unique_timestamp_counter_gn/moz.build
+++ third_party/libwebrtc/video/unique_timestamp_counter_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,82 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -129,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("unique_timestamp_counter_gn")
diff --git third_party/libwebrtc/video/video_gn/moz.build third_party/libwebrtc/video/video_gn/moz.build
index bf9570a50f61..852d85724b5a 100644
--- third_party/libwebrtc/video/video_gn/moz.build
+++ third_party/libwebrtc/video/video_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -65,94 +74,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -160,82 +82,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_gn")
diff --git third_party/libwebrtc/video/video_receive_stream_timeout_tracker_gn/moz.build third_party/libwebrtc/video/video_receive_stream_timeout_tracker_gn/moz.build
index 5b7cfa965acb..870f098f8f00 100644
--- third_party/libwebrtc/video/video_receive_stream_timeout_tracker_gn/moz.build
+++ third_party/libwebrtc/video/video_receive_stream_timeout_tracker_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,93 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -140,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_receive_stream_timeout_tracker_gn")
diff --git third_party/libwebrtc/video/video_stream_buffer_controller_gn/moz.build third_party/libwebrtc/video/video_stream_buffer_controller_gn/moz.build
index 546b31db87d2..c8a455a621d5 100644
--- third_party/libwebrtc/video/video_stream_buffer_controller_gn/moz.build
+++ third_party/libwebrtc/video/video_stream_buffer_controller_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -46,94 +55,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -141,82 +63,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_stream_buffer_controller_gn")
diff --git third_party/libwebrtc/video/video_stream_encoder_impl_gn/moz.build third_party/libwebrtc/video/video_stream_encoder_impl_gn/moz.build
index 361043fbfbf9..ef4b2d0642b2 100644
--- third_party/libwebrtc/video/video_stream_encoder_impl_gn/moz.build
+++ third_party/libwebrtc/video/video_stream_encoder_impl_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -54,94 +63,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -149,82 +71,21 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    CXXFLAGS += [
-        "-mfpu=neon"
-    ]
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["WEBRTC_ENABLE_AVX2"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86":
-
     CXXFLAGS += [
         "-msse2"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    CXXFLAGS += [
-        "-msse2"
-    ]
-
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
+if CONFIG["TARGET_CPU"] == "x86_64":
 
-    DEFINES["_GNU_SOURCE"] = True
+    DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
 Library("video_stream_encoder_impl_gn")
diff --git third_party/libwebrtc/video/video_stream_encoder_interface_gn/moz.build third_party/libwebrtc/video/video_stream_encoder_interface_gn/moz.build
index 2fde9b415646..e25edf163bd7 100644
--- third_party/libwebrtc/video/video_stream_encoder_interface_gn/moz.build
+++ third_party/libwebrtc/video/video_stream_encoder_interface_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,93 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "iphlpapi",
-        "secur32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -136,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -164,40 +72,4 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("video_stream_encoder_interface_gn")
diff --git third_party/libwebrtc/webrtc_gn/moz.build third_party/libwebrtc/webrtc_gn/moz.build
index ba124401bf6a..1340bec6cba0 100644
--- third_party/libwebrtc/webrtc_gn/moz.build
+++ third_party/libwebrtc/webrtc_gn/moz.build
@@ -13,12 +13,21 @@ DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1"
 DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0"
 DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True
 DEFINES["RTC_ENABLE_VP9"] = True
+DEFINES["USE_GLIB"] = "1"
+DEFINES["USE_OZONE"] = "1"
+DEFINES["WEBRTC_BSD"] = True
 DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0"
 DEFINES["WEBRTC_ENCODER_PSNR_STATS"] = True
 DEFINES["WEBRTC_LIBRARY_IMPL"] = True
 DEFINES["WEBRTC_MOZILLA_BUILD"] = True
 DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0"
+DEFINES["WEBRTC_POSIX"] = True
 DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0"
+DEFINES["_FILE_OFFSET_BITS"] = "64"
+DEFINES["_LARGEFILE64_SOURCE"] = True
+DEFINES["_LARGEFILE_SOURCE"] = True
+DEFINES["__STDC_CONSTANT_MACROS"] = True
+DEFINES["__STDC_FORMAT_MACROS"] = True
 
 FINAL_LIBRARY = "xul"
 
@@ -42,117 +51,7 @@ if not CONFIG["MOZ_DEBUG"]:
 if CONFIG["MOZ_DEBUG"] == "1":
 
     DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1"
-
-if CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["ANDROID"] = True
-    DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1"
-    DEFINES["HAVE_SYS_UIO_H"] = True
-    DEFINES["WEBRTC_ANDROID"] = True
-    DEFINES["WEBRTC_ANDROID_OPENSLES"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_GNU_SOURCE"] = True
-    DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    OS_LIBS += [
-        "GLESv2",
-        "log"
-    ]
-
-if CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["WEBRTC_MAC"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-    LOCAL_INCLUDES += [
-        "/third_party/libwebrtc/sdk/objc/",
-        "/third_party/libwebrtc/sdk/objc/base/"
-    ]
-
-if CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["USE_UDEV"] = True
-    DEFINES["WEBRTC_LINUX"] = True
-    DEFINES["WEBRTC_POSIX"] = True
-    DEFINES["_FILE_OFFSET_BITS"] = "64"
-    DEFINES["_LARGEFILE64_SOURCE"] = True
-    DEFINES["_LARGEFILE_SOURCE"] = True
-    DEFINES["__STDC_CONSTANT_MACROS"] = True
-    DEFINES["__STDC_FORMAT_MACROS"] = True
-
-if CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["USE_GLIB"] = "1"
-    DEFINES["USE_OZONE"] = "1"
-    DEFINES["WEBRTC_BSD"] = True
-    DEFINES["WEBRTC_POSIX"] = 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"
-    ]
-
-if CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
-    DEFINES["NOMINMAX"] = True
-    DEFINES["NTDDI_VERSION"] = "0x0A000000"
-    DEFINES["PSAPI_VERSION"] = "2"
-    DEFINES["RTC_ENABLE_WIN_WGC"] = True
-    DEFINES["UNICODE"] = True
-    DEFINES["USE_AURA"] = "1"
-    DEFINES["WEBRTC_WIN"] = True
-    DEFINES["WIN32"] = True
-    DEFINES["WIN32_LEAN_AND_MEAN"] = True
-    DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP"
-    DEFINES["WINVER"] = "0x0A00"
-    DEFINES["_ATL_NO_OPENGL"] = True
-    DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True
-    DEFINES["_CRT_RAND_S"] = True
-    DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True
-    DEFINES["_HAS_EXCEPTIONS"] = "0"
-    DEFINES["_HAS_NODISCARD"] = True
-    DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True
-    DEFINES["_SECURE_ATL"] = True
-    DEFINES["_UNICODE"] = True
-    DEFINES["_WIN32_WINNT"] = "0x0A00"
-    DEFINES["_WINDOWS"] = True
-    DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True
-    DEFINES["__STD_C"] = True
-
-    OS_LIBS += [
-        "crypt32",
-        "d3d11",
-        "dwmapi",
-        "dxgi",
-        "iphlpapi",
-        "ole32",
-        "oleaut32",
-        "secur32",
-        "shcore",
-        "strmiids",
-        "user32",
-        "winmm"
-    ]
+    DEFINES["_DEBUG"] = True
 
 if CONFIG["TARGET_CPU"] == "aarch64":
 
@@ -160,25 +59,10 @@ if CONFIG["TARGET_CPU"] == "aarch64":
     DEFINES["WEBRTC_HAS_NEON"] = True
     DEFINES["__ARM_NEON__"] = "1"
 
-if CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["WEBRTC_ARCH_ARM"] = True
-    DEFINES["WEBRTC_ARCH_ARM_V7"] = True
-    DEFINES["WEBRTC_HAS_NEON"] = True
-
-if CONFIG["TARGET_CPU"] == "loongarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 if CONFIG["TARGET_CPU"] == "mips32":
 
     DEFINES["MIPS32_LE"] = True
     DEFINES["MIPS_FPU_LE"] = True
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["TARGET_CPU"] == "mips64":
-
-    DEFINES["_GNU_SOURCE"] = True
 
 if CONFIG["TARGET_CPU"] == "x86":
 
@@ -188,27 +72,7 @@ if CONFIG["TARGET_CPU"] == "x86_64":
 
     DEFINES["WEBRTC_ENABLE_AVX2"] = True
 
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD":
-
-    DEFINES["_DEBUG"] = True
-
-if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT":
-
-    DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0"
-
-if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux":
+if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "FreeBSD":
 
     OS_LIBS += [
         "X11",
@@ -220,20 +84,4 @@ if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux":
         "Xrender"
     ]
 
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86":
-
-    DEFINES["_GNU_SOURCE"] = True
-
-if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64":
-
-    DEFINES["_GNU_SOURCE"] = True
-
 Library("webrtc_gn")
