I have just discovered that fontconfig-2.0.gir and freetype2-2.0.gir provide no library name, but at the same time provide at least one function. That could generate problems when the user would try to call that function.
Most GIR files provide the shared-library name like
$ head -30 /usr/share/gir-1.0/Gtk-3.0.gir
<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations. -->
<repository version="1.2"
xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0"
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<include name="Atk" version="1.0"/>
<include name="Gdk" version="3.0"/>
<include name="xlib" version="2.0"/>
<package name="gtk+-3.0"/>
<c:include name="gtk/gtk-a11y.h"/>
<c:include name="gtk/gtk.h"/>
<c:include name="gtk/gtkx.h"/>
<namespace name="Gtk"
version="3.0"
shared-library="libgtk-3.so.0,libgdk-3.so.0"
c:identifier-prefixes="Gtk"
c:symbol-prefixes="gtk">
<alias name="Allocation" c:type="GtkAllocation">
<doc xml:space="preserve"
filename="gtk+-3.24.20/gtk/gtkwidget.h"
line="70">A #GtkAllocation-struct of a widget represents region
which has been allocated to the widget by its parent. It is a subregion
of its parents allocation. See
[GtkWidget’s geometry management section][geometry-management] for
more information.</doc>
<source-position filename="gtk+-3.24.20/gtk/gtkwidget.h" line="83"/>
<type name="Gdk.Rectangle" c:type="GdkRectangle"/>
But
$ cat /usr/share/gir-1.0/fontconfig-2.0.gir
<?xml version="1.0"?>
<repository version="1.2"
xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0">
<namespace name="fontconfig" version="2.0"
c:identifier-prefixes="Fc"
c:symbol-prefixes="fc">
<record name="Pattern" c:type="FcPattern"/>
<record name="CharSet" c:type="FcCharSet"/>
<function name="init" c:identifier="FcInit">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
</parameters>
</function>
</namespace>
</repository>
$ cat /usr/share/gir-1.0/freetype2-2.0.gir
<?xml version="1.0"?>
<repository version="1.2"
xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0">
<namespace name="freetype2" version="2.0"
c:identifier-prefixes="FT"
c:symbol-prefixes="FT">
<record name="Bitmap" c:type="FT_Bitmap"/>
<record name="Face" c:type="FT_Face"/>
<record name="Library" c:type="FT_Library"/>
<alias name="Int32" c:type="FT_Int32">
<type name="int32"/>
</alias>
<function name="library_version" c:identifier="FT_Library_Version">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
</parameters>
</function>
</namespace>
</repository>
I think the fix is to generate no functions at all if the shared-library name is not present.