I tried to build GLib on macOS Sonoma 14.5 with an M2 processor but ran into a linking issue. Am I missing something? I can’t figure out why it’s not working. I’ve removed some warnings from the log so it does not exceed the character limit
ninja log
[1/6] Generating girepository/introspection/Gio-2.0.gir with a custom command (wrapped by meson to set env)
FAILED: girepository/introspection/Gio-2.0.gir
env PKG_CONFIG_PATH=/Users/user/dev/glib/_build/meson-uninstalled PKG_CONFIG=/opt/homebrew/bin/pkg-config 'CC=ccache cc' /opt/homebrew/Cellar/gobject-introspection/1.80.1/bin/g-ir-scanner --quiet --no-libtool --namespace=Gio --nsversion=2.0 --warn-all --output girepository/introspection/Gio-2.0.gir --c-include=gio/gio.h --quiet -DGIO_COMPILATION -DG_SETTINGS_ENABLE_BACKEND --symbol-prefix=gio --c-include=gio/gfiledescriptorbased.h --c-include=gio/gunixmounts.h --c-include=gio/gunixfdmessage.h --c-include=gio/gunixinputstream.h --c-include=gio/gunixoutputstream.h --pkg=gio-unix-2.0 -I/Users/user/dev/glib/girepository/introspection -I/Users/user/dev/glib/_build/girepository/introspection -I/Users/user/dev/glib/. -I/Users/user/dev/glib/_build/. -I/Users/user/dev/glib/gio -I/Users/user/dev/glib/_build/gio -I/Users/user/dev/glib/glib -I/Users/user/dev/glib/_build/glib -I/Users/user/dev/glib/subprojects/proxy-libintl/. -I/Users/user/dev/glib/_build/subprojects/proxy-libintl/. -I/Users/user/dev/glib/gobject -I/Users/user/dev/glib/_build/gobject -I/Users/user/dev/glib/gmodule -I/Users/user/dev/glib/_build/gmodule -I/Users/user/dev/glib/subprojects/gvdb/. -I/Users/user/dev/glib/_build/subprojects/gvdb/. --filelist=/Users/user/dev/glib/_build/gio/libgio-2.0.0.dylib.p/Gio_2.0_gir_filelist --include-uninstalled=girepository/introspection/GLib-2.0.gir --include-uninstalled=girepository/introspection/GModule-2.0.gir --include-uninstalled=girepository/introspection/GObject-2.0.gir --symbol-prefix=g --identifier-prefix=G --pkg-export=gio-2.0 --pkg-export=gio-unix-2.0 --cflags-begin -D_GNU_SOURCE -DG_DISABLE_CAST_CHECKS -I/Users/user/dev/glib/. -I/Users/user/dev/glib/_build/. -I/Users/user/dev/glib/gio -I/Users/user/dev/glib/_build/gio -I/Users/user/dev/glib/glib -I/Users/user/dev/glib/_build/glib -I/Users/user/dev/glib/subprojects/proxy-libintl/. -I/Users/user/dev/glib/_build/subprojects/proxy-libintl/. -I/Users/user/dev/glib/gobject -I/Users/user/dev/glib/_build/gobject -I/Users/user/dev/glib/gmodule -I/Users/user/dev/glib/_build/gmodule -I/Users/user/dev/glib/subprojects/gvdb/. -I/Users/user/dev/glib/_build/subprojects/gvdb/. -I/Users/user/dev/glib/girepository -I/Users/user/dev/glib/_build/girepository -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -I/opt/homebrew/Cellar/pcre2/10.44/include -I/opt/homebrew/Cellar/gobject-introspection/1.80.1/include/gobject-introspection-1.0 -I/opt/homebrew/Cellar/glib/2.80.4/include -I/opt/homebrew/Cellar/glib/2.80.4/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.80.4/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include --cflags-end --add-include-path=/Users/user/dev/glib/_build/girepository/introspection --add-include-path=/opt/homebrew/Cellar/gobject-introspection/1.80.1/share/gir-1.0 --add-include-path=/Users/user/dev/glib/_build/girepository/introspection --add-include-path=/Users/user/dev/glib/_build/girepository/introspection --add-include-path=/Users/user/dev/glib/_build/girepository/introspection -L/Users/user/dev/glib/_build/girepository -L/Users/user/dev/glib/_build/glib -L/Users/user/dev/glib/_build/subprojects/proxy-libintl -L/Users/user/dev/glib/_build/gobject -L/Users/user/dev/glib/_build/gmodule -L/Users/user/dev/glib/_build/gio -L/opt/homebrew/Cellar/pcre2/10.44/lib --extra-library=girepository-2.0 --extra-library=glib-2.0 --extra-library=intl --extra-library=gobject-2.0 --extra-library=gio-2.0 --extra-library=gmodule-2.0 -L/Users/user/dev/glib/_build/gio --library gio-2.0 -L/Users/user/dev/glib/_build/glib -L/Users/user/dev/glib/_build/subprojects/proxy-libintl -L/Users/user/dev/glib/_build/gobject -L/Users/user/dev/glib/_build/gmodule -L/opt/homebrew/Cellar/pcre2/10.44/lib --extra-library=z --extra-library=resolv --extra-library=ffi --extra-library=iconv --extra-library=m -L/opt/homebrew/Cellar/pcre2/10.44/lib --extra-library=pcre2-8 -L/opt/homebrew/Cellar/gobject-introspection/1.80.1/lib -L/opt/homebrew/Cellar/glib/2.80.4/lib -L/opt/homebrew/opt/gettext/lib --extra-library=girepository-1.0 --extra-library=gobject-2.0 --extra-library=glib-2.0 --extra-library=intl --sources-top-dirs /Users/user/dev/glib/ --sources-top-dirs /Users/user/dev/glib/_build/
../gio/gfile.c:7369: Error: Gio: multiple "not" annotations:
* @iostream: (out) (not optional) (not nullable) (transfer full): on return, a #GFileIOStream for the created file
^
../gio/gfilteroutputstream.c:103: Warning: Gio: multiple comment blocks documenting 'GFilterOutputStream:close-base-stream:' identifier (already seen at gfilteroutputstream.c:91).
../gio/gdtlsclientconnection.c:108: Warning: Gio: unexpected annotation: element-type
../gio/gdbusmessage.c:3764: Warning: Gio: GObject-Introspection specific GTK-Doc tag "Type" has been deprecated, please use annotations on the identifier instead:
* Type: method-call
^
../gio/gdbusmessage.c:3779: Warning: Gio: GObject-Introspection specific GTK-Doc tag "Type" has been deprecated, please use annotations on the identifier instead:
* Type: method-return
^
ld: warning: duplicate -rpath '/Users/user/dev/glib/_build/gio' ignored
ld: warning: duplicate -rpath '/Users/user/dev/glib/_build/glib' ignored
ld: warning: duplicate -rpath '/Users/user/dev/glib/_build/subprojects/proxy-libintl' ignored
ld: warning: duplicate -rpath '/Users/user/dev/glib/_build/gobject' ignored
ld: warning: duplicate -rpath '/Users/user/dev/glib/_build/gmodule' ignored
ld: warning: duplicate -rpath '/opt/homebrew/Cellar/pcre2/10.44/lib' ignored
ld: warning: duplicate -rpath '/opt/homebrew/Cellar/pcre2/10.44/lib' ignored
ld: warning: ignoring duplicate libraries: '-lgio-2.0', '-lglib-2.0', '-lgmodule-2.0', '-lgobject-2.0', '-lintl'
ld: Undefined symbols:
_g_osx_network_monitor_get_type, referenced from:
_GI_GET_TYPE_FUNCS_ in Gio-2.0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
linking of temporary binary failed: Command '['ccache', 'cc', '-o', '/Users/user/dev/glib/_build/tmp-introspect8msl3q15/Gio-2.0', '/Users/user/dev/glib/_build/tmp-introspect8msl3q15/Gio-2.0.o', '-L.', '-Wl,-rpath,.', '-L/Users/user/dev/glib/_build/girepository', '-Wl,-rpath,/Users/user/dev/glib/_build/girepository', '-L/Users/user/dev/glib/_build/glib', '-Wl,-rpath,/Users/user/dev/glib/_build/glib', '-L/Users/user/dev/glib/_build/subprojects/proxy-libintl', '-Wl,-rpath,/Users/user/dev/glib/_build/subprojects/proxy-libintl', '-L/Users/user/dev/glib/_build/gobject', '-Wl,-rpath,/Users/user/dev/glib/_build/gobject', '-L/Users/user/dev/glib/_build/gmodule', '-Wl,-rpath,/Users/user/dev/glib/_build/gmodule', '-L/Users/user/dev/glib/_build/gio', '-Wl,-rpath,/Users/user/dev/glib/_build/gio', '-L/opt/homebrew/Cellar/pcre2/10.44/lib', '-Wl,-rpath,/opt/homebrew/Cellar/pcre2/10.44/lib', '-L/Users/user/dev/glib/_build/gio', '-Wl,-rpath,/Users/user/dev/glib/_build/gio', '-L/Users/user/dev/glib/_build/glib', '-Wl,-rpath,/Users/user/dev/glib/_build/glib', '-L/Users/user/dev/glib/_build/subprojects/proxy-libintl', '-Wl,-rpath,/Users/user/dev/glib/_build/subprojects/proxy-libintl', '-L/Users/user/dev/glib/_build/gobject', '-Wl,-rpath,/Users/user/dev/glib/_build/gobject', '-L/Users/user/dev/glib/_build/gmodule', '-Wl,-rpath,/Users/user/dev/glib/_build/gmodule', '-L/opt/homebrew/Cellar/pcre2/10.44/lib', '-Wl,-rpath,/opt/homebrew/Cellar/pcre2/10.44/lib', '-L/opt/homebrew/Cellar/pcre2/10.44/lib', '-Wl,-rpath,/opt/homebrew/Cellar/pcre2/10.44/lib', '-L/opt/homebrew/Cellar/gobject-introspection/1.80.1/lib', '-Wl,-rpath,/opt/homebrew/Cellar/gobject-introspection/1.80.1/lib', '-L/opt/homebrew/Cellar/glib/2.80.4/lib', '-Wl,-rpath,/opt/homebrew/Cellar/glib/2.80.4/lib', '-L/opt/homebrew/opt/gettext/lib', '-Wl,-rpath,/opt/homebrew/opt/gettext/lib', '-lgio-2.0', '-lgirepository-2.0', '-lglib-2.0', '-lintl', '-lgobject-2.0', '-lgio-2.0', '-lgmodule-2.0', '-lz', '-lresolv', '-lffi', '-liconv', '-lm', '-lpcre2-8', '-lgirepository-1.0', '-lgobject-2.0', '-lglib-2.0', '-lintl', '-L/Users/user/dev/glib/_build/gmodule', '-L/Users/user/dev/glib/_build/gio', '-L/Users/user/dev/glib/_build/gobject', '-L/Users/user/dev/glib/_build/glib', '-L/Users/user/dev/glib/_build/subprojects/proxy-libintl', '-lgmodule-2.0', '-lgio-2.0', '-lgobject-2.0', '-lglib-2.0', '-lintl']' returned non-zero exit status 1.
ninja: build stopped: subcommand failed.