1.9.11 compile failure on HP-UX 11.23 and AIX 5.x
I'm getting the same compile failure on HP-UX and AIX using the vendor compiler: xlc -DHAVE_CONFIG_H -I. -I. -I.. -DPATH_SYSCONFDIR=\"/etc/opt/TWWfsw/syslogng1911\" -DPATH_LOCALSTATEDIR=\"/var/opt/TWWfsw/syslogng1911\" -I/opt/TWWfsw/libglib26/include -I/opt/TWWfsw/libglib26/lib/include -I/opt/TWWfsw/gettext014/include -I/opt/TWWfsw/syslogng1911/include/eventlog -D_GNU_SOURCE -O2 -ma -qro -qroconst -qmaxmem=-1 -qarch=com -c afinet.c "/usr/include/alloca.h", line 34.1: 1506-224 (I) Incorrect pragma ignored. "afinet.c", line 183.13: 1506-021 (S) Expecting struct or union. gmake[2]: *** [afinet.o] Error 1 gmake[2]: Leaving directory `/opt/build/syslog-ng-1.9.11/src' The problem is the following line: if (IN6_IS_ADDR_MULTICAST(g_sockaddr_inet6_get_address(addr)->s6_addr)) On AIX, from <netinet/in.h>: #define IN6_IS_ADDR_MULTICAST(p) IS_MULTIADDR6(*p) #define IS_MULTIADDR6(a) ((a).s6_addr8[0] == 0xff) #define s6_addr8 u6_addr.u6_addr8 #define s6_addr u6_addr.u6_addr8 So, IN6_IS_ADDR_MULTICAST(addr) is converted to IS_MULTIADDR6(*addr) and then: ((*addr).u6_addr.u6_addr8[0] == 0xff So, because addr == g_sockaddr_inet6_get_address(addr)->s6_addr, we get the following expansion: if (((*g_sockaddr_inet6_get_address(addr)->u6_addr.u6_addr8).u6_addr.u6_addr8[0] == 0xff)) The Redhat Linux definition is: #define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff) The HP-UX 11.23 definition is: #define IN6_IS_ADDR_MULTICAST(i) ((((i)->s6_addr[0] ^ 0xff) \ | ((i)->s6_addr[1] & 0xe0)) == 0) ntp-4.2.0a also uses IN6_IS_ADDR_MULTICAST but does the following: if (IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6*)srcadr)->sin6_addr)) -- albert chin (china@thewrittenword.com)
On Wed, May 31, 2006 at 01:16:55PM -0500, Albert Chin wrote:
I'm getting the same compile failure on HP-UX and AIX using the vendor compiler: xlc -DHAVE_CONFIG_H -I. -I. -I.. -DPATH_SYSCONFDIR=\"/etc/opt/TWWfsw/syslogng1911\" -DPATH_LOCALSTATEDIR=\"/var/opt/TWWfsw/syslogng1911\" -I/opt/TWWfsw/libglib26/include -I/opt/TWWfsw/libglib26/lib/include -I/opt/TWWfsw/gettext014/include -I/opt/TWWfsw/syslogng1911/include/eventlog -D_GNU_SOURCE -O2 -ma -qro -qroconst -qmaxmem=-1 -qarch=com -c afinet.c "/usr/include/alloca.h", line 34.1: 1506-224 (I) Incorrect pragma ignored. "afinet.c", line 183.13: 1506-021 (S) Expecting struct or union. gmake[2]: *** [afinet.o] Error 1 gmake[2]: Leaving directory `/opt/build/syslog-ng-1.9.11/src'
The following patch makes the build succeed. I haven't tested the binary yet though. --- src/afinet.c.new 2006-05-31 13:28:11.817824000 -0500 +++ src/afinet.c 2006-05-31 13:27:50.281493000 -0500 @@ -178,7 +178,7 @@ { struct ipv6_mreq mreq6; - if (IN6_IS_ADDR_MULTICAST(&g_sockaddr_inet6_get_sa(addr)->sin6_addr)) + if (IN6_IS_ADDR_MULTICAST(g_sockaddr_inet6_get_address(addr)->s6_addr)) { if (dir & AFSOCKET_DIR_RECV) { -- albert chin (china@thewrittenword.com)
On Wed, 2006-05-31 at 13:29 -0500, Albert Chin wrote:
On Wed, May 31, 2006 at 01:16:55PM -0500, Albert Chin wrote:
I'm getting the same compile failure on HP-UX and AIX using the vendor compiler: xlc -DHAVE_CONFIG_H -I. -I. -I.. -DPATH_SYSCONFDIR=\"/etc/opt/TWWfsw/syslogng1911\" -DPATH_LOCALSTATEDIR=\"/var/opt/TWWfsw/syslogng1911\" -I/opt/TWWfsw/libglib26/include -I/opt/TWWfsw/libglib26/lib/include -I/opt/TWWfsw/gettext014/include -I/opt/TWWfsw/syslogng1911/include/eventlog -D_GNU_SOURCE -O2 -ma -qro -qroconst -qmaxmem=-1 -qarch=com -c afinet.c "/usr/include/alloca.h", line 34.1: 1506-224 (I) Incorrect pragma ignored. "afinet.c", line 183.13: 1506-021 (S) Expecting struct or union. gmake[2]: *** [afinet.o] Error 1 gmake[2]: Leaving directory `/opt/build/syslog-ng-1.9.11/src'
The following patch makes the build succeed. I haven't tested the binary yet though.
--- src/afinet.c.new 2006-05-31 13:28:11.817824000 -0500 +++ src/afinet.c 2006-05-31 13:27:50.281493000 -0500 @@ -178,7 +178,7 @@ { struct ipv6_mreq mreq6;
- if (IN6_IS_ADDR_MULTICAST(&g_sockaddr_inet6_get_sa(addr)->sin6_addr)) + if (IN6_IS_ADDR_MULTICAST(g_sockaddr_inet6_get_address(addr)->s6_addr)) { if (dir & AFSOCKET_DIR_RECV) {
Thanks for the fix, I've just committed it. -- Bazsi
participants (2)
-
Albert Chin
-
Balazs Scheidler