From d8981421df1e6d83bcc3b2f69612a5d1634e2757 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 19 Aug 2020 10:22:25 -0600 Subject: [PATCH] Work around false positive gcc-11 diagnostic --- libblockdev-gcc11.patch | 15 +++++++++++++++ libblockdev.spec | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 libblockdev-gcc11.patch diff --git a/libblockdev-gcc11.patch b/libblockdev-gcc11.patch new file mode 100644 index 0000000..6e5fe35 --- /dev/null +++ b/libblockdev-gcc11.patch @@ -0,0 +1,15 @@ +diff --git a/src/plugins/kbd.c b/src/plugins/kbd.c +index a2908ec..97abd3b 100644 +--- a/src/plugins/kbd.c ++++ b/src/plugins/kbd.c +@@ -732,6 +732,10 @@ static gboolean wait_for_file (const char *filename) { + * + * Tech category: %BD_KBD_TECH_BCACHE-%BD_KBD_TECH_MODE_CREATE + */ ++/* This triggers a known false positive warning in gcc-11. It's being ++ addressed upstream, but until the fix is available, this works around ++ the false positive. */ ++__attribute__ ((optimize ("-O1"))) + gboolean bd_kbd_bcache_create (const gchar *backing_device, const gchar *cache_device, const BDExtraArg **extra, const gchar **bcache_device, GError **error) { + const gchar *argv[6] = {"make-bcache", "-B", backing_device, "-C", cache_device, NULL}; + gboolean success = FALSE; diff --git a/libblockdev.spec b/libblockdev.spec index c9aa8b0..372868b 100644 --- a/libblockdev.spec +++ b/libblockdev.spec @@ -125,11 +125,12 @@ Name: libblockdev Version: 2.24 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A library for low-level manipulation with block devices License: LGPLv2+ URL: https://github.com/storaged-project/libblockdev Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz +Patch0: libblockdev-gcc11.patch BuildRequires: glib2-devel %if %{with_gi} @@ -680,6 +681,7 @@ A meta-package that pulls all the libblockdev plugins as dependencies. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 %build autoreconf -ivf @@ -983,6 +985,9 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm} %files plugins-all %changelog +* Wed Aug 19 2020 Jeff Law - 2.24-4 +- Work around gcc-11 false positive warning + * Mon Jul 27 2020 Hans de Goede - 2.24-3 - Change -mpath subpackage Requires: device-mapper-multipath into Recommends - Related: rhbz#1857393