From patchwork Wed Nov 20 16:19:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 179874 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2318829ilf; Wed, 20 Nov 2019 08:19:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxbfEycxrtMIDeTO4vxz1nS3FdoBu9s71e1LZ6RDoBaEzO2iNg3tRHVKMfMe1LMV1B6xxKA X-Received: by 2002:a17:902:a403:: with SMTP id p3mr3530554plq.275.1574266791841; Wed, 20 Nov 2019 08:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574266791; cv=none; d=google.com; s=arc-20160816; b=eRcrETsYzwXHvDG9pu+naeQah9Ee9woMSHefguRAXUk1jDcSd/jGQlUN9x2J3fD+US j4kDl1GXbF0EfNL8UkO3sZE04DSej4+wlhtZHwXjkxFwxkiNMdfY4gUyATV0T5HALO8N xI7WlIHELXoPlq2ig3TCynS7uiu08skxJNeA3Pu/rXnlbe1ZaTVABm/xoAZbHH/bSQg+ 0He8/IiKHv6vdf+DW3+Un5/1BYxKKscTLDZshuBL1xC5Jlg1I9kILnl8Si+IVSrzGh64 pcATydfXDy9Cws6duzDSMNCy0aZdVAtoEvwXjZMMLbyys7EBLwEQEyADFWLnpDLq081f AhSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=O34AVf+cHWUS0272F1/tBPhHRewS23Rc3HjEvJpa8fw=; b=HJCNYZ6s5A+HDxI/ET5ZHNIc5THLl0c41rz/rfN3d9yaGA1U0Zn3t4vng395yhB+i2 7IVU3vrIQDwfTQZZpo7hzB6AH4nzUK0ajJyG0Q7yMpGK0v0sQkDHl7EK32+YXeURkOwy AJO8eqZC1jvV8b48+jeb59qFkopzvLQ5MyyAbmM393EKadTAzNUTAiNvvALUTYrHQJPo Nvr4OZWbqwD/wScLXveslSfTcFw4BVJjwAe48Et7/gwZcacKvfocfSIQPSphFiYV5CDL s0RhhZAAoW2oeB/nVEuPlNCPRvVyb13fP5luyPIoShgeCYwB738X7iTpuqRIp1nGHd+T e6ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="SRCOx+/F"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id i11si1177787pgk.349.2019.11.20.08.19.51; Wed, 20 Nov 2019 08:19:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="SRCOx+/F"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 48FDE7F857; Wed, 20 Nov 2019 16:19:48 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mail.openembedded.org (Postfix) with ESMTP id F25A57F844 for ; Wed, 20 Nov 2019 16:19:46 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id y5so212970wmi.5 for ; Wed, 20 Nov 2019 08:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7F/VC6oStNAj8ttZ9y3q9i0TjT1wCLHrP3qejbjOh3I=; b=SRCOx+/FjYbsXgcno12eCQVI1x1oUbtyVHp91j/rCYFUirhK8euFeehLcNURxc0cd8 ymxk2ICP4TBQDb6LQQE93M+I1CLmdwyNeYw/1LzS82Ikx6kKwYtO0tfkQGt+Lh81n4GE I6KQoh1ppOTq3CtJKUiNSM92sap5lQanz1ICKc4yzcUhzMrif8KiWuZLdlHZ70yKLEDK SAGHqT6hFNUTC6wtLDqEGZBLs9wL66Uf0czMFZ0ys2gsTtAmrqIFY+T9Ieo0bWK2bqyC pWGc+lAK1EzbtiunCg+gy27qSv2nNVDLugIKJycfArGM4GdMLNGsqWynQ9mIZVc4fe84 VF2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7F/VC6oStNAj8ttZ9y3q9i0TjT1wCLHrP3qejbjOh3I=; b=iot/q3Uc3K7fQl6fIhSGvj0RXgFlu5rVhDAg2Y3KDZ4qBkrkPv4Uy86c0VwOaOCBb1 DyEkgetUyd/QUbbezTKSqdS1UL7IlRattCBmlL6Yab6VMDL2fp2aT2On+ZbD+6FGq0/9 uF1Sqb06Z7t5lA8oXnwBARPXivtzkX2av2ToQ7BCeKioRfKfWkhLLnCDjc4VtpzpTXkO 7S0SJUC4JDEVC/inmZAhaWtfM61lPS/CTWGd12boY6UzDJFUHwksqUPGQ761lGC7gYJ3 EokPIp+XT6bHFi0IyEOC1+4p3VLywN02xAc5ZsX2MkQJ6Cea5Kb+rTrRn3FAp4rtRdDn xAdw== X-Gm-Message-State: APjAAAWW7ZDtQaP5bYdI81tM79Z9p6QwTT/ohQq3T0SnCyFTM5GMe/oY qfJ+xLFLd4ubrjFmaz7S0N5Z2uFskSQ= X-Received: by 2002:a05:600c:20e:: with SMTP id 14mr4076752wmi.107.1574266787284; Wed, 20 Nov 2019 08:19:47 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id c24sm36465909wrb.27.2019.11.20.08.19.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 08:19:45 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Wed, 20 Nov 2019 16:19:41 +0000 Message-Id: <20191120161941.13360-1-ross.burton@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [OE-core] [PATCH] rpm: use libgcrypt instead of NSS for cryptography X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org RPM 4.15 by default will use libgcrypt instead of NSS for cryptography functions, but as we didn't have libgcrypt in DEPENDS it kept using NSS. As RPM is the sole user of NSS/NSPR in oe-core, moving to libgcrypt can make a noticable difference to build time. For example, building rpm (and packaging it as RPMs) from scratch is five minutes faster with libgcrypt. Signed-off-by: Ross Burton --- .../rpm/files/gcrypt-use-pkgconfig.patch | 51 +++++++++++++++++++ meta/recipes-devtools/rpm/rpm_4.15.1.bb | 5 +- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-devtools/rpm/files/gcrypt-use-pkgconfig.patch -- 2.20.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/rpm/files/gcrypt-use-pkgconfig.patch b/meta/recipes-devtools/rpm/files/gcrypt-use-pkgconfig.patch new file mode 100644 index 00000000000..8c72d2310b6 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/gcrypt-use-pkgconfig.patch @@ -0,0 +1,51 @@ +Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/942] +Signed-off-by: Ross Burton + +From 3f6cda568853bf7878df704adc75d4a78d75346c Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Wed, 20 Nov 2019 13:06:51 +0000 +Subject: [PATCH] configure.ac: prefer pkg-config to find libgcrypt + +libgcrypt from 1.8.5 provides a pkg-config file as well as the traditional +libgcrypt-config script. As pkg-config is more resiliant in the face of +complicated build environments (for example cross-compilation and sysroots) +prefer the pkg-config file, falling back to libgcrypt-config if that doesn't +exist. +--- + configure.ac | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 0a3a9bbf4..6a3ea3615 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -395,14 +395,21 @@ AC_SUBST(WITH_OPENSSL_LIB) + WITH_LIBGCRYPT_INCLUDE= + WITH_LIBGCRYPT_LIB= + if test "$with_crypto" = libgcrypt ; then +-AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, notfound) +-if test notfound != "$LIBGCRYPT_CONFIG" ; then +-WITH_LIBGCRYPT_INCLUDE=`$LIBGCRYPT_CONFIG --cflags` +-WITH_LIBGCRYPT_LIB=`$LIBGCRYPT_CONFIG --libs` +-fi +-if test -z "$WITH_LIBGCRYPT_LIB" ; then +-AC_MSG_ERROR([libgcrypt not found]) +-fi ++ # libgcrypt 1.8.5 onwards ships a pkg-config file so prefer that ++ PKG_CHECK_MODULES([LIBGCRYPT], [libgcrypt], [have_libgcrypt=yes], [have_libgcrypt=no]) ++ if test "$have_libgcrypt" = "yes"; then ++ WITH_LIBGCRYPT_INCLUDE="$LIBGCRYPT_CFLAGS" ++ WITH_LIBGCRYPT_LIB="$LIBGCRYPT_LIBS" ++ else ++ AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, notfound) ++ if test notfound != "$LIBGCRYPT_CONFIG" ; then ++ WITH_LIBGCRYPT_INCLUDE=`$LIBGCRYPT_CONFIG --cflags` ++ WITH_LIBGCRYPT_LIB=`$LIBGCRYPT_CONFIG --libs` ++ fi ++ if test -z "$WITH_LIBGCRYPT_LIB" ; then ++ AC_MSG_ERROR([libgcrypt not found]) ++ fi ++ fi + fi + + AM_CONDITIONAL([WITH_LIBGCRYPT],[test "$with_crypto" = libgcrypt]) diff --git a/meta/recipes-devtools/rpm/rpm_4.15.1.bb b/meta/recipes-devtools/rpm/rpm_4.15.1.bb index 4fa2d764fb9..f033cf33144 100644 --- a/meta/recipes-devtools/rpm/rpm_4.15.1.bb +++ b/meta/recipes-devtools/rpm/rpm_4.15.1.bb @@ -38,6 +38,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.15.x \ file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \ file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \ file://0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch \ + file://gcrypt-use-pkgconfig.patch \ " PE = "1" @@ -45,7 +46,7 @@ SRCREV = "ab2179452c5be276a6b96c591afded485c7e58c3" S = "${WORKDIR}/git" -DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python3" +DEPENDS = "libarchive libgcrypt db file popt xz bzip2 dbus elfutils python3" DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native" inherit autotools gettext pkgconfig python3native @@ -54,7 +55,7 @@ export PYTHON_ABI # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe EXTRA_AUTORECONF_append = " --exclude=gnu-configize" -EXTRA_OECONF_append = " --without-lua --enable-python" +EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=libgcrypt" EXTRA_OECONF_append_libc-musl = " --disable-nls" # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs