After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792297 - win32: Make the static build work with MinGW when posix threads are used
win32: Make the static build work with MinGW when posix threads are used
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: win32
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks: 698118
 
 
Reported: 2018-01-07 08:45 UTC by Christoph Reiter (lazka)
Modified: 2018-05-24 20:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
win32: Make the static build work with MinGW when posix threads are used (2.42 KB, patch)
2018-01-07 08:45 UTC, Christoph Reiter (lazka)
none Details | Review

Description Christoph Reiter (lazka) 2018-01-07 08:45:46 UTC
Created attachment 366450 [details] [review]
win32: Make the static build work with MinGW when posix  threads are used

MinGW does not support the use of DllMain() for static builds, but that
is currently always used on Windows, partly because it is needed for
handling win32 threads and because there are problems with MSVC
optimizing constructors away (see 7a29771a743a8b5337).

To make the static build at least work in case mingw+posix threads are used,
switch to using constructors for that. The g_clock_win32_init() call is
moved into glib_init(), so it's also called in that case.

If mingw+static+win32 threads are used abort the build early and print
an error message.

----

A similar patch is currently used in msys2 [0], but the one here limits the change to mingw + static + posix threads.

[0] https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-glib2/0004-glib-prefer-constructors-over-DllMain.patch
Comment 1 GNOME Infrastructure Team 2018-05-24 20:07:42 UTC
-- 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/1322.