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 667289 - build: Adds and uses SunPro visibilty attribute for proper function exports.
build: Adds and uses SunPro visibilty attribute for proper function exports.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: 0.10.37
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-04 19:53 UTC by Håvard Graff (hgr)
Modified: 2012-03-21 11:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.32 KB, patch)
2012-01-04 19:53 UTC, Håvard Graff (hgr)
committed Details | Review

Description Håvard Graff (hgr) 2012-01-04 19:53:36 UTC
Created attachment 204606 [details] [review]
patch

.
Comment 1 Tim-Philipp Müller 2012-01-05 00:24:16 UTC
This patch did a bit more than it said in the commit message, and no reason why this is useful or what this fixes is actually given (why is the symbol not exported by default with sunpro?). In any case, I've removed the bit where it sets the visibility for gcc as well (not that I think it's wrong, but if it's not needed, I don't see a point in changing it either, esp. if the commit message doesn't mention it).


commit c8c961ac816ec911f00ec06852779e16d181432d
Author: Idar Tollefsen <itollefs@cisco.com>
Date:   Sun Jan 1 16:46:04 2012 +0100

    gstconfig.h: adds and uses SunPro visibility attribute for proper function exports
    
    Define GST_EXPORT for SunPro.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=667289
Comment 2 Idar Tollefsen 2012-03-21 11:54:44 UTC
The commit messages should indeed have been better.

There are two things leading up to this.

Firstly, both for SunPro and GCC, the default visibility of functions exported from a library can be set either with command line options or through attributes like the one in the patch. The default for both is global visibility. If this is lowered on the command line (say to "protected"), then this sort of macro is needed to make sure the function gets exported.

That said, the use of "extern" should be enough to inform the compiler that even if the visibility has been lowered, this function should still be visible.

Which brings me to the second and specific reason why this patch was needed; When compiling with SunPro (on Solaris) with high levels of optimization and link-time optimization turned on ("-xipo" is enough), it decides that this symbol isn't used outside of the library as it finds it internally and therefore doesn't export it. The visibility attribute fixes this and forces it to export it anyway.

The SunPro version check there is sort of arbitrary. I'm not sure exactly which version of SunPro attribute handling was introduced, but I know it exists in the version it checks for here.