diff --git a/vim.spec b/vim.spec
index adf6a9c..e62dc0e 100644
--- a/vim.spec
+++ b/vim.spec
@@ -309,6 +309,14 @@ Provides: gvim
 Provides: vim(plugins-supported)
 Provides: %{_bindir}/mergetool
 Provides: %{_bindir}/gvim
+
+%if 0%{?fedora} >= 40 || 0%{?rhel} > 9
+# glib2 in Fedora 40 introduced a new function, which is not used in GVim, but it is present
+# in compiled gvim binary as symbol when Vim is compiled with glib2-2.79.1
+# there does not seem to be a better solution than version based requires on glib2...
+# https://bugzilla.redhat.com/show_bug.cgi?id=2262371
+Requires: glib2 >= 2.79.1
+%endif
 # GVIM graphics are based on GTK3
 Requires: gtk3
 # needed for icons (#226526)
@@ -1051,6 +1059,7 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags
 %changelog
 * Mon Feb 05 2024 Zdenek Dohnal <zdohnal@redhat.com> - 2:9.1.076-2
 - enable building without GPM support - build with GPM in Fedora
+- 2262371 - gvim: symbol lookup error: gvim: undefined symbol: g_once_init_enter_pointer
 
 * Mon Feb 05 2024 Zdenek Dohnal <zdohnal@redhat.com> - 2:9.1.076-1
 - patchlevel 076