From 0642a44e828249c84a161f7a605fd6286d88fd81fa429244ac5a7932f3985424 Mon Sep 17 00:00:00 2001 From: Nicolas Morey-Chaisemartin Date: Mon, 13 Jun 2022 07:48:45 +0000 Subject: [PATCH] Accepting request 982350 from home:NMoreyChaisemartin:branches:science:HPC - Add issue-2945718-Fix-gcc12-compilation-issue.patch to fix compilation issues with GCC12 OBS-URL: https://build.opensuse.org/request/show/982350 OBS-URL: https://build.opensuse.org/package/show/science:HPC/libvma?expand=0&rev=25 --- ...-2945718-Fix-gcc12-compilation-issue.patch | 50 +++++++++++++++++++ libvma.changes | 6 +++ libvma.spec | 8 +-- 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 issue-2945718-Fix-gcc12-compilation-issue.patch diff --git a/issue-2945718-Fix-gcc12-compilation-issue.patch b/issue-2945718-Fix-gcc12-compilation-issue.patch new file mode 100644 index 0000000..4af0edf --- /dev/null +++ b/issue-2945718-Fix-gcc12-compilation-issue.patch @@ -0,0 +1,50 @@ +commit 865def12ac0e46a80c2ace2e7ed39258b3de30ed +Author: Igor Ivanov +Date: Mon Jan 31 20:01:33 2022 +0200 + + issue: 2945718 Fix gcc12 compilation issue + + C++17 has deprecated a few components that had been in C++ since its beginning, + and std::iterator is one of them. + + In addition fixed configure warning: + checking mellanox/dpcp.h presence... no + configure: WARNING: mellanox/dpcp.h: accepted by the compiler, rejected by the preprocessor! + configure: WARNING: mellanox/dpcp.h: proceeding with the compiler's result + The reason: preprocessor does not see -std=c++11 + + Signed-off-by: Igor Ivanov + +diff --git config/m4/dpcp.m4 config/m4/dpcp.m4 +index 3d3a7593190e..31b40ce6ef78 100644 +--- config/m4/dpcp.m4 ++++ config/m4/dpcp.m4 +@@ -43,7 +43,7 @@ AS_IF([test "x$with_dpcp" == xno], + vma_cv_dpcp_LDFLAGS="-L$with_dpcp/lib64 -Wl,--rpath,$with_dpcp/lib64" + fi + +- CPPFLAGS="$vma_cv_dpcp_CPPFLAGS $CPPFLAGS" ++ CPPFLAGS="-std=c++11 $vma_cv_dpcp_CPPFLAGS $CPPFLAGS" + CXXFLAGS="-std=c++11 $CXXFLAGS" + LDFLAGS="$vma_cv_dpcp_LDFLAGS $LDFLAGS" + LIBS="$vma_cv_dpcp_LIBS $LIBS" +diff --git src/vma/util/vma_list.h src/vma/util/vma_list.h +index ae57fba43676..9c9b6b38b1d5 100644 +--- src/vma/util/vma_list.h ++++ src/vma/util/vma_list.h +@@ -88,9 +88,14 @@ public : + + template + /* coverity[missing_move_assignment] */ +-class list_iterator_t : public std::iterator ++class list_iterator_t + { + public: ++ using iterator_category = std::random_access_iterator_tag; ++ using value_type = T; ++ using difference_type = std::ptrdiff_t; ++ using pointer = T*; ++ using reference = T&; + + list_iterator_t(T* ptr = NULL) : m_ptr(ptr) {} + diff --git a/libvma.changes b/libvma.changes index 9ce1bc5..0b94393 100644 --- a/libvma.changes +++ b/libvma.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jun 13 06:47:26 UTC 2022 - Nicolas Morey-Chaisemartin + +- Add issue-2945718-Fix-gcc12-compilation-issue.patch to fix + compilation issues with GCC12 + ------------------------------------------------------------------- Tue Oct 5 09:08:03 UTC 2021 - Johannes Segitz diff --git a/libvma.spec b/libvma.spec index 1dc13b3..3b3107d 100644 --- a/libvma.spec +++ b/libvma.spec @@ -1,7 +1,7 @@ # # spec file for package libvma # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,7 +29,8 @@ Release: 0 Source0: %{name}-%{version}%{git_ver}.tar.gz Source1: vma.service Patch1: issue-2485156-Fix-fc35-issues.patch -Patch2: harden_vma.service.patch +Patch2: issue-2945718-Fix-gcc12-compilation-issue.patch +Patch3: harden_vma.service.patch URL: https://github.com/Mellanox/libvma BuildRequires: autoconf BuildRequires: automake @@ -73,7 +74,8 @@ Headers and symbolink link required to compile and link with the Libvma library. %prep %setup -q -n %{name}-%{version}%{git_ver} %patch1 -%patch2 -p1 +%patch2 +%patch3 -p1 %build ./autogen.sh