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 645336 - Solaris needs #include <sys/mkdev.h> and -lresolv -lnsl -lsocket in gio
Solaris needs #include <sys/mkdev.h> and -lresolv -lnsl -lsocket in gio
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.26.x
Other Solaris
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-03-20 21:34 UTC by Marcin Cieślak
Modified: 2011-09-04 13:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config.log from failed mingw32 ./configure (311.33 KB, text/x-log)
2011-09-04 05:25 UTC, Allison Karlitskaya (desrt)
Details
config.log from failed mingw32 ./configure (525.87 KB, text/x-log)
2011-09-04 05:26 UTC, Allison Karlitskaya (desrt)
Details

Description Marcin Cieślak 2011-03-20 21:34:43 UTC
Two unrelated problems when building glib-2.26.1 from source on Solaris 5.9 for SPARC:

--------------------------------------------------------
libgio compilation fails with two undefined symbols:

major
minor

Adding 

#include <sys/mkdev.h>

to gio/gdbusmessage.c solves this issue
--------------------------------------------------------

gio/tests fail with:

/bin/bash ../../libtool  --tag=CC    --mode=link /usr/local/bin/gcc  -mcpu=v9 -Wall   -L/home/admini/saper/lib -o socket socket.o ../../glib/libglib-2.0.la              ../../gthread/libgthread-2.0.la         ../../gobject/libgobject-2.0.la         ../../gio/libgio-2.0.la 
libtool: link: /usr/local/bin/gcc -mcpu=v9 -Wall -o .libs/socket socket.o  -L/home/admini/saper/lib ../../glib/.libs/libglib-2.0.so ../../gthread/.libs/libgthread-2.0.so ../../gobject/.libs/libgobject-2.0.so ../../gio/.libs/libgio-2.0.so /home/admini/saper/src/glib-2.26.1/gobject/.libs/libgobject-2.0.so /home/admini/saper/src/glib-2.26.1/gthread/.libs/libgthread-2.0.so -lpthread -lthread -lrt /home/admini/saper/src/glib-2.26.1/gmodule/.libs/libgmodule-2.0.so -ldl /home/admini/saper/src/glib-2.26.1/glib/.libs/libglib-2.0.so /home/admini/saper/lib/libiconv.so /home/admini/saper/lib/libpcre.so -lresolv -lz -R/home/admini/saper/lib
ld: warning: file /home/admini/saper/src/glib-2.26.1/gobject/.libs/libgobject-2.0.so: linked to ../../gobject/.libs/libgobject-2.0.so: attempted multiple inclusion of file
ld: warning: file /home/admini/saper/src/glib-2.26.1/gthread/.libs/libgthread-2.0.so: linked to ../../gthread/.libs/libgthread-2.0.so: attempted multiple inclusion of file
ld: warning: file /home/admini/saper/src/glib-2.26.1/glib/.libs/libglib-2.0.so: linked to ../../glib/.libs/libglib-2.0.so: attempted multiple inclusion of file
Undefined                       first referenced
 symbol                             in file
socket                              socket.o  (symbol belongs to implicit dependency /usr/lib/libsocket.so.1)
ld: fatal: Symbol referencing errors. No output written to .libs/socket
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `socket'

Changing empty "LIBS = " to "LIBS = -lresolv -lsocket -lnsl" in gio/tests/Makefile fixes the problem


Configure invocation:

env CFLAGS="-mcpu=v9" PCRE_CFLAGS="-I$HOME/include" PCRE_LIBS="-L$HOME
/lib -lpcre" ./configure --prefix=$HOME --disable-fam --enable-static 
--disable-gtk-doc --disable-man --without-xml-catalog --disable-dtrace
 --with-pcre=system --with-libiconv=gnu
Comment 1 Dan Winship 2011-08-24 00:01:55 UTC
the sys/mkdev part was fixed as bug 637013, which didn't mention anything about -lsocket, etc. is that still needed? If so, can you provide a configure.ac patch?
Comment 2 Marcin Cieślak 2011-08-24 03:43:33 UTC
The problem with -lsocket is unrelated to the mkdev.h problem. 

This is because gio/tests/Makefile does not somehow have means to guess additional socket libraries, so it's only in tests.

There is a check for -lresolv  already present in configure.ac (for gio/libasyncns) but my autoconf foo is too limited to come up with something reasonable. Testing for those 3 libraries to use sockets and name resolution on Solaris is pretty common and there should be some macros to do that.
Comment 3 Dan Winship 2011-09-03 23:59:37 UTC
fixed in master
Comment 4 Allison Karlitskaya (desrt) 2011-09-04 05:25:28 UTC
Created attachment 195610 [details]
config.log from failed mingw32 ./configure

commit 0d637931299f254e1b9a2cdb2d4e050b157ec8d9 breaks the build on mingw32:

...
checking arpa/nameser_compat.h presence... no
checking for arpa/nameser_compat.h... no
checking for strndup... no
checking for setresuid... no
checking for setreuid... no
checking sys/prctl.h usability... no
checking sys/prctl.h presence... no
checking for sys/prctl.h... no
checking for res_query... configure: error: not found
Comment 5 Allison Karlitskaya (desrt) 2011-09-04 05:26:58 UTC
Created attachment 195611 [details]
config.log from failed mingw32 ./configure

wrong config.log, sorry.  this is the correct one.
Comment 6 Dan Winship 2011-09-04 13:02:44 UTC
fixed