GNOME Bugzilla – Bug 645053
shm: multiple compile failures on Solaris 10
Last modified: 2011-03-17 20:58:02 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.
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.
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.
Created attachment 183676 [details] [review] change variable "sun" to "sock_un", so the cpp on Solaris doesn't transform it to 1.
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