-
Notifications
You must be signed in to change notification settings - Fork 427
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
Rename poll.h into vm_poll.h to fix build failure on musl #383
base: master
Are you sure you want to change the base?
Conversation
musl libc redirects include of sys/poll.h to poll.h. But since poll.h is also a local header file, the musl libc header is never included. This leads to the following build failure: In file included from asyncsocket.c:73:0: .../host/i586-buildroot-linux-musl/sysroot/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp] #warning redirecting incorrect #include <sys/poll.h> to <poll.h> asyncsocket.c: In function ‘AsyncTCPSocketPollWork’: asyncsocket.c:2537:13: error: invalid use of undefined type ‘struct pollfd’ pfd[i].fd = asock[i]->fd; ^ asyncsocket.c:2537:13: error: dereferencing pointer to incomplete type ‘struct pollfd’ asyncsocket.c:2538:13: error: invalid use of undefined type ‘struct pollfd’ pfd[i].events = read ? POLLIN : POLLOUT; ^ asyncsocket.c:2538:33: error: ‘POLLIN’ undeclared (first use in this function); did you mean ‘POLL_IN’? pfd[i].events = read ? POLLIN : POLLOUT; So rename poll.h into vm_poll.h as suggested by srowe in vmware#359 (comment) Fixes: - http://autobuild.buildroot.org/results/4f575ef42bbc4387a07e396205052b2da081c64d Fix vmware#359 Signed-off-by: Fabrice Fontaine <[email protected]>
@ffontaine, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction. |
@ffontaine, VMware has approved your signed contributor license agreement. |
Thanks for the patch. I filed an internal bug to discuss this issue. At this point, I am not able to tell if we are going to accept it. |
@ffontaine , what is the reason that "sys/poll.h" redirects to "poll.h"? Looks like that is the underlying issue, but there may be a good reason to it. |
Yes, indeed, the redirection is the root of the issue but this redirection has been made by design on musl: https://git.musl-libc.org/cgit/musl/commit/include/sys/poll.h?id=54446d730cfb17c5f7bcf57f139458678f5066cc. |
What is the status of your internal bug? Do you think that this PR could be merged? I have other fixes for musl but I'll send them only if you're interested in allowing open-vm-tools to build on this target. |
musl libc redirects include of sys/poll.h to poll.h. But since poll.h is also a local header file, the musl libc header is never included. This leads to the following build failure:
So rename poll.h into vm_poll.h as suggested by srowe in #359 (comment)
Fixes:
Fix #359
Signed-off-by: Fabrice Fontaine [email protected]