commit:     ac8f2fc430322b1a6caa125e93cac120da24db62
Author:     Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
AuthorDate: Sat Nov 28 23:09:18 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Nov 28 23:09:18 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac8f2fc4

sys-fabric/infinipath-psm: fix build with gcc-10

* Thanks to Sam James for providing the patch link

Closes: https://bugs.gentoo.org/706398
Package-Manager: Portage-3.0.9, Repoman-3.0.1
Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../files/infinipath-psm-3.2-fno-common.patch      | 79 ++++++++++++++++++++++
 .../infinipath-psm/infinipath-psm-3.2.ebuild       |  6 +-
 2 files changed, 82 insertions(+), 3 deletions(-)

diff --git 
a/sys-fabric/infinipath-psm/files/infinipath-psm-3.2-fno-common.patch 
b/sys-fabric/infinipath-psm/files/infinipath-psm-3.2-fno-common.patch
new file mode 100644
index 00000000000..7f376f009e7
--- /dev/null
+++ b/sys-fabric/infinipath-psm/files/infinipath-psm-3.2-fno-common.patch
@@ -0,0 +1,79 @@
+Taken From: 
https://build.opensuse.org/package/view_file/science:HPC:Head/infinipath-psm/Add-missing-extern-keywords.patch?expand=1
+Author: Nicolas Morey-Chaisemartin <nmoreychaisemar...@suse.com>
+
+--- psm_error.h
++++ psm_error.h
+@@ -42,7 +42,7 @@
+ #define PSMI_EP_NORETURN          ((psm_ep_t) -2)
+ #define PSMI_EP_LOGEVENT          ((psm_ep_t) -3)
+ 
+-psm_ep_errhandler_t psmi_errhandler_global;
++extern psm_ep_errhandler_t psmi_errhandler_global;
+ 
+ psm_error_t psmi_handle_error(psm_ep_t ep, psm_error_t error, 
+                             const char *buf, ...)
+--- psm_user.h
++++ psm_user.h
+@@ -100,7 +100,7 @@ psm_error_t psmi_mq_wait_internal(psm_mq_req_t *ireq);
+ #endif
+ 
+ #ifdef PSMI_PLOCK_IS_SPINLOCK
+-  psmi_spinlock_t  psmi_progress_lock;
++  extern psmi_spinlock_t  psmi_progress_lock;
+   #define PSMI_PLOCK_INIT()   psmi_spin_init(&psmi_progress_lock)
+   #define PSMI_PLOCK_TRY()    psmi_spin_trylock(&psmi_progress_lock)
+   #define PSMI_PLOCK()              psmi_spin_lock(&psmi_progress_lock)
+@@ -109,8 +109,8 @@ psm_error_t psmi_mq_wait_internal(psm_mq_req_t *ireq);
+   #define PSMI_PUNLOCK_ASSERT()
+   #define PSMI_PLOCK_DISABLED  0
+ #elif defined(PSMI_PLOCK_IS_MUTEXLOCK_DEBUG) 
+-  pthread_mutex_t  psmi_progress_lock;
+-  pthread_t      psmi_progress_lock_owner;
++  extern pthread_mutex_t  psmi_progress_lock;
++  extern pthread_t       psmi_progress_lock_owner;
+   #define PSMI_PLOCK_NO_OWNER ((pthread_t)(-1))
+ 
+   PSMI_ALWAYS_INLINE(
+--- psm_utils.h
++++ psm_utils.h
+@@ -254,7 +254,7 @@ int        psmi_diags(void);
+  * Fault injection
+  */
+ struct psmi_faultinj_spec;
+-int    psmi_faultinj_enabled; /* use macro to test */
++extern int    psmi_faultinj_enabled; /* use macro to test */
+ #if 1 /* possible to disable at compile time */
+ #define PSMI_FAULTINJ_ENABLED()       (!!psmi_faultinj_enabled)
+ #else
+--- ptl_am/ptl_fwd.h
++++ ptl_am/ptl_fwd.h
+@@ -47,7 +47,7 @@
+ #endif
+ 
+ /* Symbol in am ptl */
+-struct ptl_ctl_init psmi_ptl_amsh;
++extern struct ptl_ctl_init psmi_ptl_amsh;
+ 
+ /* Special non-ptl function exposed to pre-attach to shm segment */
+ psm_error_t psmi_shm_attach(psm_ep_t ep, int *shmidx_o);
+--- ptl_ips/ptl_fwd.h
++++ ptl_ips/ptl_fwd.h
+@@ -38,5 +38,5 @@
+ typedef struct ptl_epaddr ips_epaddr_t;
+ 
+ /* Symbol in ips ptl */
+-struct ptl_ctl_init psmi_ptl_ips;
++extern struct ptl_ctl_init psmi_ptl_ips;
+ #endif /* _PTL_FWD_IPS_H */
+--- ptl_self/ptl_fwd.h
++++ ptl_self/ptl_fwd.h
+@@ -35,7 +35,7 @@
+ #define _PTL_FWD_SELF_H
+ 
+ /* Symbol in am ptl */
+-struct ptl_ctl_init psmi_ptl_self;
++extern struct ptl_ctl_init psmi_ptl_self;
+ 
+ #endif
+ 
+

diff --git a/sys-fabric/infinipath-psm/infinipath-psm-3.2.ebuild 
b/sys-fabric/infinipath-psm/infinipath-psm-3.2.ebuild
index 0654f652690..3df69cc34f9 100644
--- a/sys-fabric/infinipath-psm/infinipath-psm-3.2.ebuild
+++ b/sys-fabric/infinipath-psm/infinipath-psm-3.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="5"
@@ -10,11 +10,10 @@ OFED_SUFFIX="2_ga8c3e3e_open"
 OFED_SNAPSHOT="1"
 OFED_SRC_SNAPSHOT="1"
 
-inherit openib udev
+inherit epatch openib udev
 
 DESCRIPTION="OpenIB userspace driver for the PathScale InfiniBand HCAs"
 KEYWORDS="amd64 ~x86 ~amd64-linux"
-IUSE=""
 
 RDEPEND="sys-fabric/libibverbs:${SLOT}"
 DEPEND="${RDEPEND}
@@ -26,6 +25,7 @@ src_prepare() {
        sed -e 's:uname -p:uname -m:g' \
                -e 's:-Werror::g' \
                -i buildflags.mak || die
+       epatch "${FILESDIR}"/${P}-fno-common.patch
 }
 
 src_install() {

Reply via email to