Text of github.com › curl › curl › issues › 3689 as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

curl 7.64.0 compile error on tvos · Issue #3689 · curl/curl · GitHub

Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert curl 7.64.0 compile error on tvos #3689 New issue Copy link New issue Copy link Closed Closed curl 7.64.0 compile error on tvos #3689 Copy link Labels TLS build Description nianxuejie opened on Mar 19, 2019 Issue body actions I try to cross-compile curl(7.64.0) for tvos on mac, but it is failed!

This is my script: `export DEVROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain DFT_DIST_DIR=${HOME}/Desktop/libcurl-appleTV-dist DIST_DIR=${DIST_DIR:-$DFT_DIST_DIR} function check_curl_ver() { echo "#include "include/curl/curlver.h" #if LIBCURL_VERSION_MAJOR < 7 || LIBCURL_VERSION_MINOR < 40 #error Required curl 7.40.0+; See http://curl.haxx.se/docs/adv_20150108A.html #endif"|gcc -c -o /dev/null -xc -||exit 9 } function build_for_arch() { ARCH=$1 HOST=$2 SYSROOT=$3 PREFIX=$4 TVOS_MIN_SDK_VERSION="9.0" export PATH="${DEVROOT}/usr/bin/:${PATH}" export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${SYSROOT} -mtvos-version-min=${TVOS_MIN_SDK_VERSION} -fembed-bitcode" export LDFLAGS="-arch ${ARCH} -isysroot ${SYSROOT}" ./configure --disable-shared --enable-ipv6 --enable-static --disable-ntlm-wb ${SSL_FLAG} --enable-threaded-resolver --host="${HOST}" --prefix=${PREFIX} LANG=C sed -i -- 's/define HAVE_FORK 1/define HAVE_FORK 0/' "./lib/curl_config.h" LANG=C sed -i -- 's/HAVE_FORK"]=" 1"/HAVE_FORK"]=" 0"/' "config.status" make -j8 && make install } if [ "$1" == "openssl" ] then if [ ! -d ${HOME}/Desktop/openssl-ios-dist ] then echo "Please use https://github.com/sinofool/build-openssl-ios/ to build OpenSSL for iOS first" exit 8 fi export SSL_FLAG=--with-ssl=${HOME}/Desktop/openssl-ios-dist else check_curl_ver export SSL_FLAG=--with-darwinssl fi TMP_DIR=/Users/iqiyi/Desktop/code/curl/build build_for_arch arm64 arm-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk ${TMP_DIR}/appletv_arm64 || exit 1 build_for_arch x86_64 arm-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk ${TMP_DIR}/appletv_x86 || exit 2 mkdir -p ${TMP_DIR}/lib/ ${DEVROOT}/usr/bin/lipo -arch arm64 ${TMP_DIR}/appletv_arm64/lib/libcurl.a -arch x86_64 ${TMP_DIR}/appletv_x86/lib/libcurl.a -output ${TMP_DIR}/lib/libcurl.a -create cp -r ${TMP_DIR}/appletv_arm64/include ${TMP_DIR}/ curl -O https://raw.githubusercontent.com/sinofool/build-libcurl-ios/for-7.54/patch-include.patch patch ${TMP_DIR}/include/curl/curlbuild.h < patch-include.patch mkdir -p ${DIST_DIR} cp -r ${TMP_DIR}/include ${TMP_DIR}/lib ${DIST_DIR} ` Error info: vtls/darwinssl.c:1598:13: error: 'SSLSetALPNProtocols' is only available on tvOS 11.0 or newer [-Werror,-Wunguarded-availability-new] err = SSLSetALPNProtocols(BACKEND->ssl_ctx, alpnArr); vtls/darwinssl.c:2652:15: error: 'SSLCopyALPNProtocols' is only available on tvOS 11.0 or newer [-Werror,-Wunguarded-availability-new] err = SSLCopyALPNProtocols(BACKEND->ssl_ctx, &alpnArr); curl/libcurl version 7.64.0 source code [curl -V output] MacOS Mojave 10.14.1 I don't know if this script needs some special configuration, but it is workable for ios.

