From patchwork Wed Jun 6 21:37:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 137848 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1290508lji; Wed, 6 Jun 2018 14:38:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJm+c7FytTHyPy3vPOw01O3hAihVxOd+uApibXxwo2LG5/9lFvFN85O+e1W+hv1QnAxohRU X-Received: by 2002:a17:902:708c:: with SMTP id z12-v6mr4779344plk.373.1528321124682; Wed, 06 Jun 2018 14:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528321124; cv=none; d=google.com; s=arc-20160816; b=hUlIQNW/U6v5tHItMPWC5qmj6yuJVKhwI/co6rEyxSssFZBVUoNFtu1PrCy5dhEk7t o4WC0JiUgSWlIEa/XF+FfgiqH7v8lHcoPXF+9EEq1dqPMGW021OPx98Qec3ELXhrPQIt uX9+IekgqQuaTm52l4lJ+GlXq0dp0boxKU6kHDR2LeryeOKdb/KFGAY3Cm0DNSff9MLW QaG1v7w1cGcCUQFNVLiSXi2HfNTz6TJOgJMNP69ta27R8e56GHfmMg9XGCXamuztJqzw b4fOxbmVWjjCzzvd7feRb0g1jjyaAMAY0ymVr4hhY0boSy2EMqwfkxabwbJtDBzs6buo BvQQ== 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 :references:in-reply-to:mime-version:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=Vx73JMS2J1B/0rUbYOqB4Tk+sm5tRlcXvjr/8y9S2nY=; b=G/i+VVjw2llUsUEBQQATOMgcqVuKlJNMvuhqVCRmNKbT26ml5e3yXY2n9DUMJd1ajy i8VygCaOpVj0O2vahnt5oB8H1Tc1O9CosMhAt7CqF3TaVqW5ijudf4SyDYh6jItT6y4B DoVJJZLyQ9eFKXRwiEXJZAhD+GrP/ml4VuKmKlGMSWxEPx4kd9gOsoBNh6ymojEZZZQW FJN9+i/9Q8y7QFoZ4jfmhLeAdSdaK/O3z4zLKXN9o6jdhhWTmu7sCTl+UR9kYRAu+N7a gFeGqhN99+dRb1pExrWm7qKmlNNyQ7+zyd+u+tPSyawxKotwy7id4SSoV+2meYgjUsNe kkVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ihmhH8MC; 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=QUARANTINE 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 k2-v6si7825120pgr.206.2018.06.06.14.38.44; Wed, 06 Jun 2018 14:38:44 -0700 (PDT) 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=ihmhH8MC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 2CA6F78421; Wed, 6 Jun 2018 21:37:49 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by mail.openembedded.org (Postfix) with ESMTP id 7EC7477194 for ; Wed, 6 Jun 2018 21:37:38 +0000 (UTC) Received: by mail-pf0-f172.google.com with SMTP id z24-v6so3769969pfe.7 for ; Wed, 06 Jun 2018 14:37:39 -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:in-reply-to :references:content-transfer-encoding; bh=TOM3YVlGmCnoKLKf+YX5/39nlEYndj8Xq/hYxs4hDk8=; b=ihmhH8MCHUJZExyiDU9zh6z51uv196LPgCHrLKTRtMJfAhRErG2ymfDhbIqQb09Ut/ BbfKNKA3kEiCqClsJcae3i2Eo9VMeiQ+G5ACYY6KRSfOGbe8F7h9DlysWyHWYlCYaaSS BdgtmatP2I3HKWD3aT9rMWwHg9jlc3ghRJ3TQz34R7GxVhvnArGwhiKrZzhNU78BfFpF HtVxS0oX35TR7lunVH7Maal8gW+8t/o7e3QBAgCpRQn0aJFwIdJqpuhAX4UBr5xRMpg6 dIaIcdbxtBEyRWigNsXNzj3thdnPdg1FryDLRw54lWmDB6eOosIhUiqWYer30PxQFCAn aLyg== 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 :in-reply-to:references:content-transfer-encoding; bh=TOM3YVlGmCnoKLKf+YX5/39nlEYndj8Xq/hYxs4hDk8=; b=BABZur5bzKmzA6dT6E6IGRY76J3nLsS7Yv+Jy3D8XE8O/w74/inzxgOR+R0Bb0LBmt 79u+CGWx3jqGd+0a0Suq3/mgwDryGl1RWjIoqOkvQX+T6cmkAd3DQKVnfq7ICWOuoOD6 ud3Ag1e2XDLZ7Q0lfAbZV26VlqPfmpS/pD6ka09NT+Dxpq2j+Qcy5zQGZPIoVQ2/rnXa 7p2oL6yfDPQVIuAquN/OnBwni7nv69Fj8vheeAjM01trSsbZpCDxy33yJX3QYWhav08g r+ACTHi+0PM/enjcPRM1qm7yGgjAgOLS0BBpKHqfKBqMlQBkGIeB3P2DpS+oE5HDqw+/ ChSw== X-Gm-Message-State: APt69E159LeF5a3LDuQM76DGmvqJCjdbMyh/x0yNBMASFwc0o5NpKIDX 6cCCBbfizUFEOM3NpZnasGCZhA== X-Received: by 2002:a62:c8a:: with SMTP id 10-v6mr3997469pfm.27.1528321059106; Wed, 06 Jun 2018 14:37:39 -0700 (PDT) Received: from localhost.localdomain ([2601:646:877f:9499::c68]) by smtp.gmail.com with ESMTPSA id c191-v6sm30452374pfg.48.2018.06.06.14.37.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 14:37:38 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 6 Jun 2018 14:37:28 -0700 Message-Id: <9c383be2c15b851e9f795c1037fa798ce1ce175a.1528320772.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 In-Reply-To: References: Subject: [OE-core] [PATCH 12/12] linux-yocto: Fix GCC 8 -Wrestrict error 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 pager.c: do not alias select() params Signed-off-by: Khem Raj --- ...jtool-perf-Fix-GCC-8-Wrestrict-error.patch | 51 +++++++++++++++++++ ...d-pager.c-do-not-alias-select-params.patch | 43 ++++++++++++++++ meta/recipes-kernel/linux/linux-yocto_4.15.bb | 2 + 3 files changed, 96 insertions(+) create mode 100644 meta/recipes-kernel/linux/files/0001-objtool-perf-Fix-GCC-8-Wrestrict-error.patch create mode 100644 meta/recipes-kernel/linux/files/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch diff --git a/meta/recipes-kernel/linux/files/0001-objtool-perf-Fix-GCC-8-Wrestrict-error.patch b/meta/recipes-kernel/linux/files/0001-objtool-perf-Fix-GCC-8-Wrestrict-error.patch new file mode 100644 index 0000000000..6389da478c --- /dev/null +++ b/meta/recipes-kernel/linux/files/0001-objtool-perf-Fix-GCC-8-Wrestrict-error.patch @@ -0,0 +1,51 @@ +From 233aa0194c7ca773866f3ec871f5d12d64ad44e1 Mon Sep 17 00:00:00 2001 +From: Josh Poimboeuf +Date: Thu, 15 Mar 2018 22:11:54 -0500 +Subject: [PATCH] objtool, perf: Fix GCC 8 -Wrestrict error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 854e55ad289ef8888e7991f0ada85d5846f5afb9 upstream. + +Starting with recent GCC 8 builds, objtool and perf fail to build with +the following error: + + ../str_error_r.c: In function ‘str_error_r’: + ../str_error_r.c:25:3: error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict] + snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err); + +The code seems harmless, but there's probably no benefit in printing the +'buf' pointer in this situation anyway, so just remove it to make GCC +happy. + +Reported-by: Laura Abbott +Signed-off-by: Josh Poimboeuf +Tested-by: Laura Abbott +Cc: Adrian Hunter +Cc: Jiri Olsa +Cc: Namhyung Kim +Cc: Wang Nan +Link: http://lkml.kernel.org/r/20180316031154.juk2uncs7baffctp@treble +Signed-off-by: Arnaldo Carvalho de Melo +Cc: Fredrik Schön +Signed-off-by: Greg Kroah-Hartman +--- + tools/lib/str_error_r.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/lib/str_error_r.c b/tools/lib/str_error_r.c +index d6d65537b0d9..6aad8308a0ac 100644 +--- a/tools/lib/str_error_r.c ++++ b/tools/lib/str_error_r.c +@@ -22,6 +22,6 @@ char *str_error_r(int errnum, char *buf, size_t buflen) + { + int err = strerror_r(errnum, buf, buflen); + if (err) +- snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err); ++ snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d", errnum, buflen, err); + return buf; + } +-- +2.17.0 + diff --git a/meta/recipes-kernel/linux/files/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch b/meta/recipes-kernel/linux/files/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch new file mode 100644 index 0000000000..285b13966d --- /dev/null +++ b/meta/recipes-kernel/linux/files/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch @@ -0,0 +1,43 @@ +From ad343a98e74e85aa91d844310e797f96fee6983b Mon Sep 17 00:00:00 2001 +From: Sergey Senozhatsky +Date: Tue, 6 Feb 2018 15:37:52 -0800 +Subject: [PATCH] tools/lib/subcmd/pager.c: do not alias select() params + +Use a separate fd set for select()-s exception fds param to fix the +following gcc warning: + + pager.c:36:12: error: passing argument 2 to restrict-qualified parameter aliases with argument 4 [-Werror=restrict] + select(1, &in, NULL, &in, NULL); + ^~~ ~~~ + +Link: http://lkml.kernel.org/r/20180101105626.7168-1-sergey.senozhatsky@gmail.com +Signed-off-by: Sergey Senozhatsky +Cc: Arnaldo Carvalho de Melo +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + tools/lib/subcmd/pager.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c +index 5ba754d17952..9997a8805a82 100644 +--- a/tools/lib/subcmd/pager.c ++++ b/tools/lib/subcmd/pager.c +@@ -30,10 +30,13 @@ static void pager_preexec(void) + * have real input + */ + fd_set in; ++ fd_set exception; + + FD_ZERO(&in); ++ FD_ZERO(&exception); + FD_SET(0, &in); +- select(1, &in, NULL, &in, NULL); ++ FD_SET(0, &exception); ++ select(1, &in, NULL, &exception, NULL); + + setenv("LESS", "FRSX", 0); + } +-- +2.17.0 + diff --git a/meta/recipes-kernel/linux/linux-yocto_4.15.bb b/meta/recipes-kernel/linux/linux-yocto_4.15.bb index 32e63a57d6..c05e042f37 100644 --- a/meta/recipes-kernel/linux/linux-yocto_4.15.bb +++ b/meta/recipes-kernel/linux/linux-yocto_4.15.bb @@ -28,6 +28,8 @@ SRC_URI += "file://0001-powerpc-Disable-attribute-alias-warnings-from-gcc8.patch file://0002-powerpc-ptrace-Disable-array-bounds-warning-with-gcc.patch \ file://0001-mips-Disable-attribute-alias-warnings.patch \ file://0001-mips64-Disable-attribute-alias-warning.patch \ + file://0001-objtool-perf-Fix-GCC-8-Wrestrict-error.patch \ + file://0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch \ " LINUX_VERSION ?= "4.15.13"