Request that G_GNUC_INTERNAL supports Sun Studio

This is regarding glib bug #342981, and you can read a lengthy discussion about this here:

In summary, many of you are probably aware that Sun has strict
rules about following sane ABI rules and we cannot ship software
that exports library symbols that are not intended for export.
Since glib exports the G_GNUC_INTERNAL macro, modules which use
it will not export certain symbols only when the GCC compiler
is used.  This was identified as a serious issue at Sun, and we
were required to enforce that this macro is honored when building
with the Sun Studio compiler.

So at Sun, we patch the code with the patch in the above bug
report to define the macro to "__hidden" when compiling with the
Sun Studio compiler.  Unfortunately the Sun Studio __hidden macro
only works when it is used at the beginning of a prototype rather
than how the GCC hidden attribute works.  The GCC attribute can be
used either before or after the prototype, it doesn't care.  So, at
Sun, we are currently patching all GNOME modules so the macro is used
more consistently at the beginning of the prototype.

Fortunately most maintainers have been willing to accept our patches
that moves the macro to the beginning since it doesn't affect
GCC at all and makes life easier for us at Sun (and for Solaris users).
So, I'd say that right now there are only a few GNOME modules (aside
from glib itself) which don't currently use the macro at the beginning.
The ones that haven't yet accepted our patches are waiting to see if the
glib patch in bug #342981 goes in before they will accept our patches to
move the macro.

The glib maintainers are agreeable to accept this patch into
glib head.  They also want to add comments to the API docs that
recommend using the macro at the beginning of prototypes for best
compatibility with Sun Studio compiler.

Since we already patch glib on Solaris/OpenSolaris with this change,
any issues introduced by this problem already exist for Solaris users.
While it may be some hassle for Solaris users to need to move the
macro usage in order to get code to compile, we think it is better
to ensure that symbols are properly hidden than to avoid the slight
inconveniences that this will cause for some users.  Since we
are working with GNOME module maintainers to have the macro moved to
the beginning of the prototype for all GNOME modules, we don't expect
that users will encounter this sort of problem often.

I wanted to bring up this issue on gtk-devel-list before going ahead
and making this change to add Sun Studio support for this macro in
glib so that anybody with any comments or concerns can discuss.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]