From patchwork Wed May 23 00:11:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reino Wijnsma X-Patchwork-Id: 9060 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp194052jad; Tue, 22 May 2018 17:11:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqu1R5SN/+HRNzWSKnWQYSPs0TpQ8CCy0obv1kODO5a3WKcAFKE3O50zr7PPZ9v2NyxU2g6 X-Received: by 2002:adf:a617:: with SMTP id k23-v6mr438237wrc.200.1527034302547; Tue, 22 May 2018 17:11:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527034302; cv=none; d=google.com; s=arc-20160816; b=NKu5DH7QpccwsaxLLln6whTpSK/GNlDFXsHwJJUVhaoaYF35W6swmEp79zlJipVr4C kLlNtbZxRP7Icg+Kt4TuQt7epTVIC+S+zQVN5Qq5Rql/AHSXorjyYWPLgHJXwK5AcIzE PUMqcMaHlANi73wiltxYb3AzKEwm34pR8KHS3xVQkDwussi0qpYdaHI1Am9vP1T1e7rs pNKcW4C+1aICfsfUlLIMDLKkMZxJE30iU0JtxsypF10cquBZRvN93l66J+6w89nBck2o NfLVZNr6Lqv5SGTluGexEeAsU2sw9deuNbyTPYxbEi7mZx7DrCCDwlorLp9aYRdrY+Sr +nYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:delivered-to :arc-authentication-results; bh=Q9aiyeI+W7HEYUhlo1sEFbXzcQ+DyyNxcdTdo3Ubpv0=; b=V0nA029qovi8dLArRSzB5hfdR+IYU0BXH5hAOAXkyxzraMD8QXweRkDiAfApQEqPeJ m3mYCR8+RZfOeJHFijtSTgOpYxVGQoKbCWmLFKfaYu0xPS7wx6qK1oEdzRhpWwvc6okI r8VfXMfkLntpruSV2NzZ3ZiBtWyy+gOZixQcKwmAUy2dejC5THr+HPn/+VFuR+0UPiG9 yKShUZ7IbUzAypANsYPKThvzv4IewgqcSH4Fe6iLNBl2UDA85Omjelb7GcIfI6GF5Jsn 6AN3UZSaB+u8wxRjtqONkhhdHickxb8tQW4g2vovN60gbsLC+Ss2bT03IMS64qV+Q+W6 iBVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 132-v6si791636wmk.110.2018.05.22.17.11.40; Tue, 22 May 2018 17:11:42 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B56FD68A095; Wed, 23 May 2018 03:10:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from lb3-smtp-cloud8.xs4all.net (lb3-smtp-cloud8.xs4all.net [194.109.24.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6C2A2689BD7 for ; Wed, 23 May 2018 03:10:51 +0300 (EEST) Received: from [IPv6:2001:980:2408:1:9571:6bc2:a028:8e4e] ([IPv6:2001:980:2408:1:9571:6bc2:a028:8e4e]) by smtp-cloud8.xs4all.net with ESMTPSA id LHNKf92M1TrQgLHNLffq0k; Wed, 23 May 2018 02:11:32 +0200 To: FFmpeg development discussions and patches References: <1524401273-15770-1-git-send-email-silvo@gmx.net> From: Reino Wijnsma Message-ID: <5B04B1B2.8050705@xs4all.nl> Date: Wed, 23 May 2018 02:11:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1524401273-15770-1-git-send-email-silvo@gmx.net> X-CMAE-Envelope: MS4wfNuJiI/qgBb4J5vIkoGh2HVKMxHLaLQaiH09lZ6xmYByb9ZeGyTDs19ambWfpXzwApS5g8dPdcM1Ti8LH3c3fhYJZSwshHG7QBzsulfiaxWa/SivowUX Ia6fJkyGGE8BShkXk60we/S0zrdIgaW4AlqGTVP1TjawRYaNGtA5fQfhVUtCZOi/tG2IYvQq8KpPMUSZ3cpIZl2o59hPxNqLnzui5oRgdnnorbKmaPSRtnAU 1+/9LwFBpx4RM6kVpYmsKS3o1KPO72YJGxQz1qOpnps= Subject: Re: [FFmpeg-devel] [PATCH] libavformat: add mbedTLS based TLS X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 22-4-2018 14:47, Thomas Volkert wrote: > +enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init || > + check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init || > + check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls || > + die "ERROR: mbedTLS not found"; } Now that James Almer has pushed this patch I decided to have a look as well. I wanted to see if mbedtls would work for me too. I haven't made a FFmpeg build yet to test, because the excerpt above (in 'configure') doesn't look right and configuring FFmpeg returns lots of undefined references. First of all, there's no pkg-config file at all. Almost 3 years ago someone requested it (https://github.com/ARMmbed/mbedtls/issues/228), but as far as I can see it hasn't been implemented yet. So, I really don't understand why you added the 2 check_pkg_config lines. Secondly, the check_lib line also needs -lmbedx509 and -lmbedcrypto! -lmbedtls, the most important one obviously, prevents a "undefined reference to `mbedtls_ssl_init'", but... -lmbedx509 is also needed, because otherwise you'd get "undefined reference to `mbedtls_x509_crt_init'" and several "undefined reference to `mbedtls_x509_crt_[...]'". -lmbedcrypto is also needed, because otherwise you'd get LOTS of "undefined reference to `mbedtls_[...]'"; from "undefined reference to `mbedtls_sha256_init'" to "undefined reference to `mbedtls_pem_init'"! The following patch works for me: Also note that the order is important, because with -lmbedtls -lmbedcrypto -lmbedx509 you'd get: "undefined reference to `mbedtls_pk_parse_subpubkey'" and "undefined reference to `mbedtls_pk_load_file'". (If it matters, I'm cross-compiling on Windows using Cygwin, MinGW and GCC). -- Reino diff --git a/configure b/configure index 09ff0c5..6014e03 100755 --- a/configure +++ b/configure @@ -6111,9 +6111,7 @@ enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_d { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" || enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; } enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion -enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init || - check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init || - check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls || +enabled mbedtls && { check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto || die "ERROR: mbedTLS not found"; } enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; } enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||