Skip to content
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

libcurl built on iOS11 Xcode9, fails to build because connectx is unavailable on iOS8 #2

Closed
bitbytedog opened this issue Sep 27, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@bitbytedog
Copy link
Contributor

bitbytedog commented Sep 27, 2017

xcode 11 checks all supported versions of ios for presence of functions. connectx is unavailable in iOS8.

This is a known issue in curl curl/curl#1330.

@bitbytedog bitbytedog self-assigned this Sep 27, 2017
@bitbytedog bitbytedog added this to the 4.3.0 milestone Sep 27, 2017
@bitbytedog
Copy link
Contributor Author

This is not a simple fix because the static configuration system cannot cope with backward compatibility.

The probable correct solution is to provide a weakly linked version of connectx that calls connect in the case that connectx is not available in iOS.

The actual solution was just to suppress the warning so curl would compile. Most probably support for iOS8 devices will not be required, we are already at iOS11.

@bitbytedog
Copy link
Contributor Author

That didn't work, Jenkins build error:

[armv7] /Users/jenkins/PRD/workspace/nse_iOSCurlFramework_master-Z6HZRBAR2KYHC32ZNRGG6L6QPNMD3BUONQLYHSY3HVN2O6RBUYWQ@2/build/curl-7.55.1/lib/connect.c:1069:12: error: 'connectx' is only available on iOS 9.0 or newer [-Werror,-Wunguarded-availability]
[armv7]       rc = connectx(sockfd, &endpoints, SAE_ASSOCID_ANY,
[armv7]            ^~~~~~~~
[armv7] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/usr/include/sys/socket.h:713:5: note: 'connectx' has been explicitly marked partial here
[armv7] int connectx(int, const sa_endpoints_t *, sae_associd_t, unsigned int,
[armv7]     ^
[armv7] /Users/jenkins/PRD/workspace/nse_iOSCurlFramework_master-Z6HZRBAR2KYHC32ZNRGG6L6QPNMD3BUONQLYHSY3HVN2O6RBUYWQ@2/build/curl-7.55.1/lib/connect.c:1069:12: note: enclose 'connectx' in a __builtin_available check to silence this warning
[armv7]       rc = connectx(sockfd, &endpoints, SAE_ASSOCID_ANY,
[armv7]            ^~~~~~~~
[armv7] 1 error generated.

Followed suggestion in error message:

 #if __has_builtin(connectx)
       rc = connectx(sockfd, &endpoints, SAE_ASSOCID_ANY,
                     CONNECT_RESUME_ON_READ_WRITE | CONNECT_DATA_IDEMPOTENT,
                     NULL, 0, NULL, NULL);
 #else
       rc = connect(sockfd, &addr.sa_addr, addr.addrlen);
 #endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant