- Adjust workaround for gcc-11 diagnostic to narrow its scope

This commit is contained in:
Jeff Law 2020-10-30 09:54:19 -06:00
parent b2abd7dde9
commit 43bafceadb
2 changed files with 20 additions and 3 deletions

13
ucx-gcc11.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/ucs/datastruct/mpool.inl b/src/ucs/datastruct/mpool.inl
index d06e2f9..6b32406 100644
--- a/src/ucs/datastruct/mpool.inl
+++ b/src/ucs/datastruct/mpool.inl
@@ -71,7 +71,7 @@ static inline ucs_mpool_t *ucs_mpool_obj_owner(void *obj)
static inline void ucs_mpool_put_inline(void *obj)
{
- ucs_mpool_elem_t *elem;
+ ucs_mpool_elem_t * volatile elem;
ucs_mpool_t *mp;
elem = ucs_mpool_obj_to_elem(obj);

View File

@ -23,6 +23,9 @@ License: BSD
URL: http://www.openucx.org
Source: https://github.com/openucx/%{name}/releases/download/v1.8.1/ucx-1.8.1.tar.gz
Patch: ucx-config.patch
# This avoids a false positive from gcc-11 by making the problematic
# pointer volatile rather than disabling the warning completely
Patch1: %{name}-gcc11.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@ -89,11 +92,9 @@ Provides header files and examples for developing with UCX.
%prep
%setup -q
%patch -p1
%patch1 -p1
%build
# gcc-11 emits a diagnostic for some fishy casting. The code is probably OK.
# Disable the diagnostic for now
export CFLAGS="$RPM_OPT_FLAGS -Wno-array-bounds"
%define _with_arg() %{expand:%%{?with_%{1}:--with-%{2}}%%{!?with_%{1}:--without-%{2}}}
%define _enable_arg() %{expand:%%{?with_%{1}:--enable-%{2}}%%{!?with_%{1}:--disable-%{2}}}
%configure --disable-optimizations \
@ -292,6 +293,9 @@ process to map the memory of another process into its virtual address space.
%changelog
* Fri Oct 30 2020 Jeff Law <law@redhat.com> 1.8.1-5
- Adjust workaround for gcc-11 diagnostic to narrow its scope
* Thu Oct 29 2020 Jeff Law <law@redhat.com> 1.8.1-4
- Disable -Warray-bounds diagnostics for gcc-11