can't compile libcurl macOs High Sierra 10.13.1 (17B48) #2080

Closed
koshak01 opened this Issue Nov 14, 2017 · 8 comments

Comments

Projects
None yet
4 participants

/configure --prefix=/usr/local/curl --with-darwinssl --with-ssl=/usr/local/opt/openssl --disable-werror --disable-warnings

after configure:

curl version:     7.57.0-DEV
  Host setup:       x86_64-apple-darwin17.2.0
  Install prefix:   /usr/local/curl
  Compiler:         gcc
  SSL support:      enabled (Apple OS-native, OpenSSL)
  SSH support:      no      (--with-libssh2)
  zlib support:     enabled
  brotli support:   no      (--with-brotli)
  GSS-API support:  no      (--with-gssapi)
  TLS-SRP support:  enabled
  resolver:         POSIX threaded
  IPv6 support:     enabled
  Unix sockets support: enabled
  IDN support:      no      (--with-{libidn2,winidn})
  Build libcurl:    Shared=yes, Static=yes
  Built-in manual:  enabled
  --libcurl option: enabled (--disable-libcurl-option)
  Verbose errors:   enabled (--disable-verbose)
  SSPI support:     no      (--enable-sspi)
  ca cert bundle:   /etc/ssl/cert.pem
  ca cert path:     no
  ca fallback:      no
  LDAP support:     enabled (OpenLDAP)
  LDAPS support:    enabled
  RTSP support:     enabled
  RTMP support:     no      (--with-librtmp)
  metalink support: no      (--with-libmetalink)
  PSL support:      no      (libpsl not found)
  HTTP2 support:    disabled (--with-nghttp2)
  Protocols:        DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP

➜ curl git:(master) make

Making all in lib
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
  CC       libcurl_la-connect.lo
connect.c:1079:14: error: 'connectx' is only available on macOS 10.11 or newer [-Werror,-Wunguarded-availability]
        rc = connectx(sockfd, &endpoints, SAE_ASSOCID_ANY,
             ^~~~~~~~
/usr/include/sys/socket.h:713:5: note: 'connectx' has been explicitly marked partial here
int connectx(int, const sa_endpoints_t *, sae_associd_t, unsigned int,
    ^
connect.c:1079:14: note: enclose 'connectx' in an @available check to silence this warning
        rc = connectx(sockfd, &endpoints, SAE_ASSOCID_ANY,
             ^~~~~~~~
1 error generated.
make[2]: *** [libcurl_la-connect.lo] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

env:

CFLAGS=-I/usr/local/opt/openssl/include
LDFLAGS=-L/usr/local/opt/openssl/lib
PYCURL_SSL_LIBRARY=openssl
CXXFLAGS=-Wno-error

i set flag -Wno-error in env - not work =((((

/usr/include/sys/socket.h:713

__API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0))
int connectx(int, const sa_endpoints_t *, sae_associd_t, unsigned int,
    const struct iovec *, unsigned int, size_t *, sae_connid_t *);

__API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0))
int disconnectx(int, sae_associd_t, sae_connid_t);
#endif  /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
__END_DECLS


macOS:

macOS High Sierra version 10.13.1

@bagder bagder added the build label Nov 14, 2017

Owner

bagder commented Nov 14, 2017

I made sure my mac is updated and I can build current git master just fine!

$ sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.13.1
BuildVersion:   17B48

I think I might have xcode 9.1:

$ pkgutil --pkg-info=com.apple.pkg.Xcode
package-id: com.apple.pkg.Xcode
version: 9.1.0.0.1.1508540944
volume: /
location: /
install-time: 1509891344

Owner

jay commented Nov 14, 2017

@koshak01 what version of xcode

➜ ~ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -version
Xcode 9.1
Build version 9B55

Owner

jay commented Nov 14, 2017

There is a fix in 870d849 that was added for xcode 9 so I'm stumped as to why you're seeing that. Did you forget to run buildconf after you checked out the latest release by chance?

/cc @nickzman

Owner

bagder commented Nov 14, 2017

FYI: That's the exact same version of xcode that I have installed.

I run buildconf after - but this not help ;(

Before i have xcode version 8.3.3 - and i see same problem.
upgrade xcode not solve problem.

Owner

bagder commented Nov 14, 2017

/usr/include/sys/socket.h:713:5: note: 'connectx' has been explicitly marked partial here
int connectx(int, const sa_endpoints_t *, sae_associd_t, unsigned

Now this struck me. I don't have any /usr/include directory at all so clearly something is different between our installations! Well, except that you also seem to genuinely use gcc which also doesn't seem very xcode.

I believe the socket.h header my compiler uses is either /Applications/Xcode.app/Contents//Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/socket.h or /Applications/Xcode.app/Contents//Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/socket.h

Collaborator

nickzman commented Nov 15, 2017

I wonder if you have some old command line tools or headers installed that are getting in the way. You can force Xcode to install the appropriate tools & headers for your macOS release by running "xcodeselect --install" in Terminal.

Also, if you're using macOS 10.13.x, you should uninstall Xcode 8. Old versions of Xcode generally don't work in newer macOS releases, and I can't think of any reason to keep Xcode 8 around in 10.13 anyway.

markovicpp pushed a commit to markovicpp/curl that referenced this issue Nov 15, 2017

macOS: Fix missing connectx function with Xcode version older than 9.0
The previous fix curl#1788 worked just for Xcode 9. This commit extends the fix to older Xcode versions effectively by not using connectx function.

Fixes curl#1330
Fixes curl#2080
Closes curl#1336

@bagder bagder closed this in 6ce9845 Nov 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment