All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Frédéric Pierret (fepitre)" <frederic.pierret@qubes-os.org>,
	"Kees Cook" <keescook@chromium.org>,
	"Sasha Levin" <sashal@kernel.org>,
	kernel-hardening@lists.openwall.com
Subject: [PATCH AUTOSEL 4.19 02/31] gcc-common.h: Update for GCC 10
Date: Thu, 14 May 2020 14:53:44 -0400	[thread overview]
Message-ID: <20200514185413.20755-2-sashal@kernel.org> (raw)
In-Reply-To: <20200514185413.20755-1-sashal@kernel.org>

From: Frédéric Pierret (fepitre) <frederic.pierret@qubes-os.org>

[ Upstream commit c7527373fe28f97d8a196ab562db5589be0d34b9 ]

Remove "params.h" include, which has been dropped in GCC 10.

Remove is_a_helper() macro, which is now defined in gimple.h, as seen
when running './scripts/gcc-plugin.sh g++ g++ gcc':

In file included from <stdin>:1:
./gcc-plugins/gcc-common.h:852:13: error: redefinition of ‘static bool is_a_helper<T>::test(U*) [with U = const gimple; T = const ggoto*]’
  852 | inline bool is_a_helper<const ggoto *>::test(const_gimple gs)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./gcc-plugins/gcc-common.h:125,
                 from <stdin>:1:
/usr/lib/gcc/x86_64-redhat-linux/10/plugin/include/gimple.h:1037:1: note: ‘static bool is_a_helper<T>::test(U*) [with U = const gimple; T = const ggoto*]’ previously declared here
 1037 | is_a_helper <const ggoto *>::test (const gimple *gs)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Add -Wno-format-diag to scripts/gcc-plugins/Makefile to avoid
meaningless warnings from error() formats used by plugins:

scripts/gcc-plugins/structleak_plugin.c: In function ‘int plugin_init(plugin_name_args*, plugin_gcc_version*)’:
scripts/gcc-plugins/structleak_plugin.c:253:12: warning: unquoted sequence of 2 consecutive punctuation characters ‘'-’ in format [-Wformat-diag]
  253 |   error(G_("unknown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Frédéric Pierret (fepitre) <frederic.pierret@qubes-os.org>
Link: https://lore.kernel.org/r/20200407113259.270172-1-frederic.pierret@qubes-os.org
[kees: include -Wno-format-diag for plugin builds]
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 scripts/gcc-plugins/Makefile     | 1 +
 scripts/gcc-plugins/gcc-common.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile
index aa0d0ec6936d7..9e95862f27882 100644
--- a/scripts/gcc-plugins/Makefile
+++ b/scripts/gcc-plugins/Makefile
@@ -11,6 +11,7 @@ else
   HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
   HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
   HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable
+  HOST_EXTRACXXFLAGS += -Wno-format-diag
   export HOST_EXTRACXXFLAGS
 endif
 
diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
index 17f06079a7123..9ad76b7f3f10e 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<const ggoto *>::test(const_gimple gs)
@@ -860,6 +863,7 @@ inline bool is_a_helper<const greturn *>::test(const_gimple gs)
 {
 	return gs->code == GIMPLE_RETURN;
 }
+#endif
 
 static inline gasm *as_a_gasm(gimple stmt)
 {
-- 
2.20.1


  reply	other threads:[~2020-05-14 19:04 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 18:53 [PATCH AUTOSEL 4.19 01/31] Makefile: disallow data races on gcc-10 as well Sasha Levin
2020-05-14 18:53 ` Sasha Levin [this message]
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 03/31] HID: multitouch: add eGalaxTouch P80H84 support Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 04/31] HID: alps: Add AUI1657 device ID Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 05/31] HID: alps: ALPS_1657 is too specific; use U1_UNICORN_LEGACY instead Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 06/31] phy: tegra: Select USB_COMMON for usb_get_maximum_speed() Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 07/31] scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 08/31] scsi: qla2xxx: Delete all sessions before unregister local nvme port Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 09/31] configfs: fix config_item refcnt leak in configfs_rmdir() Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 10/31] vhost/vsock: fix packet delivery order to monitoring devices Sasha Levin
2020-05-14 18:53   ` Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 11/31] aquantia: Fix the media type of AQC100 ethernet controller in the driver Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 12/31] net/sonic: Fix a resource leak in an error handling path in 'jazz_sonic_probe()' Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 13/31] most: core: use function subsys_initcall() Sasha Levin
2020-05-14 18:53   ` Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 14/31] component: Silence bind error on -EPROBE_DEFER Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 15/31] scsi: ibmvscsi: Fix WARN_ON during event pool release Sasha Levin
2020-05-14 18:53   ` Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 16/31] HID: i2c-hid: reset Synaptics SYNA2393 on resume Sasha Levin
2020-05-14 18:53 ` [PATCH AUTOSEL 4.19 17/31] soc: qcom: ipa: IPA endpoints Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 18/31] net: ipa: fix a bug in ipa_endpoint_stop() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 19/31] net: moxa: Fix a potential double 'free_irq()' Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 20/31] x86/apic: Move TSC deadline timer debug printk Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 21/31] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 22/31] virtio-blk: handle block_device_operations callbacks after hot unplug Sasha Levin
2020-05-14 18:54   ` Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 23/31] HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 24/31] ceph: fix double unlock in handle_cap_export() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 25/31] stmmac: fix pointer check after utilization in stmmac_interrupt Sasha Levin
2020-05-14 18:54   ` Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 26/31] USB: core: Fix misleading driver bug report Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 27/31] platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 28/31] ARM: futex: Address build warning Sasha Levin
2020-05-14 18:54   ` Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 29/31] crypto: lrw - simplify error handling in create() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 30/31] crypto: xts - simplify error handling in ->create() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.19 31/31] gcc-10: avoid shadowing standard library 'free()' in crypto Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200514185413.20755-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=frederic.pierret@qubes-os.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.