From f80d05e7730555024761ba9a14b76477ecd2ab20 Mon Sep 17 00:00:00 2001
From: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
Date: Sat, 15 Aug 2026 11:18:14 +0200
Subject: [PATCH] Fix build failure with --with-system-av1

When building with --with-system-av1 tries to link a statically-compiled
libgkcodecs, which doesn't exist since we're using the system shared
object.

Add a guard following the same pattern established by all the other
--with-system-XXX flags.
---
 config/external/gkcodecs/gkcodecs.symbols | 2 ++
 config/external/gkcodecs/moz.build        | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/config/external/gkcodecs/gkcodecs.symbols b/config/external/gkcodecs/gkcodecs.symbols
index ad67794ee3a6..df93d763dd35 100644
--- a/config/external/gkcodecs/gkcodecs.symbols
+++ b/config/external/gkcodecs/gkcodecs.symbols
@@ -1,4 +1,5 @@
 # libaom symbols
+#ifndef MOZ_SYSTEM_AV1
 aom_codec_av1_cx
 aom_codec_av1_dx
 aom_codec_build_config
@@ -51,6 +52,7 @@ av1_set_active_map
 av1_set_internal_size
 av1_set_reference_enc
 av1_use_as_reference
+#endif
 # libogg symbols
 ogg_calloc_func
 ogg_free_func
diff --git a/config/external/gkcodecs/moz.build b/config/external/gkcodecs/moz.build
index a55ae6907f3d..34019e81cebb 100644
--- a/config/external/gkcodecs/moz.build
+++ b/config/external/gkcodecs/moz.build
@@ -12,5 +12,7 @@
 GeckoSharedLibrary("gkcodecs")
 SHARED_LIBRARY_NAME = "gkcodecs"
 SYMBOLS_FILE = "gkcodecs.symbols"
+if CONFIG["MOZ_SYSTEM_AV1"]:
+    DEFINES["MOZ_SYSTEM_AV1"] = True
 if CONFIG["MOZ_SYSTEM_LIBVPX"]:
     DEFINES["MOZ_SYSTEM_LIBVPX"] = True
-- 
2.55.0

