Solaris 10 sun studio 12 build failure

1) Using the following configure line:

CC="cc -xc99" ./configure --with-ssl=/usr/local/ssl --prefix=/usr/local --with-ldns=/usr/local

builds cleanly until:

./libtool --tag=CC --mode=compile cc -xc99 -I. -I. -I/usr/local/ssl/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -xO4 -xtarget=generic -D_REENTRANT -c util/netevent.c -o build/util/netevent.o
  cc -xc99 -I. -I. -I/usr/local/ssl/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -xO4 -xtarget=generic -D_REENTRANT -c util/netevent.c -KPIC -DPIC -o build/util/.libs/netevent.o
"util/netevent.c", line 305: warning: assignment type mismatch:
         pointer to char "=" pointer to unsigned char
"util/netevent.c", line 309: undefined struct/union member: msg_control
"util/netevent.c", line 309: warning: improper pointer/integer combination: op "="
"util/netevent.c", line 311: undefined struct/union member: msg_controllen
"util/netevent.c", line 313: undefined struct/union member: msg_flags
"util/netevent.c", line 316: warning: implicit function declaration: CMSG_FIRSTHDR
"util/netevent.c", line 316: warning: improper pointer/integer combination: op "="
"util/netevent.c", line 321: warning: implicit function declaration: CMSG_DATA
"util/netevent.c", line 322: warning: improper pointer/integer combination: arg #1
"util/netevent.c", line 335: warning: improper pointer/integer combination: arg #1
"util/netevent.c", line 341: warning: improper pointer/integer combination: arg #1
"util/netevent.c", line 344: improper member use: msg_controllen
"util/netevent.c", line 400: warning: assignment type mismatch:
         pointer to char "=" pointer to unsigned char
"util/netevent.c", line 404: undefined struct/union member: msg_control
"util/netevent.c", line 404: warning: improper pointer/integer combination: op "="
"util/netevent.c", line 406: undefined struct/union member: msg_controllen
"util/netevent.c", line 408: undefined struct/union member: msg_flags
"util/netevent.c", line 421: warning: improper pointer/integer combination: op "="
"util/netevent.c", line 422: warning: implicit function declaration: CMSG_NXTHDR
"util/netevent.c", line 422: warning: improper pointer/integer combination: op "="
"util/netevent.c", line 427: warning: improper pointer/integer combination: arg #2
"util/netevent.c", line 434: warning: improper pointer/integer combination: arg #2
"util/netevent.c", line 728: warning: assignment type mismatch:
         pointer to char "=" pointer to unsigned char
"util/netevent.c", line 730: warning: assignment type mismatch:
         pointer to char "=" pointer to unsigned char
make: *** [build/util/netevent.o] Error 1

The type mismatches are easy to fix, but those undefined struct/union member errors are weird; I assume this builds fine on linux but I can't find any of these members in the unbound source tree.

2) During configure, it would try to build ldns, as ldns was not installed. But ldns fails to configure; I've sent my fix to the ldns users list.

Cheers,

Nathan.

Hi Nathan,

Thanks for trying unbound.

Unbound compiles cleanly and is known to work on Solaris 9, 10 and 11,
using gcc compilers.

You are using the sun compiler and hence the errors.

So far for the audience, about your problems:
the code is from the part that uses the cmsghdr structure to send
ancillary information using sockets. This probably needs -D_EXTENSIONS_
and whatnot to get on Solaris. The detection for what -D... flags are
needed works well on gcc, but not on sun-cc I guess. This is because it
tries -std=c99, but that is really -xc99 I see on your system.

Can you try to pass
CC="cc -xc99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112
- -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE"

this enables all of them. not pretty. Can you send me your config.log
(offlist please, its pretty big) and perhaps your configure output,
maybe this can be fixed.

Maybe with proper system header definitions the improper assignment
errors go away as types are declared.

Best regards,
~ Wouter

Nathan Ollerenshaw wrote: