From patchwork Sun Aug 30 21:40:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1354037 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=R1gOn3Fo; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bfmwz0JtWz9sSP for ; Mon, 31 Aug 2020 07:41:06 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 95F3820494; Sun, 30 Aug 2020 21:41:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VotIxJFBnI95; Sun, 30 Aug 2020 21:41:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2DED2203D6; Sun, 30 Aug 2020 21:41:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 1AE751BF573 for ; Sun, 30 Aug 2020 21:40:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 11C338543B for ; Sun, 30 Aug 2020 21:40:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fvgCdnuFjkcn for ; Sun, 30 Aug 2020 21:40:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 07A4684D89 for ; Sun, 30 Aug 2020 21:40:58 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id c15so4028733wrs.11 for ; Sun, 30 Aug 2020 14:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SjvtNk1LUo85+Mbc/dqxLoQkW6b7HvqtD+3QCyiOohY=; b=R1gOn3Fo9nI1WHNMdFCOcTiRknYj5Dmodahr5H5SDuK8Jer+idvc68areTERSPH3Rn U+smDu5IsJZOQdncy126Upmk1MzZVTV5hgVqPeLTrt2ysGp4FsiAw0ls9lZ6jdl1HSmC 0giCi5nDPv0btDrMC6fgSkdlCtq/WbXgorh9irPj2nrCHWjUDKDcYH7rhdMb5MXCSPw5 fuRaMS6IfvPmRCuObbYEPIunAMnwJn/6/btO+sLwOucKjCJTX3px8nic+x9hVy/RyWmp 8YQl/IQKcTiD76nxdj4neiYJiykgPtOg/Uta0adXHq5zkQoIDBSVSrQHFNrbii2Eyadi xMJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SjvtNk1LUo85+Mbc/dqxLoQkW6b7HvqtD+3QCyiOohY=; b=uBwwEspZzsgVaU5F9S95Hb+dHnn52Tlub0S3QgCZDUVuZ/fsKTZqjPjdfJ9DBWLXwA tfigHYEh7pofsnQt8wKzsBkh8AeaDnWor7bMis0QRSWLhL/Cexrf8hwlOt7NqKr5RTOB +SYsJ788q1hcJbHA0QwulcZcXZeA0Fl1NEAjoC9SBnzHHSs8Kg8RcFGVuKphuAJ92mGk bRYbyDGeo/Y0v+oEfx/4UNxNPeMwyVXHmcOllvVgbOSiX3IRoZxW5ShgqT9qItjo8PIj umYLSXE5n6fIop+JdDPFtAGkQxJSWg4RkALmlDAGHSekCpJLeT7iW/gEC7Vg7IpK+N9E GTcg== X-Gm-Message-State: AOAM531JKRXGjsHLbuKDBVRjTHUXZFaDEW74yraFlWyrYaPDHPIOBv+Q G2zgmbPgy5QYohmcYut0j4MWK1kbLAM= X-Google-Smtp-Source: ABdhPJyoN9Z3FrrjhxC4VAjPd4CU9xg225O2aLr9sLfatpsiFGg/gg4/hO03cABPwQUWey1SeLutvA== X-Received: by 2002:adf:ef0a:: with SMTP id e10mr6720699wro.362.1598823656005; Sun, 30 Aug 2020 14:40:56 -0700 (PDT) Received: from kali.home (2a01cb0881b76d00c2afd0dfa851d2b9.ipv6.abo.wanadoo.fr. [2a01:cb08:81b7:6d00:c2af:d0df:a851:d2b9]) by smtp.gmail.com with ESMTPSA id k13sm8607388wmj.14.2020.08.30.14.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Aug 2020 14:40:55 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Sun, 30 Aug 2020 23:40:42 +0200 Message-Id: <20200830214042.1340329-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2, 1/1] package/rtty: fix build with mbedtls but without zlib X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jianhui Zhao , Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" zlib is not mandatory with mbedtls, only optional, however as mbedtls does not provide a pkg-config file, we assume that if zlib is available, we must link with it to avoid a build failure when linking statically with a zlib-enabled mbedtls. This change was pushed upstream with https://github.com/zhaojh329/rtty/commit/7b8efe11dbafce97971dc130bf6cc1756f34ce07 and is in buildroot since the bump to version 7.1.4 with commit 0c80245ddbe78c8e443f98b9bbccac56331cdb26. However, this change will raise a build failure if ZLIB_LIBRARIES is used when zlib is not found. This patch is fixing this build failure. However, it should be noted that the compression support in mbedtls is only enabled if BR2_PACKAGE_MBEDTLS_COMPRESSION=y. So we can have a situation where mbedtls is enabled, zlib is enabled, but mbedtls is not using zlib and as a result, since version 7.1.4, rttyt will needlessly link with zlib in such a situation. The only sane way to fix this is to use pkg-config, but as mbedtls apparently doesn't provide any .pc file, we leave it as it is. Fixes: - http://autobuild.buildroot.org/results/a0ebffe58bbf14cab74b7d2111d4d88a9c725273 Signed-off-by: Fabrice Fontaine --- Changes v1 -> v2 (after review of Thomas Petazzoni): - Extend commit message ...xt-fix-build-with-mbedtls-but-withou.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 package/rtty/0001-src-CMakeLists.txt-fix-build-with-mbedtls-but-withou.patch diff --git a/package/rtty/0001-src-CMakeLists.txt-fix-build-with-mbedtls-but-withou.patch b/package/rtty/0001-src-CMakeLists.txt-fix-build-with-mbedtls-but-withou.patch new file mode 100644 index 0000000000..b7275462af --- /dev/null +++ b/package/rtty/0001-src-CMakeLists.txt-fix-build-with-mbedtls-but-withou.patch @@ -0,0 +1,47 @@ +From 0982308255dd3fd70e7b93aa88a8f3c5b9c1b845 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 30 Aug 2020 21:15:06 +0200 +Subject: [PATCH] src/CMakeLists.txt: fix build with mbedtls but without zlib + +Building with mbedtls but without zlib will result in the following +build failure: + +-- Found MbedTLS: /home/peko/autobuild/instance-0/output-1/per-package/rtty/host/powerpc64-buildroot-linux-gnu/sysroot/usr/lib/libmbedtls.so (found version "2.16.7") +-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +-- Select MbedTLS(PolarSSL) as the SSL backend +CMake Error: The following variables are used in this project, but they are set to NOTFOUND. +Please set them or make sure they are set and tested correctly in the CMake files: +ZLIB_LIBRARY + linked by target "rtty" in directory /home/peko/autobuild/instance-0/output-1/build/rtty-7.1.4/src + +-- Configuring incomplete, errors occurred! + +Fixes: + - http://autobuild.buildroot.org/results/a0ebffe58bbf14cab74b7d2111d4d88a9c725273 + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/zhaojh329/rtty/pull/77] +--- + src/CMakeLists.txt | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 10f6626..d09e848 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -77,7 +77,11 @@ else() + elseif(RTTY_USE_MBEDTLS) + set(SSL_NAME "MbedTLS(PolarSSL)") + set(SSL_INC ${MBEDTLS_INCLUDE_DIR}) +- set(SSL_LIB ${MBEDTLS_LIBRARIES} ${ZLIB_LIBRARIES}) ++ if(ZLIB_FOUND) ++ set(SSL_LIB ${MBEDTLS_LIBRARIES} ${ZLIB_LIBRARIES}) ++ else() ++ set(SSL_LIB ${MBEDTLS_LIBRARIES}) ++ endif() + set(RTTY_HAVE_MBEDTLS_CONFIG 1) + endif() + +-- +2.28.0 +