Skip to content

Compilation fails on AIX with 7.55.1 #1828

@MikaelSmith

Description

@MikaelSmith

I did this

I attempted to build curl 7.55.1 on AIX 7.1 using GCC 5.2.0.

I expected the following

I expected it to succeed, as we had previously built 7.51.0 successfully.

curl/libcurl version

7.55.1 (doesn't build, so no curl -V output)

operating system

AIX 7.1

Details

Compilation fails on multi.c. The root of it is that on AIX, when _ALL_SOURCE is set to 1 (as CURL does), sys/poll.h uses #define for event and revent. Because multi.c includes sys/poll.h but multi.h doesn't, we end up with a mismatch between names for the curl_waitfd struct.

libtool: compile:  gcc -DHAVE_CONFIG_H -I../include -I../lib -I../lib -DBUILDING_LIBCURL -isystem /opt/puppetlabs/puppet/include -isystem /opt/pl-build-tools/include -I/opt/puppetlabs/puppet/include -I/opt/puppetlabs/puppet/include/openssl -Werror-implicit-function-declaration -O2 -Wno-system-headers -pthread -MT libcurl_la-multi.lo -MD -MP -MF .deps/libcurl_la-multi.Tpo -c multi.c  -fPIC -DPIC -o .libs/libcurl_la-multi.o
multi.c: In function 'curl_multi_wait':
multi.c:1076:20: error: 'struct curl_waitfd' has no member named 'reqevents'
     if(extra_fds[i].events & CURL_WAIT_POLLIN)
                    ^
multi.c:1078:20: error: 'struct curl_waitfd' has no member named 'reqevents'
     if(extra_fds[i].events & CURL_WAIT_POLLPRI)
                    ^
multi.c:1080:20: error: 'struct curl_waitfd' has no member named 'reqevents'
     if(extra_fds[i].events & CURL_WAIT_POLLOUT)
                    ^
multi.c:1108:21: error: 'struct curl_waitfd' has no member named 'rtnevents'
         extra_fds[i].revents = mask;
                     ^
gmake: *** [libcurl_la-multi.lo] Error 1

Previously this appears to have built with curl 7.51.0 because multi.h also included sys/poll.h, so they were equally wrong. Based on https://curl.haxx.se/mail/lib-2013-02/0330.html, this appears to have been an issue off-and-on for years.

My workaround has been to undef _ALL_SOURCE before including select.h in multi.c, and redefine it after. This probably isn't a good general solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions