From f47f70fe9c374a399ae266357ea73e6263c15360987f15015d88459cfe326b71 Mon Sep 17 00:00:00 2001 From: Nicolas Morey-Chaisemartin Date: Fri, 19 May 2017 19:12:45 +0000 Subject: [PATCH] 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 --- libpsm2-gcc7.patch | 63 ++++++++++++++++++++++++++++++++++++++++++++++ libpsm2.changes | 6 +++++ libpsm2.spec | 2 ++ 3 files changed, 71 insertions(+) create mode 100644 libpsm2-gcc7.patch diff --git a/libpsm2-gcc7.patch b/libpsm2-gcc7.patch new file mode 100644 index 0000000..09eefe1 --- /dev/null +++ b/libpsm2-gcc7.patch @@ -0,0 +1,63 @@ +From 52aa214e81aeb5b998f83e7426a25a8697039e8e Mon Sep 17 00:00:00 2001 +From: Aravind Gopalakrishnan +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 +--- + 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); + diff --git a/libpsm2.changes b/libpsm2.changes index dda6a18..29cc296 100644 --- a/libpsm2.changes +++ b/libpsm2.changes @@ -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 diff --git a/libpsm2.spec b/libpsm2.spec index 8b75511..ca4330b 100644 --- a/libpsm2.spec +++ b/libpsm2.spec @@ -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