Skip to contentSkip to conversation

curl: fix mbedtls detection

PATCH Superseded Ross Burton 2 participants 2 messages May 22

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 curl: fix mbedtls detection

The mbedtls detection logic in curl is broken and resulted in build paths leaking into curl-config and libcurl.pc. Fix the detection by looking for a symbol that wasn't removed in mbedtls 3.0 five years ago, and remove the explicit sysroot reference as it is no longer needed.

---
 meta/recipes-support/curl/curl/mbedtls.patch | 11 +++++++++++
 meta/recipes-support/curl/curl_8.19.0.bb     |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/curl/curl/mbedtls.patch
meta/recipes-support/curl/curl/mbedtls.patch new file +11 -0
new file mode 100644
index 0000000000..fb69d304d0
@@ -0,0 +1,11 @@
+Fix the mbedtls detection, mbedtls_havege_init was removed
+from mbedtls in the 3.0.0 release.
+
+Upstream-Status: Submitted [https://github.com/curl/curl/issues/21727]
+Signed-off-by: Ross Burton <[email protected]>
+
+--- a/m4/curl-mbedtls.m4	2026-05-22 13:09:00.344591549 +0100
++++ b/m4/curl-mbedtls.m4	2026-05-22 13:40:17.869454414 +0100
+@@ -45 +45 @@
+-      AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
++      AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
meta/recipes-support/curl/curl_8.19.0.bb +2 -1
index b9251336b8..4287b7b7da 100644
@@ -14,6 +14,7 @@ SRC_URI = " \
     file://run-ptest \
     file://disable-tests \
     file://no-test-timeout.patch \
+    file://mbedtls.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \
@@ -56,7 +57,7 @@ PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,openldap"
 PACKAGECONFIG[libgsasl] = "--with-libgsasl,--without-libgsasl,libgsasl"
 PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2"
 PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
-PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls"
+PACKAGECONFIG[mbedtls] = "--with-mbedtls,--without-mbedtls,mbedtls"
 PACKAGECONFIG[mqtt] = "--enable-mqtt,--disable-mqtt,"
 PACKAGECONFIG[negotiate-auth] = "--enable-negotiate-auth,--disable-negotiate-auth"
 PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2"
Signature · 1 line
2.43.0
#1 lore raw

Hi Ross,

Quoted 18 lines · Ross Burton via lists.openembedded.org

The mbedtls detection logic in curl is broken and resulted in build paths leaking into curl-config and libcurl.pc. Fix the detection by looking for a symbol that wasn't removed in mbedtls 3.0 five years ago, and remove the explicit sysroot reference as it is no longer needed.

---
  meta/recipes-support/curl/curl/mbedtls.patch | 11 +++++++++++
  meta/recipes-support/curl/curl_8.19.0.bb     |  3 ++-
  2 files changed, 13 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-support/curl/curl/mbedtls.patch

meta/recipes-support/curl/curl/mbedtls.patch new file +0 -0
new file mode 100644
index 0000000000..fb69d304d0

meta/recipes-support/curl/curl/mbedtls.patch line 4

Quoted 4 lines
meta/recipes-support/curl/curl/mbedtls.patch new file +4 -0
@@ -0,0 +1,11 @@
+Fix the mbedtls detection, mbedtls_havege_init was removed
+from mbedtls in the 3.0.0 release.
+
+Upstream-Status: Submitted [https://github.com/curl/curl/issues/21727]

This is an "issue", not a PR, so it may be misleading to say the patch was submitted? Maybe Pending (still with the link)?

Cheers,
Quentin