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 645053 - shm: multiple compile failures on Solaris 10
shm: multiple compile failures on Solaris 10
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.21
Other Solaris
: Normal blocker
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-17 18:09 UTC by Tim Mooney
Modified: 2011-03-17 20:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (927 bytes, patch)
2011-03-17 19:29 UTC, Olivier Crête
committed Details | Review
change variable "sun" to "sock_un", so the cpp on Solaris doesn't transform it to 1. (2.22 KB, patch)
2011-03-17 20:18 UTC, Tim Mooney
committed Details | Review

Description Tim Mooney 2011-03-17 18:09:22 UTC
I'm building gst-plugins-bad 0.10.21 on x86_64-sun-solaris2.10 (not OpenSolaris) with the no-cost Sun Workshop 12u1 compiler chain.  I'm actually upgrading from slightly older versions of gstreamer/gst-plugins-base/gst-plugins-good/gst-plugins-bad/etc.

I've encountered two distinct compilation issues with the new sys/shm/shmpipe.c file.

1) Some of the socket code uses a variable named "sun":

    struct sockaddr_un sun;

The problem is that on Solaris, the cpp automatically defines "-Dsun=1", which
turns this into

    struct sockaddr_un 1;

which is a compilation error.  The fix is to just rename the variable to "sock_un".

I can provide a patch for this particular issue.

2) once that issue is bypassed, compilation fails because the code uses MSG_NOSIGNAL, which is not defined on Solaris (and apparently quite a few other platforms).  Grepping through the source tree for gst-plugins-bad, I find
an entry in ./docs/random/ChangeLog-0.8 indicating that some previous
source also had this problem, but the code was fixed to define MSG_NOSIGNAL
if not defined.  I can't find the code, so I'm guessing it's since been completely removed.
Comment 1 Olivier Crête 2011-03-17 19:29:47 UTC
Created attachment 183670 [details] [review]
proposed patch

Here is a proposed patch that checks if MSG_NOSIGNAL is defined before building the plugin..

I guess it should fail on Solaris and save us the trouble.
Comment 2 Tim Mooney 2011-03-17 20:17:26 UTC
Thanks Olivier, with your patch shmpipe is skipped at configure time.

I'm attaching the patch to change all instances of "sun" to "sock_un", that should address the other issue in the code, so in case OpenSolaris or Solaris 11 have MSG_NOSIGNAL defined and shmpipe is selected to be built, they won't be affected by the variable name choice.
Comment 3 Tim Mooney 2011-03-17 20:18:26 UTC
Created attachment 183676 [details] [review]
change variable "sun" to "sock_un", so the cpp on Solaris doesn't transform it to 1.
Comment 4 Olivier Crête 2011-03-17 20:44:58 UTC
commit 81b0d877461c7f9c7fdaeba00854a9ed8ae3f163
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Thu Mar 17 16:41:52 2011 -0400

    shm: Don't use "sun" as a variable name, breaks on Solaris
    
    Seems like the Solaris compiler has -Dsun=1, so don't use
    sun as a variable name
    
    Patch by Tim Mooney <mooney@dogbert.cc.ndsu.nodak.edu>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645053

commit e2445e26ff7dd8e26910161e4e5cea5dd42c1a26
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Thu Mar 17 15:27:39 2011 -0400

    shm: Check for MSG_NOSIGNAL macro
    
    Don't build the plugin is MSG_NOSIGNAL is not defined
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645053