Bug 799 - Build error on Solaris 10 SPARC
Build error on Solaris 10 SPARC
Status: RESOLVED DUPLICATE of bug 779
Product: unbound
Classification: Unclassified
Component: server
1.5.9
Sun other
: P5 normal
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-20 14:00 CEST by Ihsan Dogan
Modified: 2016-07-20 15:58 CEST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ihsan Dogan 2016-07-20 14:00:27 CEST
Hi,

I'm the package maintainer for the Unbound resolver at the OpenCSW project. Building Unbound using the Sun compiler on Solaris 10 SPARC fails:

libtool: compile:  /opt/SUNWspro/bin/cc -I. -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -xO3 -m32 -xarch=sparc -xc99 -flto -mt -D_REENTRANT -c services/listen_dnsport.c -o listen_dnsport.o >/dev/null 2>&1
./libtool --tag=CC --mode=compile /opt/SUNWspro/bin/cc -I. -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -xO3 -m32 -xarch=sparc -xc99 -flto -mt -D_REENTRANT  -o outside_network.lo -c `cat .source`
libtool: compile:  /opt/SUNWspro/bin/cc -I. -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -xO3 -m32 -xarch=sparc -xc99 -flto -mt -D_REENTRANT -c services/outside_network.c  -KPIC -DPIC -o .libs/outside_network.o
cc: Warning: illegal option -flto
libtool: compile:  /opt/SUNWspro/bin/cc -I. -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -xO3 -m32 -xarch=sparc -xc99 -flto -mt -D_REENTRANT -c services/outside_network.c -o outside_network.o >/dev/null 2>&1
./libtool --tag=CC --mode=compile /opt/SUNWspro/bin/cc -I. -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -xO3 -m32 -xarch=sparc -xc99 -flto -mt -D_REENTRANT  -o ub_event.lo -c `cat .source`
libtool: compile:  /opt/SUNWspro/bin/cc -I. -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -I/opt/csw/include -xO3 -m32 -xarch=sparc -xc99 -flto -mt -D_REENTRANT -c util/ub_event.c  -KPIC -DPIC -o .libs/ub_event.o
cc: Warning: illegal option -flto
"util/ub_event.c", line 179: invalid cast expression
"util/ub_event.c", line 201: invalid cast expression
"util/ub_event.c", line 245: invalid cast expression
"util/ub_event.c", line 256: invalid cast expression
"util/ub_event.c", line 269: invalid cast expression
"util/ub_event.c", line 278: invalid cast expression
"util/ub_event.c", line 284: invalid cast expression
"util/ub_event.c", line 297: invalid cast expression
"util/ub_event.c", line 301: invalid cast expression
"util/ub_event.c", line 314: invalid cast expression
"util/ub_event.c", line 318: invalid cast expression
"util/ub_event.c", line 348: invalid cast expression
"util/ub_event.c", line 354: invalid cast expression
"util/ub_event.c", line 360: invalid cast expression
"util/ub_event.c", line 367: invalid cast expression
"util/ub_event.c", line 373: invalid cast expression
"util/ub_event.c", line 379: invalid cast expression
"util/ub_event.c", line 386: invalid cast expression
"util/ub_event.c", line 387: invalid cast expression
"util/ub_event.c", line 387: invalid cast expression
"util/ub_event.c", line 389: invalid cast expression
"util/ub_event.c", line 395: invalid cast expression
"util/ub_event.c", line 401: invalid cast expression
"util/ub_event.c", line 407: invalid cast expression
cc: acomp failed for util/ub_event.c
Makefile:267: recipe for target 'ub_event.lo' failed
gmake: *** [ub_event.lo] Error 1

I'm using this configure options:
CONFIGURE_ARGS  = $(DIRPATHS)
CONFIGURE_ARGS += --with-libevent=/opt/csw
CONFIGURE_ARGS += --with-libexpat=/opt/csw
CONFIGUTE_ARGS += --with-solaris-threads
CONFIGURE_ARGS += --with-ldns=/opt/csw
CONFIGURE_ARGS += --with-ssl=/opt/csw
CONFIGURE_ARGS += --with-pidfile=/var/run/unbound.pid
CONFIGURE_ARGS += --sysconfdir=/etc/opt/csw
CONFIGURE_ARGS += --enable-shared
Comment 1 Wouter Wijngaards 2016-07-20 14:11:21 CEST
Hi Ihsan,

This is already fixed.  Download ub_event.c and ub_event_pluggable.c to fix it (from the code repository) or use the patch below.

Thanks for the report.

Best regards, Wouter


Index: util/ub_event.c
===================================================================
--- util/ub_event.c	(revision 3788)
+++ util/ub_event.c	(revision 3789)
@@ -132,14 +132,10 @@
 #define EVFLAG_AUTO 0
 #endif
 
-#define AS_EVENT_BASE(x) \
-	(((union {struct ub_event_base* a; struct event_base* b;})x).b)
-#define AS_UB_EVENT_BASE(x) \
-	(((union {struct event_base* a; struct ub_event_base* b;})x).b)
-#define AS_EVENT(x) \
-	(((union {struct ub_event* a; struct event* b;})x).b)
-#define AS_UB_EVENT(x) \
-	(((union {struct event* a; struct ub_event* b;})x).b)
+#define AS_EVENT_BASE(x) ((struct event_base*)x)
+#define AS_UB_EVENT_BASE(x) ((struct ub_event_base*)x)
+#define AS_EVENT(x) ((struct event*)x)
+#define AS_UB_EVENT(x) ((struct ub_event*)x)
 
 const char* ub_event_get_version()
 {
Index: util/ub_event_pluggable.c
===================================================================
--- util/ub_event_pluggable.c	(revision 3788)
+++ util/ub_event_pluggable.c	(revision 3789)
@@ -144,10 +144,8 @@
 	struct event ev;
 };
 
-#define AS_MY_EVENT_BASE(x) \
-	(((union {struct ub_event_base* a; struct my_event_base* b;})x).b)
-#define AS_MY_EVENT(x) \
-	(((union {struct ub_event* a; struct my_event* b;})x).b)
+#define AS_MY_EVENT_BASE(x) ((struct my_event_base*)x)
+#define AS_MY_EVENT(x) ((struct my_event*)x)
 
 const char* ub_event_get_version()
 {

*** This bug has been marked as a duplicate of bug 779 ***
Comment 2 Ihsan Dogan 2016-07-20 15:58:14 CEST
Hi Wouter,

Thanks. Patch works very well.



-Ihsan