[vlc-commits] tools: patch cmake 3.17 so it builds with a macOS 10.13 SDK

Steve Lhomme git at videolan.org
Thu Jun 18 13:10:27 CEST 2020


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jun 11 15:00:49 2020 +0200| [3572bd987774f6d07476b73b845c8fd7a4fa7fed] | committer: Steve Lhomme

tools: patch cmake 3.17 so it builds with a macOS 10.13 SDK

Avoid this link error:
[ 44%] Linking C executable curltest
Undefined symbols for architecture x86_64:
  "_SSLCopyALPNProtocols", referenced from:
      _sectransp_connect_step2 in libcmcurl.a(sectransp.c.o)
  "_SSLSetALPNProtocols", referenced from:
      _sectransp_connect_common in libcmcurl.a(sectransp.c.o)
ld: symbol(s) not found for architecture x86_64

This only happens in the 3.0 macOS CI.

(cherry picked from commit ab126f80d3aea19d85c8b91f361d646fab6f4560)

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=3572bd987774f6d07476b73b845c8fd7a4fa7fed
---

 Makefile.am                                        |  1 +
 .../cmake-enable-ALPN-support-on-macOS-10.14.patch | 51 ++++++++++++++++++++++
 extras/tools/tools.mak                             |  1 +
 3 files changed, 53 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 8e4e0d92be..35ee1e85d8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,6 +64,7 @@ EXTRA_DIST += \
 	extras/tools/automake-clang.patch \
 	extras/tools/bison-macOS-7df04f9.patch \
 	extras/tools/bison-macOS-c41f233c.patch \
+	extras/tools/cmake-enable-ALPN-support-on-macOS-10.14.patch \
 	extras/tools/libtool-2.4.6-bitcode.patch \
 	extras/tools/libtool-2.4.6-clang-libs.patch \
 	extras/tools/libtool-2.4.6-response-files.patch \
diff --git a/extras/tools/cmake-enable-ALPN-support-on-macOS-10.14.patch b/extras/tools/cmake-enable-ALPN-support-on-macOS-10.14.patch
new file mode 100644
index 0000000000..7d9ef890ec
--- /dev/null
+++ b/extras/tools/cmake-enable-ALPN-support-on-macOS-10.14.patch
@@ -0,0 +1,51 @@
+From ca650572a6d9198563c91c4c8f418a3e9f7eebe2 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 11 Jun 2020 15:09:53 +0200
+Subject: [PATCH] enable ALPN support on macOS 10.14
+
+It fails to link properly with a macOS 10.13 SDK:
+
+[ 44%] Linking C executable curltest
+Undefined symbols for architecture x86_64:
+  "_SSLCopyALPNProtocols", referenced from:
+      _sectransp_connect_step2 in libcmcurl.a(sectransp.c.o)
+  "_SSLSetALPNProtocols", referenced from:
+      _sectransp_connect_common in libcmcurl.a(sectransp.c.o)
+ld: symbol(s) not found for architecture x86_64
+---
+ Utilities/cmcurl/lib/vtls/sectransp.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Utilities/cmcurl/lib/vtls/sectransp.c b/Utilities/cmcurl/lib/vtls/sectransp.c
+index 2fdf662a1d..22aebf3c5b 100644
+--- a/Utilities/cmcurl/lib/vtls/sectransp.c
++++ b/Utilities/cmcurl/lib/vtls/sectransp.c
+@@ -76,6 +76,7 @@
+ #define CURL_BUILD_MAC_10_9 MAC_OS_X_VERSION_MAX_ALLOWED >= 1090
+ #define CURL_BUILD_MAC_10_11 MAC_OS_X_VERSION_MAX_ALLOWED >= 101100
+ #define CURL_BUILD_MAC_10_13 MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
++#define CURL_BUILD_MAC_10_14 MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
+ /* These macros mean "the following code is present to allow runtime backward
+    compatibility with at least this cat or earlier":
+    (You set this at build-time using the compiler command line option
+@@ -1576,7 +1577,7 @@ static CURLcode sectransp_connect_step1(struct connectdata *conn,
+   }
+ #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */
+ 
+-#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1
++#if (CURL_BUILD_MAC_10_14 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1
+   if(conn->bits.tls_enable_alpn) {
+     if(__builtin_available(macOS 10.13.4, iOS 11, tvOS 11, *)) {
+       CFMutableArrayRef alpnArr = CFArrayCreateMutable(NULL, 0,
+@@ -2626,7 +2627,7 @@ sectransp_connect_step2(struct connectdata *conn, int sockindex)
+         break;
+     }
+ 
+-#if(CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1
++#if(CURL_BUILD_MAC_10_14 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1
+     if(conn->bits.tls_enable_alpn) {
+       if(__builtin_available(macOS 10.13.4, iOS 11, tvOS 11, *)) {
+         CFArrayRef alpnArr = NULL;
+-- 
+2.26.0.windows.1
+
diff --git a/extras/tools/tools.mak b/extras/tools/tools.mak
index 2e57ab0d96..d1bbcc0956 100644
--- a/extras/tools/tools.mak
+++ b/extras/tools/tools.mak
@@ -92,6 +92,7 @@ cmake-$(CMAKE_VERSION).tar.gz:
 
 cmake: cmake-$(CMAKE_VERSION).tar.gz
 	$(UNPACK)
+	$(APPLY) $(TOOLS)/cmake-enable-ALPN-support-on-macOS-10.14.patch
 	$(MOVE)
 
 .buildcmake: cmake



More information about the vlc-commits mailing list