-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation fails on AIX with 7.55.1 #1828
Comments
An issue with building curl on AIX - that appears to have been a long-standing latent bug - surfaced in curl 7.55.1. Add a patch to work-around the issue. Issue has been filed at curl/curl#1828.
An issue with building curl on AIX - that appears to have been a long-standing latent bug - surfaced in curl 7.55.1. Add a patch to work-around the issue. Issue has been filed at curl/curl#1828.
Undefining How about making sure sys/poll.h is included before multi.h is included like this patch? ( diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index 36d1e42bc..6ed230ac2 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -326,10 +326,14 @@
#ifndef STDC_HEADERS /* no standard C headers! */
#include <curl/stdcheaders.h>
#endif
+#ifdef _AIX
+#include <sys/poll.h>
+#endif
+
#ifdef __POCC__
# include <sys/types.h>
# include <unistd.h>
# define sys_nerr EILSEQ
#endif |
That would mess up anyone trying to use curl_waitfd outside multi.h. Probably not a problem in my code, but didn't seem like a great solution. |
An issue with building curl on AIX - that appears to have been a long-standing latent bug - surfaced in curl 7.55.1. Add a patch to work-around the issue. Issue has been filed at curl/curl#1828.
Exactly how would that mess anything up for anyone? I would agree that it doesn't really help applications that want to use A better fix that also works for other applications could be to make sure diff --git a/include/curl/system.h b/include/curl/system.h
index a6640ba52..39dae754c 100644
--- a/include/curl/system.h
+++ b/include/curl/system.h
@@ -375,10 +375,16 @@
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#endif
+#ifdef _AIX
+/* AIX needs <sys/poll.h> */
+#define CURL_PULL_SYS_POLL_H
+#endif
+
+
/* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */
/* ws2tcpip.h is required here to properly make type definitions below. */
#ifdef CURL_PULL_WS2TCPIP_H
# include <winsock2.h>
# include <windows.h>
@@ -395,10 +401,16 @@
/* sys/socket.h is required here to properly make type definitions below. */
#ifdef CURL_PULL_SYS_SOCKET_H
# include <sys/socket.h>
#endif
+/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */
+/* sys/poll.h is required here to properly make type definitions below. */
+#ifdef CURL_PULL_SYS_POLL_H
+# include <sys/poll.h>
+#endif
+
/* Data type definition of curl_socklen_t. */
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
#endif
|
Yes, having to include I guess including it for anyone using curl is the a reasonable solution. |
... to get the event/revent defines that might be used for the poll struct. Reported-by: Michael Smith Fixes #1828
Thanks! |
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.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.
The text was updated successfully, but these errors were encountered: