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 794636 - G_HAVE_GNUC_VISIBILITY is defined in meson MinGW builds
G_HAVE_GNUC_VISIBILITY is defined in meson MinGW builds
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 790954
 
 
Reported: 2018-03-23 18:45 UTC by LRN
Modified: 2018-03-28 11:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use a real test for G_HAVE_GNUC_VISIBILITY (2.70 KB, patch)
2018-03-23 18:45 UTC, LRN
committed Details | Review

Description LRN 2018-03-23 18:45:24 UTC
This causes G_GNUC_INTERNAL to be incorrectly defined,
and later each function with G_GNUC_INTERNAL produces
a compile-time warning.
Comment 1 LRN 2018-03-23 18:45:33 UTC
Created attachment 370063 [details] [review]
Use a real test for G_HAVE_GNUC_VISIBILITY

Accurate G_HAVE_GNUC_VISIBILITY is needed to correctly
define G_GNUC_INTERNAL later on. Autotools did that,
meson currently doesn't and opts to just set
G_HAVE_GNUC_VISIBILITY to 1 for all compilers except MSVC.
This leads to MinGW GCC having G_HAVE_GNUC_VISIBILITY=1,
which results in G_GNUC_INTERNAL being defined to
__attribute__((visibility("hidden"))), which is not supported.

Because cc.compiles() does not support override_options or
anything like that, we just feed it '-Werror' as-is, since
MSVC is known as not supporting visibility attributes anyway.
Comment 2 Emmanuele Bassi (:ebassi) 2018-03-28 11:19:16 UTC
Review of attachment 370063 [details] [review]:

Okay
Comment 3 LRN 2018-03-28 11:56:45 UTC
Attachment 370063 [details] pushed as a9c6531 - Use a real test for G_HAVE_GNUC_VISIBILITY