From nobody Mon Feb 9 08:56:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598621369; cv=none; d=zohomail.com; s=zohoarc; b=GiL/oU27RCesH2NH0wxAkhZeOj+rpfTLKasuYkpclsG+62D69ANz15jhak539TASl7ajhTSjZ+ta8ui0tIAyoMDdYek5JLZ2KeOmujtbdgo+jFJ5TlER6NDa49R2KDRZ/6kymxFjBw9BAxsx+KAjxE3Zsr+RaE0j9uT3Ca04+IA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598621369; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OHhkmQT738b36n/I9miam6iem1Ql8/lR5LsmxD0SNAQ=; b=l9CCojUTgXBWSDaQRBdh/6rUfvQlAMdcVfJZq7q4zzA/nOiMiZDipbvQWs/ngdiX9OWDbdzP5amuGvtAFgxLpXSrDxoR3f16p1zmCQSkCaY57G6LYHtWgUS4QdsLHOShzw9fjk5w9ACrMiNrG7gz1Ov6xgDWFInkRCfraedyDvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598621369535473.9143976976957; Fri, 28 Aug 2020 06:29:29 -0700 (PDT) Received: from localhost ([::1]:60072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBeRc-0006li-DF for importer@patchew.org; Fri, 28 Aug 2020 09:29:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBePo-0004b6-I8 for qemu-devel@nongnu.org; Fri, 28 Aug 2020 09:27:36 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:43210 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBePl-0005mX-Fl for qemu-devel@nongnu.org; Fri, 28 Aug 2020 09:27:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-316--9dWk6gANCytwfHMTL8FDQ-1; Fri, 28 Aug 2020 09:27:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1812B18B633B; Fri, 28 Aug 2020 13:27:27 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 023D57A1C1; Fri, 28 Aug 2020 13:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598621252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHhkmQT738b36n/I9miam6iem1Ql8/lR5LsmxD0SNAQ=; b=BdRaDjMmLQsVr88ie8E8xvm6mkeQzUJJTtJcVkTB6+Yhzx1TixzGy0b7NTEdWG/QVDv3oW MQr3VbBpUkSpFfPjC5ApRQ7Jh2IZ5HSQqgffvKpeBVQ8zCRgPQLGZ+q59QaYR1Mofo04KS 6xNqNFmQX5Mr8tLS7QOjhLuvC5Skl1o= X-MC-Unique: -9dWk6gANCytwfHMTL8FDQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/2] crypto: fix build without gcrypt and gnutls Date: Fri, 28 Aug 2020 14:27:15 +0100 Message-Id: <20200828132716.279782-2-berrange@redhat.com> In-Reply-To: <20200828132716.279782-1-berrange@redhat.com> References: <20200828132716.279782-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/28 07:07:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Wainer dos Santos Moschetta , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) If nettle is disabled and gcrypt enabled, the compiler and linker flags needed for gcrypt are not passed. Gnutls was also not added as a dependancy wen gcrypt is enabled. Signed-off-by: Daniel P. Berrang=C3=A9 --- configure | 2 ++ crypto/meson.build | 24 ++++++++++++------------ meson.build | 5 +++++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 6ecaff429b..4effe769c9 100755 --- a/configure +++ b/configure @@ -6973,6 +6973,8 @@ if test "$gcrypt" =3D "yes" ; then if test "$gcrypt_hmac" =3D "yes" ; then echo "CONFIG_GCRYPT_HMAC=3Dy" >> $config_host_mak fi + echo "GCRYPT_CFLAGS=3D$gcrypt_cflags" >> $config_host_mak + echo "GCRYPT_LIBS=3D$gcrypt_libs" >> $config_host_mak fi if test "$nettle" =3D "yes" ; then echo "CONFIG_NETTLE=3Dy" >> $config_host_mak diff --git a/crypto/meson.build b/crypto/meson.build index 18da7c8541..af12b85aae 100644 --- a/crypto/meson.build +++ b/crypto/meson.build @@ -23,23 +23,23 @@ crypto_ss.add(files( 'tlssession.c', )) =20 -if 'CONFIG_GCRYPT' in config_host - wo_nettle =3D files('hash-gcrypt.c', 'pbkdf-gcrypt.c') +if 'CONFIG_NETTLE' in config_host + crypto_ss.add(files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'),= nettle) +elif 'CONFIG_GCRYPT' in config_host + crypto_ss.add(files('hash-gcrypt.c', 'pbkdf-gcrypt.c'), gcrypt) + if 'CONFIG_GCRYPT_HMAC' in config_host + crypto_ss.add(files('hmac-gcrypt.c')) + else + crypto_ss.add(files('hmac-glib.c')) + endif else - wo_nettle =3D files('hash-glib.c', 'pbkdf-stub.c') -endif -if 'CONFIG_GCRYPT_HMAC' not in config_host - wo_nettle +=3D files('hmac-glib.c') + crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c')) endif -crypto_ss.add(when: [nettle, 'CONFIG_NETTLE'], - if_true: files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettl= e.c'), - if_false: wo_nettle) =20 crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyrin= g.c')) crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c')) -crypto_ss.add(when: 'CONFIG_GCRYPT_HMAC', if_true: files('hmac-gcrypt.c')) crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afa= lg.c', 'hash-afalg.c')) -crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c')) +crypto_ss.add(when: [gnutls, 'CONFIG_GNUTLS'], if_true: files('tls-cipher-= suites.c')) =20 crypto_ss =3D crypto_ss.apply(config_host, strict: false) libcrypto =3D static_library('crypto', crypto_ss.sources() + genh, @@ -53,7 +53,7 @@ crypto =3D declare_dependency(link_whole: libcrypto, util_ss.add(files('aes.c')) util_ss.add(files('init.c')) if 'CONFIG_GCRYPT' in config_host - util_ss.add(files('random-gcrypt.c')) + util_ss.add(files('random-gcrypt.c'), gcrypt) elif 'CONFIG_GNUTLS' in config_host util_ss.add(files('random-gnutls.c'), gnutls) elif 'CONFIG_RNG_NONE' in config_host diff --git a/meson.build b/meson.build index 74f8ea0c2e..c5f672028f 100644 --- a/meson.build +++ b/meson.build @@ -114,6 +114,11 @@ urcubp =3D not_found if 'CONFIG_TRACE_UST' in config_host urcubp =3D declare_dependency(link_args: config_host['URCU_BP_LIBS'].spl= it()) endif +gcrypt =3D not_found +if 'CONFIG_GCRYPT' in config_host + gcrypt =3D declare_dependency(compile_args: config_host['GCRYPT_CFLAGS']= .split(), + link_args: config_host['GCRYPT_LIBS'].split(= )) +endif nettle =3D not_found if 'CONFIG_NETTLE' in config_host nettle =3D declare_dependency(compile_args: config_host['NETTLE_CFLAGS']= .split(), --=20 2.26.2