Accepting request 496852 from home:dimstar:Factory

- Add libpsm2-gcc7.patch: Fix build with gcc 7.x. Patch taken from
  upstream git, https://github.com/01org/opa-psm2/commit/52aa214e8.

OBS-URL: https://build.opensuse.org/request/show/496852
OBS-URL: https://build.opensuse.org/package/show/science:HPC/libpsm2?expand=0&rev=20
This commit is contained in:
Nicolas Morey-Chaisemartin 2017-05-19 19:12:45 +00:00 committed by Git OBS Bridge
parent 4857ca87ab
commit f47f70fe9c
3 changed files with 71 additions and 0 deletions

63
libpsm2-gcc7.patch Normal file
View File

@ -0,0 +1,63 @@
From 52aa214e81aeb5b998f83e7426a25a8697039e8e Mon Sep 17 00:00:00 2001
From: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@intel.com>
Date: Wed, 12 Apr 2017 11:38:55 -0700
Subject: [PATCH] Fix build failures caught by gcc 7.x
This fixes build problems reported in Fedora BZ 1423872 .
Tested using mock build system against Fedora rawhide and seems to work fine.
Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@intel.com>
---
psm_ep.c | 10 +++++-----
ptl_ips/ips_recvhdrq.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/psm_ep.c b/psm_ep.c
index 00149a5..2b1ebee 100644
--- a/psm_ep.c
+++ b/psm_ep.c
@@ -922,7 +922,7 @@ __psm2_ep_open(psm2_uuid_t const unique_job_key,
int i, num_rails = 0;
char *uname = "HFI_UNIT";
char *pname = "HFI_PORT";
- char uvalue[4], pvalue[4];
+ char uvalue[6], pvalue[6];
int devid_enabled[PTL_MAX_INIT];
union psmi_envvar_val devs;
@@ -964,8 +964,8 @@ __psm2_ep_open(psm2_uuid_t const unique_job_key,
/* If multi-rail is used, set the first ep unit/port */
if (num_rails > 0) {
- snprintf(uvalue, 4, "%1d", units[0]);
- snprintf(pvalue, 4, "%1d", ports[0]);
+ snprintf(uvalue, 6, "%1d", units[0]);
+ snprintf(pvalue, 6, "%1d", ports[0]);
setenv(uname, uvalue, 1);
setenv(pname, pvalue, 1);
}
@@ -999,8 +999,8 @@ __psm2_ep_open(psm2_uuid_t const unique_job_key,
if (psmi_device_is_enabled(devid_enabled, PTL_DEVID_IPS)) {
for (i = 1; i < num_rails; i++) {
- snprintf(uvalue, 4, "%1d", units[i]);
- snprintf(pvalue, 4, "%1d", ports[i]);
+ snprintf(uvalue, 6, "%1d", units[i]);
+ snprintf(pvalue, 6, "%1d", ports[i]);
setenv(uname, uvalue, 1);
setenv(pname, pvalue, 1);
diff --git a/ptl_ips/ips_recvhdrq.c b/ptl_ips/ips_recvhdrq.c
index 7bd6557..4b2617f 100644
--- a/ptl_ips/ips_recvhdrq.c
+++ b/ptl_ips/ips_recvhdrq.c
@@ -825,7 +825,7 @@ psm2_error_t ips_recvhdrq_scan_cca (struct ips_recvhdrq *recvq)
&ctrlscb, ctrlscb.cksum, 0);
}
}
- else if_pt (_is_cca_becn_set(rcv_ev.p_hdr) << (IPS_RECV_EVENT_BECN - 1) ) {
+ else if_pt (0 != (_is_cca_becn_set(rcv_ev.p_hdr) << (IPS_RECV_EVENT_BECN - 1))) {
struct ips_epstate_entry *epstaddr = ips_epstate_lookup(recvq->epstate,
rcv_ev.p_hdr->connidx);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri May 19 19:07:37 UTC 2017 - dimstar@opensuse.org
- Add libpsm2-gcc7.patch: Fix build with gcc 7.x. Patch taken from
upstream git, https://github.com/01org/opa-psm2/commit/52aa214e8.
-------------------------------------------------------------------
Fri May 19 11:01:20 UTC 2017 - nmoreychaisemartin@suse.com

View File

@ -29,6 +29,7 @@ Source1: libpsm2.changelog
Patch2: libpsm2-use_RPM_OPT_FLAGS.patch
Patch3: libpsm2-use-exported-variable-for-version-and-release.patch
Patch4: libpsm2-include-ioctl_h.patch
Patch5: libpsm2-gcc7.patch
BuildRequires: libuuid-devel
BuildRequires: pkg-config
BuildRequires: udev
@ -81,6 +82,7 @@ Support for MPIs linked with PSM versions < 2.
%patch2
%patch3 -p1
%patch4 -p1
%patch5 -p1
cp %{S:1} ChangeLog