GNOME Bugzilla – Bug 793086
static library compilation fails on windows
Last modified: 2018-05-24 20:10:28 UTC
Created attachment 367740 [details] [review] patch of required changes This is a patch to fix static builds for windows and the appropriate changes to the meson build tool. This includes: Moving initialization functions inside glib_init() so that they are properly called during static initialization. It is critical that they be added to glib_init() as the gobject ctors function only calls glib_init() and so in a static build where order of initialization might not deterministic putting these outside glib_init() may result in glib_init() being called before windows threading is initialized leading to segfaults. See https://bugzilla.gnome.org/show_bug.cgi?id=756139 Fixing #if's so that during static compilation extraneous DllMain symbols are not exported which would prevent linking. Fixing up meson.build's to set proper defines for subprojects when building statically. Forgive my patch file if it was incorrectly created. I havn't created one before for submission with a bug report. I diff'ed between my changes and a clean copy of the tarball.
Appears this may be a duplicate of Bug 698118 However my patch does include required changes to the Meson build to support static compilation.
Is this for MSVC or MinGW? (I've filed a similar bug 792297 for MinGW)
This is for MSVC
For anyone who finds this, the patch is indeed incomplete. Please refer to bug #698118 >So, in summation the current patch is incomplete since destructors aren't >called on thread exit, so these patches will leak one GPrivate per thread. >The best fix right now is to detect when a thread exits by polling on a kernel mutex.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1330.