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 110859 - gnet 2.0.0 doesn't build on Solaris 7
gnet 2.0.0 doesn't build on Solaris 7
Status: VERIFIED FIXED
Product: gnet
Classification: Other
Component: general
unspecified
Other opensolaris
: Normal normal
: ---
Assigned To: dhelder
dhelder
Depends on:
Blocks:
 
 
Reported: 2003-04-15 14:39 UTC by Charles Kerr
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config.log (51.39 KB, text/plain)
2003-04-15 14:40 UTC, Charles Kerr
Details
php 4.3.1's configure.in (37.96 KB, text/plain)
2003-04-15 16:43 UTC, Charles Kerr
Details
php 4.3.1's php_network.h (5.77 KB, text/plain)
2003-04-15 16:44 UTC, Charles Kerr
Details

Description Charles Kerr 2003-04-15 14:39:43 UTC
% uname -a
SunOS osserver1 5.7 Generic_106541-23 sun4u sparc SUNW,Ultra-60

make  all-recursive
make[1]: Entering directory `/users/ckerr/src/new/gnet-2.0.0'
Making all in src
make[2]: Entering directory `/users/ckerr/src/new/gnet-2.0.0/src'
/usr/local/bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
-I.. -DG_LOG_DOMAIN=\"GNet\"  	-I/users/ckerr/gnome2/include/glib-2.0
-I/users/ckerr/gnome2/lib/glib-2.0/include   -pthreads
-I/users/ckerr/gnome2/include/glib-2.0
-I/users/ckerr/gnome2/lib/glib-2.0/include    
-I/users/ckerr/gnome2/include -I/users/ckerr/include 
-I/users/opup/devtools/include
-I/users/opup/new_build/build/third_party/X11R6_headers/
-I/users/ckerr/include  -g -Wall -D_REENTRANT -DGNET_EXPERIMENTAL -Wall
-Wstrict-prototypes     -Wmissing-prototypes -Wmissing-declarations -c gnet.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"GNet\"
-I/users/ckerr/gnome2/include/glib-2.0
-I/users/ckerr/gnome2/lib/glib-2.0/include -pthreads
-I/users/ckerr/gnome2/include/glib-2.0
-I/users/ckerr/gnome2/lib/glib-2.0/include -I/users/ckerr/gnome2/include
-I/users/ckerr/include -I/users/opup/devtools/include
-I/users/opup/new_build/build/third_party/X11R6_headers/
-I/users/ckerr/include -g -Wall -D_REENTRANT -DGNET_EXPERIMENTAL -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -c gnet.c 
-fPIC -DPIC -o .libs/gnet.lo
In file included from gnet.c:21:
gnet-private.h:174: field `sa' has incomplete type
gnet-private.h:182: field `sa' has incomplete type
gnet-private.h:190: field `sa' has incomplete type
gnet-private.h:212: field `sa' has incomplete type
gnet.c: In function `ipv6_detect_envvar':
gnet.c:85: warning: implicit declaration of function `index'
gnet.c:85: warning: assignment makes pointer from integer without a cast
gnet.c:86: warning: assignment makes pointer from integer without a cast
make[2]: *** [gnet.lo] Error 1
make[2]: Leaving directory `/users/ckerr/src/new/gnet-2.0.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/users/ckerr/src/new/gnet-2.0.0'
make: *** [all-recursive-am] Error 2
3 warnings
Comment 1 Charles Kerr 2003-04-15 14:40:27 UTC
Created attachment 15741 [details]
config.log
Comment 2 dhelder 2003-04-15 15:11:24 UTC
There seems to be two problems:

1.struct sockaddr_storage isn't defined in gnet-private.h.  Is this in
a different header file on Solaris?

2. strchr() should be used instead of index() in gnet.c.  I will fix this.
Comment 3 Charles Kerr 2003-04-15 16:43:01 UTC
Looks like, after a little Googling, that Solaris 6 & 7
don't define sockaddr_storage at all.  PHP has worked
around this in its configure.in, by checking for the
structure and, if it's not present, defining it itself.

The attached files are from php 4.3.1, which might be
a useful template: configure.in has tests for
sockaddr_storage and sockaddr_len, and php_network.h
uses these #defines to build the struct when necessary.
Comment 4 Charles Kerr 2003-04-15 16:43:41 UTC
Created attachment 15745 [details]
php 4.3.1's configure.in
Comment 5 Charles Kerr 2003-04-15 16:44:24 UTC
Created attachment 15746 [details]
php 4.3.1's php_network.h
Comment 6 dhelder 2003-04-15 17:39:46 UTC
Ok, I've committed the change to CVS.  Could you try it out?  Thanks.
Comment 7 Charles Kerr 2003-04-15 18:21:46 UTC
Since GNet uses "struct sockaddr_storage" everywhere,
the declaration needs to be:

Index: gnet-private.h
===================================================================
RCS file: /cvs/gnome/gnet/src/gnet-private.h,v
retrieving revision 1.43
diff -u -u -r1.43 gnet-private.h
--- gnet-private.h	15 Apr 2003 17:38:48 -0000	1.43
+++ gnet-private.h	15 Apr 2003 18:14:35 -0000
@@ -71,7 +71,7 @@
 #include <netdb.h>
 
 #ifndef HAVE_SOCKADDR_STORAGE
-typedef struct {
+struct sockaddr_storage {
 #ifdef HAVE_SOCKADDR_LEN
 		unsigned char ss_len;
 		unsigned char ss_family;
@@ -79,7 +79,7 @@
         unsigned short ss_family;
 #endif
         char info[126];
-} sockaddr_storage;
+};
 #endif

This gets us a little further, dying at gnet-private:

gnet-private.c: In function `gnet_private_create_listen_socket':
gnet-private.c:44: dereferencing pointer to incomplete type
gnet-private.c:67: `AF_INET6' undeclared (first use in this function)
gnet-private.c:67: (Each undeclared identifier is reported only once
gnet-private.c:67: for each function it appears in.)
gnet-private.c:70: dereferencing pointer to incomplete type
gnet-private.c:72: dereferencing pointer to incomplete type
gnet-private.c:72: dereferencing pointer to incomplete type
gnet-private.c:73: dereferencing pointer to incomplete type
make: *** [gnet-private.lo] Error 1

Comment 8 dhelder 2003-04-16 16:24:40 UTC
Ok, try CVS again.  Or this snapshot:
www.gizmolabs.org/~dhelder/gnet030416.tar.gz

This now defines a HAVE_IPV6 in config.h.
Comment 9 Charles Kerr 2003-04-17 21:34:58 UTC
With a couple of small caveats, gnet030416.tar.gz does the trick:

(1) a lot of warnings about     gcc: unrecognize option `-pthread'.
  However, everything built fine, so mayb e this is a problem
on my end.

(2)  unit test failures:

set_bytes addr6: FAIL
new_bytes length6: FAIL
get_bytes addr: FAIL
!IPv4 (inetaddr new): FAIL

(process:28407): GNet-CRITICAL **: file inetaddr.c: line 2230 (gnet_inetaddr_get_canonical_name): assertion `inetaddr
!= NULL' failed
!IPv4 (get cname): FAIL
FAIL: inetaddr_test
PASS: ipv6_test
PASS: pack_test
PASS: unpack_test
PASS: uri_test
===================
1 of 7 tests failed
===================
Comment 10 dhelder 2003-04-18 20:09:18 UTC
Great!  This snapshot might fix the pthread warning and should fix the
testcase:
http://www.gnetlibrary.org/snapshot/gnet030418.tar.gz
Comment 11 dhelder 2003-04-24 15:24:38 UTC
This should now be fixed in 2.0.1.