[zeromq-dev] building zeromq 4.2.0 on AIX 7.1 broken?

Mike Beddo Mike.Beddo at dataventures.com
Wed Nov 30 20:08:35 CET 2016


src/proxy.cpp (and a few other 0MQ codes) include poll.h (lines 36 - 43):

  //  On AIX platform, poll.h has to be included first to get consistent                                
  //  definition of pollfd structure (AIX uses 'reqevents' and 'retnevents'                             
  //  instead of 'events' and 'revents' and defines macros to map from POSIX-y                          
  //  names to AIX-specific names).                                                                     
  #if defined ZMQ_POLL_BASED_ON_POLL && !defined ZMQ_HAVE_WINDOWS
  #include <poll.h>
  #endif

Now, AIX's poll.h (the relevant part) looks like this:

  #ifdef  __64BIT__
  /* pollfd.fd is always a 32 bit entity (XOPEN) */
  struct  pollfd
  {
          int     fd;                     /* file descriptor or file ptr  */
          short   events;                 /* requested events             */
          short   revents;                /* returned events              */

  };
  #else /* __64BIT__ */
  struct  pollfd
  {
          long    fd;                     /* file descriptor or file ptr  */
          ushort  reqevents;              /* requested events             */
          ushort  rtnevents;              /* returned events              */
  };
  #ifndef __HIDE_SVR4_POLLFD_NAMES
  #define events  reqevents               /* SVR3,4 pollfd member name    */
  #define revents rtnevents               /* SVR3,4 pollfd member name    */
  #endif /* __HIDE_SVR4_POLLFD_NAMES */
  #endif /* __64BIT__ */

Note the two defines near the end. Here "revents" is being defined as "rtnevents".

If I undefined "events" and "revents" then other codes won't compile, so there's some confusion with defines I think.

ZeroMQ 4.1.6 builds fine on AIX 7.1, so something changed between 4.2.0 and 4.1.6 wrt building.

-----Original Message-----
From: zeromq-dev [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Luca Boccassi
Sent: Wednesday, November 30, 2016 4:21 AM
To: ZeroMQ development list
Subject: Re: [zeromq-dev] building zeromq 4.2.0 on AIX 7.1 broken?

On Tue, 2016-11-29 at 20:59 +0000, Mike Beddo wrote:
> I can successfully build zeromq 4.1.6 on AIX 7.1 using "configure CC=xlc CXX=xlC" followed by make and make check. All tests passed.
> 
> When I try to do the same with zeromq 4.2.0 on AIX 7.1 there are compilation errors:
> 
> $ make
> Making all in doc
> make[1]: Entering directory `/home/meb/zeromq-4.2.0/doc'
> make[1]: Nothing to be done for `all'.
> make[1]: Leaving directory `/home/meb/zeromq-4.2.0/doc'
> make[1]: Entering directory `/home/meb/zeromq-4.2.0'
>   CXX      src/src_libzmq_la-proxy.lo
> "src/proxy.cpp", line 157.34: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
> "src/proxy.cpp", line 188.22: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
> "src/proxy.cpp", line 189.51: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
> "src/proxy.cpp", line 197.22: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
> "src/proxy.cpp", line 198.25: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
> make[1]: *** [src/src_libzmq_la-proxy.lo] Error 1
> make[1]: Leaving directory `/home/meb/zeromq-4.2.0'
> make: *** [all-recursive] Error 1
> $

Uhm I'm a bit confused, this is the line at 157:

        if (control_ && items [2].revents & ZMQ_POLLIN) {

Maybe I'm missing something, but it's .revents not .rtnevents. This is the struct in include/zmq.h:

typedef struct zmq_pollitem_t
{
    void *socket;
#if defined _WIN32
    SOCKET fd;
#else
    int fd;
#endif
    short events;
    short revents;
} zmq_pollitem_t;

> Also, I had to remove "-Wno-long-long" from the CPPFLAGS in the configure script for both zeromq 4.1.6 and 4.2.0 to avoid the warning message "Option -Wno-long-long was incorrectly specified. The option will be ignored."

This should then be stripped from CPPFLAGS in the AIX section of the configure.ac script (line 247), or perhaps it's easier to add it for all OSes but AIX. Could you please send a PR to do it?

Thanks!

Kind regards,
Luca Boccassi


More information about the zeromq-dev mailing list