From patchwork Sat Dec 2 00:37:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 120410 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1805954qgn; Fri, 1 Dec 2017 16:37:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMbOSGSU5fSi56UiRfSdDwHkV59NitQ9IhehqeUI4JzhqIZg8xld/LOe+nEDUNPTWk+IgwVN X-Received: by 10.98.245.68 with SMTP id n65mr12096454pfh.113.1512175066032; Fri, 01 Dec 2017 16:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512175066; cv=none; d=google.com; s=arc-20160816; b=0z8zeqBB7zhtScGNqAgnePA/u4Yia0s4Qw7h7n1W2nPwOI8Z7BHsPaR7gYF2xTcxFc /q74AYzQVyQB5utq91zyP4xg7BSsx19OFAPXRWRZ8H51v8hYkR0s9RAzLbc8GsMCXsNQ 3pA3LlA4UrL8Zc7XEK/oGx1RLl8PQgtxE0VHnCl76stVIIlEUa3AwOSXBhqTPStAGmJs cUW4IvHsrzT+petG3D4AoeZmwbu7eOVf8nxE7YYuFd5eE7NJKmDG6PmxiDl3NZkxebOX WwqqyhIWYff4pkXlrO/rdUysAmvJ0diGMM78gjmJSNeioBe7nKpewyRKPE+/CLdsbxYf 1AAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=IMzdTUR19DRJxh59JcWdcrdvvq8c91AVFZD6Cu47htE=; b=0xsemqQZ0BmGH//kjX78V35Qbgvh0HUjDJq9ePGKSVeh+1ZfzBBur5nVfFOPdmLRDy WYdl1ujT+/Vsulo1AH2q/c8JciYOd9KwyqYjksV66Q9BhpHa7kQ6ntUeXv94sxUtp+TF G/WZNtJ+KTKz9vQfCEBI7/PmjsymokCLwGMIrfvFEGSi/9yQj84LGorvOibqe+wqxEk/ UtM90gkVn2/q/h5ACYYog1x+X5Lx1qvcrwqaBrfm+G1GRwSDO/kqOnW4QCtrHYAV7nIN g5BVa1sv0JJ5wKPk7lFjlqohcNpthCW7ArYie0bavEdlezVAttSpxLWjUtrjgmR/MeZJ fG/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Mpm77+Eq; 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=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id z88si5779646plh.687.2017.12.01.16.37.45; Fri, 01 Dec 2017 16:37:46 -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=@gmail.com header.s=20161025 header.b=Mpm77+Eq; 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=gmail.com Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id CF6B878704; Sat, 2 Dec 2017 00:37:42 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by mail.openembedded.org (Postfix) with ESMTP id ED65878416 for ; Sat, 2 Dec 2017 00:37:41 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id s66so11738072wrc.9 for ; Fri, 01 Dec 2017 16:37:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=g3LkhP7QZKHbKIstKRYQ7nubt79ldby2Gyfep7Pma2o=; b=Mpm77+EqQVHKjvMvMfiGJPLu1P3T84wQah+zO7B4gKTI6FDrVux8kHHqtRCkKIzuyJ Rj8H5n4tRtO2THSh/KVhDFpXJHdyBIqbouJjb3vuzK9G/ZTfpNPglKn91DFUcCuqc5BY gHxc+ildx/5cuUZwAfkbpF7p86XGEpfDhjJbp1quwGRgZbmKsC6qKkw+aOaF21V7qT6N LjHMVawIt9fsaVzGgp6R5aI2ZVxXl4lobuz3vedF1hSxyLXsNKsbYoQDTU4s7bSXuLkP A1cHNCr5uof6cXk0kZwca/LzKA6mWHJ/Mq7qbmAtfD0Xkgv50GSEF9gMsQJiayJJiQxC gMVQ== 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:in-reply-to :references; bh=g3LkhP7QZKHbKIstKRYQ7nubt79ldby2Gyfep7Pma2o=; b=cQieY7zB57TJHQA0Nr9sN8vhBxgn2K6L9qOOD+VCKVyH5vzuPrfZvgSs5IwkQqX66Q B75t6rU4zSck8S9H8VWOduSseAA8U/77rzS+4tjEAR1aKyNvhClWb0und2b3wHC1b5kV xD6UzoNh7zrUegWxSR60+NAjhy5/CA3aI/tUWsJ6KuaT4PrM33edbTaxpy1/fykMSnjF cXKoqM6Fo+4aEk16AdcKLanEVnoWLCTiLmaoEo32J3v+Ma7ouTBTYSsOH0tmsmOXcu1C wItyxsOjzvGKBB2jL2bmAiGYNFsjrJcX7hQlB3vIfgrnWyiQ3ETTn+C+vnR61jBwNtGL tkZQ== X-Gm-Message-State: AJaThX6tc7DfPRtKIGhK2hBTQeiRgftptcodE2iZmyEVMXij8Ao9VMTT KG/esm62SUpSg2zXQqrbNlsY3g== X-Received: by 10.223.150.118 with SMTP id c51mr6292090wra.202.1512175062655; Fri, 01 Dec 2017 16:37:42 -0800 (PST) Received: from localhost ([217.30.68.212]) by smtp.gmail.com with ESMTPSA id q13sm5997879wrg.97.2017.12.01.16.37.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Dec 2017 16:37:41 -0800 (PST) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Date: Sat, 2 Dec 2017 00:37:37 +0000 Message-Id: <1512175057-78-1-git-send-email-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20161018011619.31677-1-raj.khem@gmail.com> References: <20161018011619.31677-1-raj.khem@gmail.com> Subject: [OE-core] [morty][RESEND][PATCH] gnutls_3.5.3.bb: Fix native build on distro with kernel < 3.4.17 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: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Khem Raj When using distros which use old kernels gnutls fails to build due to missing SYS_getrandom, therefore we need to check for this before using it. Fixes errorr e.g. | ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c: In function 'have_getrandom': | ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c:59:42: error: 'SYS_getrandom' undeclared (first use in this function) | # define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags) Signed-off-by: Khem Raj Signed-off-by: Martin Jansa --- .../gnutls/gnutls/check_SYS_getrandom.patch | 35 ++++++++++++++++++++++ meta/recipes-support/gnutls/gnutls_3.5.3.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
diff --git a/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch new file mode 100644 index 0000000..535c22a --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch @@ -0,0 +1,35 @@ +From f26c3979ab0325edb2e410d287bc501cf00e0ac0 Mon Sep 17 00:00:00 2001 +From: Nikos Mavrogiannopoulos +Date: Mon, 22 Aug 2016 16:32:34 +0200 +Subject: [PATCH] rnd-linux: added check for SYS_getrandom being defined + +This allows to compile the getrandom() code in old Linux systems +which do not have the system call defined. +--- + +Upstream-Status: Backport +Signed-off-by: Khem Raj + + lib/nettle/rnd-linux.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/rnd-linux.c +index d7f07a6..7a24d05 100644 +--- a/lib/nettle/rnd-linux.c ++++ b/lib/nettle/rnd-linux.c +@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev = 0; + # else + # include + # undef getrandom +-# define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags) ++# if defined(SYS_getrandom) ++# define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags) ++# else ++# define getrandom(dst,s,flags) -1 ++# endif + # endif + + static unsigned have_getrandom(void) +-- +libgit2 0.24.0 + diff --git a/meta/recipes-support/gnutls/gnutls_3.5.3.bb b/meta/recipes-support/gnutls/gnutls_3.5.3.bb index b2dbb07..0400588 100644 --- a/meta/recipes-support/gnutls/gnutls_3.5.3.bb +++ b/meta/recipes-support/gnutls/gnutls_3.5.3.bb @@ -4,6 +4,7 @@ SRC_URI += "file://correct_rpl_gettimeofday_signature.patch \ file://0001-configure.ac-fix-sed-command.patch \ file://use-pkg-config-to-locate-zlib.patch \ file://0001-Use-correct-include-dir-with-minitasn.patch \ + file://check_SYS_getrandom.patch \ file://CVE-2016-7444.patch \ " SRC_URI[md5sum] = "6c2c7f40ddf52933ee3ca474cb8cb63c"