GNOME Bugzilla – Bug 639252
gsocket.c does not compile on Solaris 9 using GCC.
Last modified: 2011-01-12 00:07:43 UTC
Created attachment 178087 [details] Patch for gsocket.c for Solaris 9 % uname -a SunOS arcade 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire-V490 Solaris % gcc --version gcc (GCC) 4.2.4 Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. % ./configure --prefix=/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13 --build=sparc-sun-solaris2.9 % make ... /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GIO\" -I.. -I.. -I../glib -I../gmodule -DG_DISABLE_CAST_CHECKS -DG_THREADS_MANDATORY -DG_DISABLE_DEPRECATED -DGIO_COMPILATION -DGIO_MODULE_DIR=\"/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/lib/gio/modules\" -I/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/include -I/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/libiconv/include -DG_DISABLE_SINGLE_INCLUDES -D_REENTRANT -D_PTHREADS -O2 -I/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/include -I/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/libiconv/include -Wall -MT gsocket.lo -MD -MP -MF .deps/gsocket.Tpo -c -o gsocket.lo gsocket.c gsocket.c: In function 'IA__g_socket_send_message': gsocket.c:2681: warning: implicit declaration of function 'CMSG_SPACE' gsocket.c:2690: warning: implicit declaration of function 'CMSG_LEN' ... /bin/bash ../libtool --tag=CC --mode=link gcc -O2 -I/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/include -I/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/libiconv/include -Wall -L/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/lib -L/sea/compilers/native/gcc-4.2.4/V1.2/lib -L/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/libiconv/lib -o gio-querymodules gio-querymodules.o ../glib/libglib-2.0.la ../gobject/libgobject-2.0.la ../gmodule/libgmodule-2.0.la libgio-2.0.la libtool: link: gcc -O2 -I/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/include -I/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/libiconv/include -Wall -o .libs/gio-querymodules gio-querymodules.o -L/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/lib -L/sea/compilers/native/gcc-4.2.4/V1.2/lib -L/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/libiconv/lib ../glib/.libs/libglib-2.0.so ../gobject/.libs/libgobject-2.0.so ../gmodule/.libs/libgmodule-2.0.so ./.libs/libgio-2.0.so /uadev/scm/rmadsen/sea/local/sparc-sunos-solaris-9/glib-2.24.2/gobject/.libs/libgobject-2.0.so /uadev/scm/rmadsen/sea/local/sparc-sunos-solaris-9/glib-2.24.2/gthread/.libs/libgthread-2.0.so -lpthread -lthread -lrt /uadev/scm/rmadsen/sea/local/sparc-sunos-solaris-9/glib-2.24.2/gmodule/.libs/libgmodule-2.0.so /uadev/scm/rmadsen/sea/local/sparc-sunos-solaris-9/glib-2.24.2/glib/.libs/libglib-2.0.so -lresolv -lz -Wl,-rpath -Wl,/uadev/scm/rmadsen/sea/local/install/sparc-sunos-solaris-9/versions/3.0.0.13/lib ./.libs/libgio-2.0.so: undefined reference to `CMSG_LEN' ./.libs/libgio-2.0.so: undefined reference to `CMSG_SPACE' collect2: ld returned 1 exit status The issue here is that the CMSG_LEN and CMSG_SPACE macros are not defined in /usr/include/sys/socket.h on all systems. However, all the functions/macros that these CMSG_LEN and CMSG_SPACE are defined. Thus, my solution to the problem was to conditionally define these two macros in gsocket.c. Probably not a good long term solution, but it works...
2.24 is an old version. This has been fixed for a year now. *** This bug has been marked as a duplicate of bug 589989 ***