Activity bagder added build on Mar 19, 2019 bagder commented on Mar 19, 2019 bagder on Mar 19, 2019 Member More actions I presume this means we need this source line to be adjusted for tvOS somehow: curl/lib/vtls/sectransp.c Line 1578 in dc5edf9 #if ( CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 ) && HAVE_BUILTIN_AVAILABLE == 1 nianxuejie commented on Mar 19, 2019 nianxuejie on Mar 19, 2019 Author More actions I presume this means we need this source line to be adjusted for tvOS somehow: curl/lib/vtls/sectransp.c Line 1578 in dc5edf9 #if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1 Thank you for your reply.

Do you mean vtls/darwinssl.c?Will you adjust later? bagder commented on Mar 19, 2019 bagder on Mar 19, 2019 Member More actions The file once called darwinssl.c doesn't exist anymore. It is now called sectransp.c in git as we've switched to always refer to the apple native TLS as Secure Transport and not Darwinssl. nianxuejie commented on Mar 19, 2019 nianxuejie on Mar 19, 2019 Author More actions The file once called darwinssl.c doesn't exist anymore.

It is now called sectransp.c in git as we've switched to always refer to the apple native TLS as Secure Transport and not Darwinssl. If so, does the configuration option "--with-darwinssl" still work? I am not sure what is the difference between the apple native TLS as Secure Transport and darwinssl. When can we use your latest code? bagder commented on Mar 19, 2019 bagder on Mar 19, 2019 Member More actions does the configuration option "--with-darwinssl" still work?

Yes I am not sure what is the difference between the apple native TLS as Secure Transport and darwinssl. There's no difference other than the name. And the official public name was always Secure Transport. We've just adjusted curl to use the "standard" name. When can we use your latest code? Our code is always in git and available, you can use it any time you wish. But we have not fixed this issue you're talking about... bagder commented on Mar 19, 2019 bagder on Mar 19, 2019 Member More actions What if we disable ALPN for all versions of tvOS?

Can you see if a patch like this works for you? diff --git a/lib/vtls/sectransp.c b/lib/vtls/sectransp.c index 949bd236b..f477a51fc 100644 --- a/lib/vtls/sectransp.c +++ b/lib/vtls/sectransp.c @@ -106,10 +106,15 @@ #else #error "The Secure Transport back-end requires iOS or macOS." #endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */ + #if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && \ + (HAVE_BUILTIN_AVAILABLE == 1) && !defined(TARGET_OS_TV) + #define SECTRANSP_HAS_ALPN + #endif + #if CURL_BUILD_MAC #include <sys/sysctl.h> #endif /* CURL_BUILD_MAC */ #include "urldata.h" @@ -1573,11 +1578,11 @@ static CURLcode sectransp_connect_step1(struct connectdata *conn, failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); return CURLE_SSL_CONNECT_ERROR; } #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ - #if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1 + #ifdef SECTRANSP_HAS_ALPN if(conn->bits.tls_enable_alpn) { if(__builtin_available(macOS 10.13.4, iOS 11, *)) { CFMutableArrayRef alpnArr = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks); @@ -2624,11 +2629,11 @@ sectransp_connect_step2(struct connectdata *conn, int sockindex) default: infof(data, "Unknown protocol connection\n"); break; } - #if(CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1 + #ifdef SECTRANSP_HAS_ALPN if(conn->bits.tls_enable_alpn) { if(__builtin_available(macOS 10.13.4, iOS 11, *)) { CFArrayRef alpnArr = NULL; CFStringRef chosenProtocol = NULL; err = SSLCopyALPNProtocols(BACKEND->ssl_ctx, &alpnArr); nianxuejie commented on Mar 19, 2019 nianxuejie on Mar 19, 2019 Author More actions What if we disable ALPN for all versions of tvOS?

Can you see if a patch like this works for you? diff --git a/lib/vtls/sectransp.c b/lib/vtls/sectransp.c index 949bd236b..f477a51fc 100644 --- a/lib/vtls/sectransp.c +++ b/lib/vtls/sectransp.c @@ -106,10 +106,15 @@ #else #error "The Secure Transport back-end requires iOS or macOS." #endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */ + #if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && \ + (HAVE_BUILTIN_AVAILABLE == 1) && !defined(TARGET_OS_TV) + #define SECTRANSP_HAS_ALPN + #endif + #if CURL_BUILD_MAC #include <sys/sysctl.h> #endif /* CURL_BUILD_MAC */ #include "urldata.h" @@ -1573,11 +1578,11 @@ static CURLcode sectransp_connect_step1(struct connectdata *conn, failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION

The rest of this page is on the live site.