GNOME Bugzilla – Bug 562334
2.18.2 break libglade on Solaris
Last modified: 2017-11-16 13:16:59 UTC
After upgrading glib2 to 2.8.12/13 (I am using pkgsrc), compilation of libglade fails with gcc -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"libglade\" -I.. -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -I/usr/local/pkgsrc/pkgsrc-cvs/include/libxml2 -I/usr/local/pkgsrc/pkgsrc-cvs/include -I/usr/local/pkgsrc/pkgsrc-cvs/include/atk-1.0 -I/usr/local/pkgsrc/pkgsrc-cvs/include/glib/glib-2.0 -I/usr/local/pkgsrc/pkgsrc-cvs/lib/glib-2.0/include -I/usr/local/pkgsrc/pkgsrc-cvs/include/gtk-2.0 -I/usr/local/pkgsrc/pkgsrc-cvs/lib/gtk-2.0/include -I/usr/local/pkgsrc/pkgsrc-cvs/include/cairo -I/usr/local/pkgsrc/pkgsrc-cvs/include/pango-1.0 -I/usr/local/pkgsrc/pkgsrc-cvs/include/pixman-1 -I/usr/local/pkgsrc/pkgsrc-cvs/include/freetype2 -I/usr/local/pkgsrc/pkgsrc-cvs/include/libpng12 -DGLADE_LIBDIR=\"/usr/local/lib\" -DGLADE_PREFIX=\"/usr/local\" -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -I/usr/local/pkgsrc/pkgsrc-cvs/include -g -O2 -Wall -std=c9x -MT glade-init.lo -MD -MP -MF .deps/glade-init.Tpo -c glade-init.c -fPIC -DPIC -o .libs/glade-init.o In file included from /usr/local/pkgsrc/pkgsrc-cvs/include/glib/glib-2.0/glib/gbacktrace.h:35, from /usr/local/pkgsrc/pkgsrc-cvs/include/glib/glib-2.0/glib.h:36, from glade-init.c:27: /usr/include/signal.h:201: error: syntax error before '*' token The change in gbacktrace.h since 2.18.0 (which worked for Solaris) seems to be the unconditional inclusion of signal.h. Removing this include again solves the compilation problem.
What is the problem in the Solaris signal.h header, then ?
I don't think there is a "problem" with signal.h. As far as I can tell, it's just not needed. I have commented it out and continued building several packages that depend on it. The problematic part is the declaration of sigwait - which I think I can't post here, there's a big fat AT&T disclaimer at the top of signal.h. At the moment I don't have access to an OpenSolaris machine, but I can look it up there later.
On Solaris, /usr/include/signal.h has: #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS) #ifdef __PRAGMA_REDEFINE_EXTNAME #pragma redefine_extname sigwait __posix_sigwait extern int sigwait(const sigset_t *_RESTRICT_KYWD, int *_RESTRICT_KYWD); The problem is sigset_t is only defined in /usr/include/sys/signal.h (included from /usr/include/signal.h) if _XPG4_2 is defined. If it's not defined, you need to include /usr/include/sys/select.h. So the fix is to add #include <sys/select.h> to gbacktrace.h on Solaris.
Created attachment 259166 [details] [review] Implements comment 3 solution The suggested fix from comment 3 has been in pkgsrc since 2009/04/13. OK to commit?
2.5 years on - OK to commit?
Review of attachment 259166 [details] [review]: Sure. Sorry for the delay in reviewing.
Thanks for the review and committing it. https://git.gnome.org/browse/glib/commit/?id=b5733ecc76d8b80a78bfd35406b66a5217b60f20