diff --git a/0001-Extend-buffer-for-uvalue-and-pvalue.patch b/0001-Extend-buffer-for-uvalue-and-pvalue.patch new file mode 100644 index 0000000..42f2d45 --- /dev/null +++ b/0001-Extend-buffer-for-uvalue-and-pvalue.patch @@ -0,0 +1,56 @@ +From 399d796ca81507f90a8080e3e58ada54bca023cd Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Tue, 21 Feb 2017 22:49:19 -0500 +Subject: [PATCH] Extend buffer for uvalue and pvalue + +psm_ep.c: In function '__psm_ep_open': +psm_ep.c:1013:27: error: '%1d' directive output may be truncated writing between 1 and 5 bytes into a region of size 4 [-Werror=format-truncation=] + snprintf(pvalue, 4, "%1d", ports[0]); + ^~~ +psm_ep.c:1013:26: note: directive argument in the range [0, 65535] + snprintf(pvalue, 4, "%1d", ports[0]); + ^~~~~ + +Signed-off-by: Honggang Li +--- + psm_ep.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/psm_ep.c b/psm_ep.c +index 6857895..4114fc8 100644 +--- a/psm_ep.c ++++ b/psm_ep.c +@@ -978,7 +978,7 @@ __psm_ep_open(psm_uuid_t const unique_job_key, struct psm_ep_open_opts const *op + int i, num_rails = 0; + char *uname = "IPATH_UNIT"; + char *pname = "IPATH_PORT"; +- char uvalue[4], pvalue[4]; ++ char uvalue[6], pvalue[6]; + int devid_enabled[PTL_MAX_INIT]; + union psmi_envvar_val devs; + +@@ -1009,8 +1009,8 @@ __psm_ep_open(psm_uuid_t const unique_job_key, struct psm_ep_open_opts const *op + + /* 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); + } +@@ -1037,8 +1037,8 @@ __psm_ep_open(psm_uuid_t const unique_job_key, struct psm_ep_open_opts const *op + + 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); + +-- +2.7.4 + diff --git a/0001-Include-sysmacros.h.patch b/0001-Include-sysmacros.h.patch new file mode 100644 index 0000000..cc2a651 --- /dev/null +++ b/0001-Include-sysmacros.h.patch @@ -0,0 +1,29 @@ +From 91859da062efbf336b83375ed9fad51cf3fb1643 Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Tue, 21 Feb 2017 21:57:12 -0500 +Subject: [PATCH] Include sysmacros.h + +Signed-off-by: Honggang Li +--- + ipath/ipath_proto.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/ipath/ipath_proto.c b/ipath/ipath_proto.c +index 5f9365f..2a60c73 100644 +--- a/ipath/ipath_proto.c ++++ b/ipath/ipath_proto.c +@@ -37,7 +37,11 @@ + // level infinipath protocol code. + + #include ++#if __GNUC__ <= 6 + #include ++#else ++#include ++#endif + #include + #include + #include +-- +2.7.4 + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index b75bb63..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# infinipath-psm - -#### Description -Intel Performance Scaled Messaging (PSM) Libraries - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index a63384a..0000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# infinipath-psm - -#### 介绍 -Intel Performance Scaled Messaging (PSM) Libraries - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/adjust-base-cflags.patch b/adjust-base-cflags.patch new file mode 100644 index 0000000..8880af8 --- /dev/null +++ b/adjust-base-cflags.patch @@ -0,0 +1,13 @@ +diff -uprN psm-3.3_raw/buildflags.mak psm-3.3/buildflags.mak +--- psm-3.3_raw/buildflags.mak 2014-08-21 04:00:18.000000000 +0800 ++++ psm-3.3/buildflags.mak 2020-03-13 21:37:04.912463946 +0800 +@@ -94,7 +94,8 @@ ifeq (1,${PSM_USE_SYS_UUID}) + endif + + CFLAGS += $(BASECFLAGS) $(if $(filter $(CC),gcc),-Wno-strict-aliasing) \ +- $(if $(PSM_VALGRIND:0=),-DPSM_VALGRIND,-DNVALGRIND) ++ $(if $(PSM_VALGRIND:0=),-DPSM_VALGRIND,-DNVALGRIND) \ ++ -Wno-maybe-uninitialized -Wno-implicit-function-declaration + + .DEFAULT_GOAL := all + # Dummy install rule for sub-directories that don't install anything diff --git a/extend-fdesc-array.patch b/extend-fdesc-array.patch new file mode 100644 index 0000000..f8e1ef9 --- /dev/null +++ b/extend-fdesc-array.patch @@ -0,0 +1,12 @@ +diff -uprN psm-3.3_raw/psm_utils.c psm-3.3/psm_utils.c +--- psm-3.3_raw/psm_utils.c 2014-08-21 04:00:18.000000000 +0800 ++++ psm-3.3/psm_utils.c 2020-03-13 21:21:12.018263242 +0800 +@@ -955,7 +955,7 @@ psmi_faultinj_getspec(char *spec_name, i + union psmi_envvar_val env_fi; + char fvals_str[128]; + char fname[128]; +- char fdesc[256]; ++ char fdesc[512]; + + snprintf(fvals_str, sizeof fvals_str - 1, "%d:%d:1", num, denom); + fvals_str[sizeof fvals_str - 1] = '\0'; diff --git a/infinipath-psm.spec b/infinipath-psm.spec new file mode 100644 index 0000000..14966e4 --- /dev/null +++ b/infinipath-psm.spec @@ -0,0 +1,80 @@ +Name: infinipath-psm +Version: 3.3 +Release: 7 +License: GPLv2 or BSD +Summary: Libraries for Intel Performance Scaled Messaging +URL: https://github.com/01org/psm +Source0: https://github.com/intel/psm/archive/v3.3.tar.gz +ExclusiveArch: x86_64 +BuildRequires: libuuid-devel +Obsoletes: infinipath-libs <= %{version}-%{release} +Requires: udev +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig +# Add udev rules for psm +Source1: ipath.rules +# Fix indentation misleading +Patch0001: misleading-indentation.patch +# Add base cflags +Patch0002: adjust-base-cflags.patch +# Remove executable permissions for header files +Patch0003: remove-executable-permissions-for-header-files.patch +# Add sysmacros.h for build +Patch0004: 0001-Include-sysmacros.h.patch +# Extend buffer for uvalue and pvalue +Patch0005: 0001-Extend-buffer-for-uvalue-and-pvalue.patch +# Extend fdesc array +Patch0006: extend-fdesc-array.patch + +%description +PSM API is Intel's low-level user-level communications interface for the True Scale family of products. +PSM users are enabled with mechanisms necessary to implement higher level communications interfaces in +parallel environments. + +%package devel +Summary: Files for Intel PSM development +Requires: %{name} = %{version}-%{release} +Obsoletes: infinipath-devel <= %{version}-%{release} +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig + +%description devel +Development files for Intel PSM. + +%prep +%autosetup -n psm-%{version} -p1 +find libuuid -type f -not -name 'psm_uuid.[c|h]' -not -name Makefile -exec rm -f '{}' \; + +%build +%{set_build_flags} +%make_build PSM_USE_SYS_UUID=1 %{PSM_HAVE_SCIF=0 MIC=0} CC=gcc + +%install +%make_install %{PSM_HAVE_SCIF=0 MIC=0} +install -d %{buildroot}%{_sysconfdir}/udev/rules.d +install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/udev/rules.d/60-ipath.rules + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + +%post devel +/sbin/ldconfig + +%postun devel +/sbin/ldconfig + +%files +%doc README COPYING +%{_sysconfdir}/udev/rules.d/60-ipath.rules +%{_libdir}/{libpsm_infinipath.so.*,libinfinipath.so.*} + +%files devel +%{_libdir}/{libpsm_infinipath.so,libinfinipath.so} +%{_includedir}/{psm.h,psm_mq.h} + +%changelog +* Fri Mar 13 2020 Ling Yang - 3.3-7 +- Package Init diff --git a/ipath.rules b/ipath.rules new file mode 100644 index 0000000..e3e71c3 --- /dev/null +++ b/ipath.rules @@ -0,0 +1,4 @@ +KERNEL=="ipath", MODE="0666" +KERNEL=="ipath[0-9]*", MODE="0666" +KERNEL=="ipath_*", MODE="0600" +KERNEL=="kcopy[0-6][0-9]", NAME="kcopy/%02n", MODE="0666" diff --git a/misleading-indentation.patch b/misleading-indentation.patch new file mode 100644 index 0000000..a0b70cc --- /dev/null +++ b/misleading-indentation.patch @@ -0,0 +1,16 @@ +diff -uprN psm-3.3_raw/psm_diags.c psm-3.3/psm_diags.c +--- psm-3.3_raw/psm_diags.c 2014-08-21 04:00:18.000000000 +0800 ++++ psm-3.3/psm_diags.c 2020-03-13 21:35:28.340564067 +0800 +@@ -280,10 +280,11 @@ memcpy_check_size (memcpy_fn_t fn, int * + if (USE_MALLOC) { + src = psmi_malloc(PSMI_EP_NONE, UNDEFINED, size); + dst = psmi_malloc(PSMI_EP_NONE, UNDEFINED, size); +- if (src == NULL || dst == NULL) ++ if (src == NULL || dst == NULL) { + if (src) psmi_free(src); + if (dst) psmi_free(dst); + return -1; ++ } + } + else { + void *src_p, *dst_p; diff --git a/remove-executable-permissions-for-header-files.patch b/remove-executable-permissions-for-header-files.patch new file mode 100644 index 0000000..c1cb2b6 --- /dev/null +++ b/remove-executable-permissions-for-header-files.patch @@ -0,0 +1,15 @@ +diff --git a/Makefile b/Makefile +index d79c4bd..24fa29e 100644 +--- a/Makefile ++++ b/Makefile +@@ -188,8 +188,8 @@ install: all + ln -sf ${TARGLIB}.so.${MAJOR}.${MINOR} ${TARGLIB}.so.${MAJOR} ; \ + ln -sf ${TARGLIB}.so.${MAJOR} ${TARGLIB}.so) ; \ + if [ X$(MIC) != X1 ]; then \ +- install -D psm.h ${DESTDIR}/usr/include/psm.h ; \ +- install -D psm_mq.h ${DESTDIR}/usr/include/psm_mq.h ; \ ++ install -m 0644 -D psm.h ${DESTDIR}/usr/include/psm.h ; \ ++ install -m 0644 -D psm_mq.h ${DESTDIR}/usr/include/psm_mq.h ; \ + else \ + filelist=/opt/intel/mic/psm/psm.filelist ; \ + sed -e 's!%IPATHMAJOR%!$(IPATH_LIB_MAJOR)!g' \ diff --git a/v3.3.tar.gz b/v3.3.tar.gz new file mode 100644 index 0000000..8472f10 Binary files /dev/null and b/v3.3.tar.gz differ