From patchwork Tue Apr 7 11:32:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RnLDqWTDqXJpYyBQaWVycmV0?= X-Patchwork-Id: 11477957 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B0611392 for ; Tue, 7 Apr 2020 11:33:42 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 24E7D206F7 for ; Tue, 7 Apr 2020 11:33:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=qubes-os.org header.i=frederic.pierret@qubes-os.org header.b="RhskYl71" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24E7D206F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=qubes-os.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18455-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 3602 invoked by uid 550); 7 Apr 2020 11:33:39 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 3570 invoked from network); 7 Apr 2020 11:33:38 -0000 ARC-Seal: i=1; a=rsa-sha256; t=1586259204; cv=none; d=zohomail.com; s=zohoarc; b=SQJ4J3gdSHaAMJrAW2vforzWyw2HsCPIDymu1UirJX5baA3vwJe7dTqCwjAEVuVM7D9ln4rmRzEOO9id2GN3SraE3cEoETJudsPsprvBgR6F2rxW5jsfsdrmysdLyf9nlLJgNdSmocWdktBsWrzZ3h+tLlE1+h/jjqVYWUCLhow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586259204; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=C/Yq67cW8uTVVpw1SfMGvhEYjHhJY1OJC8jyQ+cJV/s=; b=BXuIgPue5YQpbdEGogRNrq256YcfNTscgiQEZ4zkrRzccsTQkXQElgKVYJGydLj3kOQe3t98WLjCjTbGkBSyz2MAtQVyOVpnMafy91RzX92JEVVpH1wpCqg/selqsWOSHwoGYtPSQSuY6eVBJQUZwHU/KUBJFWXkGSEBra3B8P4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=qubes-os.org; spf=pass smtp.mailfrom=frederic.pierret@qubes-os.org; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1586259204; s=s; d=qubes-os.org; i=frederic.pierret@qubes-os.org; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=C/Yq67cW8uTVVpw1SfMGvhEYjHhJY1OJC8jyQ+cJV/s=; b=RhskYl71ugxP1z+Y7zz+0MDN+ttSoPYMyRG9M+2ugxCe3Z/xLIFpfFb9BWHZGyb7 XXLbAXx41Y6mBHAcKtjCPEA4benFGfW7o51MWrzc3sWbd1Gcsr7/mDjRrwAn3xlE1Ik S3h6cHXti3yMZg+DThXzREE14n/R/1NNKhKTWork= From: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Pierret_=28fepitre=29?= To: keescook@chromium.org, re.emese@gmail.com, kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Pierret_=28fepitre=29?= Message-ID: <20200407113259.270172-1-frederic.pierret@qubes-os.org> Subject: [PATCH] gcc-common.h: 'params.h' has been dropped in GCC10 Date: Tue, 7 Apr 2020 13:32:59 +0200 X-Mailer: git-send-email 2.25.2 MIME-Version: 1.0 X-ZohoMailClient: External Moreover, GCC10 complains about gimple definition. For example, doing a 'scripts/gcc-plugin.sh g++ g++ gcc' returns: In file included from :1: ./gcc-plugins/gcc-common.h:852:13: error: redefinition of ‘static bool is_a_helper::test(U*) [with U = const gimple; T = const ggoto*]’ 852 | inline bool is_a_helper::test(const_gimple gs) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./gcc-plugins/gcc-common.h:125, from :1: /usr/lib/gcc/x86_64-redhat-linux/10/plugin/include/gimple.h:1037:1: note: ‘static bool is_a_helper::test(U*) [with U = const gimple; T = const ggoto*]’ previously declared here 1037 | is_a_helper ::test (const gimple *gs) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from :1: ./gcc-plugins/gcc-common.h:859:13: error: redefinition of ‘static bool is_a_helper::test(U*) [with U = const gimple; T = const greturn*]’ 859 | inline bool is_a_helper::test(const_gimple gs) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./gcc-plugins/gcc-common.h:125, from :1: /usr/lib/gcc/x86_64-redhat-linux/10/plugin/include/gimple.h:1489:1: note: ‘static bool is_a_helper::test(U*) [with U = const gimple; T = const greturn*]’ previously declared here 1489 | is_a_helper ::test (const gimple *gs) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A hacky way for solving this is to ignore them for GCC10. Signed-off-by: Frédéric Pierret (fepitre) --- scripts/gcc-plugins/gcc-common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h index 17f06079a712..9ad76b7f3f10 100644 --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h @@ -35,7 +35,9 @@ #include "ggc.h" #include "timevar.h" +#if BUILDING_GCC_VERSION < 10000 #include "params.h" +#endif #if BUILDING_GCC_VERSION <= 4009 #include "pointer-set.h" @@ -847,6 +849,7 @@ static inline gimple gimple_build_assign_with_ops(enum tree_code subcode, tree l return gimple_build_assign(lhs, subcode, op1, op2 PASS_MEM_STAT); } +#if BUILDING_GCC_VERSION < 10000 template <> template <> inline bool is_a_helper::test(const_gimple gs) @@ -860,6 +863,7 @@ inline bool is_a_helper::test(const_gimple gs) { return gs->code == GIMPLE_RETURN; } +#endif static inline gasm *as_a_gasm(gimple stmt) {