Probably someone more knowledgable than me can give you a comprehensive answer; anyway, from what I can tell, the issue may be related to __attribute__(constructor)
functions defined inside GLib.
Here’s a quick grep:
$ grep -rn --exclude-dir=".git" gconstructor.h
docs/reference/glib/meson.build:36: 'gconstructor.h',
gio/giomodule.c:76:#include "gconstructor.h"
gio/meson.build:933: input : ['data-to-c.py', files('../glib/gconstructor.h')],
gio/tests/resources.c:24:#include "gconstructor.h"
glib/gconstructor-private.h:30:#include "gconstructor.h"
glib/gconstructor.h:62: * so that items using gconstructor.h outside of GLib (such as
glib/glib-init.c:28:#include "gconstructor.h"
gobject/gobject.c:38:#include "gconstructor.h"
gobject/gtype.c:37:#include "gconstructor.h"
NEWS:656: - !2487 gconstructor.h: Visual Studio: Only include gslist.h if needed
NEWS:3130: - !791 glib/gconstructor.h: Include stdlib.h for MSVC builds
Apart from ancillary files and tests, constructors are used in:
I’d start by commenting out the constructors one by one and test if your program runs.