Sync from SUSE:SLFO:Main infinipath-psm revision 4ab7f470574ea868246eb210572ee880

This commit is contained in:
Adrian Schröter 2024-05-03 13:42:44 +02:00
commit 80f03160e5
12 changed files with 622 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,101 @@
commit 352e1547fde216e4e2302e4e6d4f62a678a1858c
Author: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Date: Wed Jan 8 08:28:43 2020 +0100
Add missing extern keywords
Starting from the upcoming GCC release 10, the default of -fcommon option will change to -fno-common:
In C, global variables with multiple tentative definitions will result in linker errors.
Global variable accesses are also more efficient on various targets.
This fixes compilations errors with -fno-common enabled
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
diff --git psm_error.h psm_error.h
index 21f5745c2d1f..886da8944161 100644
--- 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, ...)
diff --git psm_user.h psm_user.h
index c9aadcc42516..75e5c16addb7 100644
--- 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(
diff --git psm_utils.h psm_utils.h
index e6420e01ea62..6c2c5c3e054e 100644
--- 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
diff --git ptl_am/ptl_fwd.h ptl_am/ptl_fwd.h
index 3be8f5b37d80..bfb2715ff051 100644
--- 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);
diff --git ptl_ips/ptl_fwd.h ptl_ips/ptl_fwd.h
index 08d4c53e1b12..5e9cd47a30d7 100644
--- 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 */
diff --git ptl_self/ptl_fwd.h ptl_self/ptl_fwd.h
index ff79c7e66779..32f9041b1f00 100644
--- 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

17
_service Normal file
View File

@ -0,0 +1,17 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/01org/psm.git</param>
<param name="package-meta">no</param>
<param name="exclude">.git</param>
<param name="filename">infinipath-psm</param>
<param name="versionformat">@PARENT_TAG@.@TAG_OFFSET@.%h</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="versionrewrite-replacement">\1</param>
<param name="revision">604758e76dc31e68d1de736ccf5ddf16cb22355b</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*infinipath-psm*.tar</param>
<param name="compression">gz</param>
</service>
</services>

2
baselibs.conf Normal file
View File

@ -0,0 +1,2 @@
libinfinipath4
libpsm_infinipath1

BIN
infinipath-psm-3.3.26.604758e.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,35 @@
---
buildflags.mak | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Index: buildflags.mak
===================================================================
--- buildflags.mak.orig 2014-10-10 23:07:04.000000000 +0200
+++ buildflags.mak 2015-05-29 13:40:24.855086640 +0200
@@ -61,7 +61,7 @@ ifdef SCIF_ROOT_DIR
endif
PSM_HAVE_SCIF ?= $(shell printf '\#include <scif.h>\nint main(void){return(0);}\n' | \
- $(CC) $(CFLAGS) $(LDFLAGS) -x c - -o /dev/null &> /dev/null && echo 1 || echo 0)
+ $(CC) $(CFLAGS) $(RPM_OPT_FLAGS) $(LDFLAGS) -x c - -o /dev/null &> /dev/null && echo 1 || echo 0)
ifeq (1,$(PSM_HAVE_SCIF))
SCIF_INCLUDE_FLAGS += -DPSM_HAVE_SCIF=1
@@ -72,7 +72,7 @@ WERROR := -Werror
INCLUDES := -I. -I$(top_srcdir)/include -I$(top_srcdir)/mpspawn \
-I$(top_srcdir)/include/$(os)-$(arch) $(SCIF_INCLUDE_FLAGS)
BASECFLAGS += $(BASE_FLAGS) $(if $(MIC:0=),$(if $(filter $(CC),icc),-mmic,-D__MIC__)) \
- -Wall $(WERROR) $(if $(MIC:0=),-Wno-unused) -fpic -fPIC -D_GNU_SOURCE \
+ -Wall $(WERROR) $(RPM_OPT_FLAGS) $(if $(MIC:0=),-Wno-unused) -fpic -fPIC -D_GNU_SOURCE \
$(if $(filter $(CC),icc),,-funwind-tables) $(if $(PSM_PROFILE:0=),-DPSM_PROFILE) \
${IPATH_CFLAGS}
ASFLAGS += $(BASE_FLAGS) $(if $(MIC:0=),$(if $(filter $(CC),icc),-mmic,-D__MIC__)) -g3 -fpic
@@ -85,8 +85,6 @@ LDFLAGS += $(SCIF_LINK_FLAGS)
ifneq (,${PSM_DEBUG})
BASECFLAGS += -O -g3 -DPSM_DEBUG $(if $(filter $(CC),icc),,-funit-at-a-time) \
-Wp,-D_FORTIFY_SOURCE=2
-else
- BASECFLAGS += -O3 -g3
endif
ifeq (1,${PSM_USE_SYS_UUID})
BASECFLAGS += -DPSM_USE_SYS_UUID

View File

@ -0,0 +1,27 @@
From: Philipp Thomas <pth@ssue.de>
Date: 2012-09-13 16:20:09 +02:00
Subject: Strip executable mode from headers
Upstream: submitted
Install headers as normal files.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: Makefile
===================================================================
--- Makefile.orig 2015-05-29 11:12:00.395739876 +0200
+++ Makefile 2015-05-29 11:13:00.555359945 +0200
@@ -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 -D -m 644 psm.h ${DESTDIR}/usr/include/psm.h ; \
+ install -D -m 644 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' \

View File

@ -0,0 +1,17 @@
---
buildflags.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: buildflags.mak
===================================================================
--- buildflags.mak.orig 2015-05-29 11:10:57.686178275 +0200
+++ buildflags.mak 2015-05-29 11:11:35.955300481 +0200
@@ -72,7 +72,7 @@ WERROR := -Werror
INCLUDES := -I. -I$(top_srcdir)/include -I$(top_srcdir)/mpspawn \
-I$(top_srcdir)/include/$(os)-$(arch) $(SCIF_INCLUDE_FLAGS)
BASECFLAGS += $(BASE_FLAGS) $(if $(MIC:0=),$(if $(filter $(CC),icc),-mmic,-D__MIC__)) \
- -Wall $(WERROR) $(RPM_OPT_FLAGS) $(if $(MIC:0=),-Wno-unused) -fpic -fPIC -D_GNU_SOURCE \
+ -Wall -Wno-attributes $(RPM_OPT_FLAGS) $(if $(MIC:0=),-Wno-unused) -fpic -fPIC -D_GNU_SOURCE \
$(if $(filter $(CC),icc),,-funwind-tables) $(if $(PSM_PROFILE:0=),-DPSM_PROFILE) \
${IPATH_CFLAGS}
ASFLAGS += $(BASE_FLAGS) $(if $(MIC:0=),$(if $(filter $(CC),icc),-mmic,-D__MIC__)) -g3 -fpic

205
infinipath-psm.changes Normal file
View File

@ -0,0 +1,205 @@
-------------------------------------------------------------------
Fri Apr 3 08:37:16 UTC 2020 - Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
- Add Add-missing-extern-keywords.patch to fix compilation with GCC10 (bsc#1160270)
-------------------------------------------------------------------
Wed Apr 24 09:44:50 UTC 2019 - Martin Liška <mliska@suse.cz>
- Disable LTO (boo#1133133).
-------------------------------------------------------------------
Tue Oct 23 19:24:37 UTC 2018 - Bernhard Wiedemann <bwiedemann@suse.com>
- Extend reproducible.patch to fix all build dates
-------------------------------------------------------------------
Thu Aug 2 09:21:12 UTC 2018 - schwab@suse.de
- sysmacros.patch: Include <sys/sysmacros.h> for minor
-------------------------------------------------------------------
Sat Jul 14 04:58:35 UTC 2018 - bwiedemann@suse.com
- Add reproducible.patch to fix build date (boo#1047218)
-------------------------------------------------------------------
Wed Feb 14 08:29:56 UTC 2018 - nmoreychaisemartin@suse.com
- Mark libpsm_infinipath1 as obsoleting psm2-compat to make sure
it is always picked by default but can be manually "downgraded"
to psm2-compat knowing user (bsc#1080773).
-------------------------------------------------------------------
Tue Sep 5 12:28:30 UTC 2017 - nmoreychaisemartin@suse.com
- Update _service to allow auto updates from github
-------------------------------------------------------------------
Fri Jun 30 07:24:55 UTC 2017 - nmoreychaisemartin@suse.com
- Restore conflict with libpsm2-compat
-------------------------------------------------------------------
Tue May 9 11:47:47 UTC 2017 - nmoreychaisemartin@suse.com
- Drop conflicts with libpsm2-compat
-------------------------------------------------------------------
Mon May 1 16:00:39 UTC 2017 - nmoreychaisemartin@suse.com
- Update to v3.3-26-g604758. (bsc#1036485)
-------------------------------------------------------------------
Wed Apr 19 08:40:53 UTC 2017 - nmoreychaisemartin@suse.com
- Update to latest version v3.3-25-g326b95a (bsc#1027068, fate#322648)
-------------------------------------------------------------------
Tue Apr 11 09:17:06 CEST 2017 - pth@suse.de
- Update to latest version (fate#320170, bsc#943853).
-------------------------------------------------------------------
Fri Mar 31 12:05:18 CEST 2017 - pth@suse.de
- Make package conflict with libpsm2 (fate#321230).
-------------------------------------------------------------------
Wed Nov 30 14:42:24 CET 2016 - pth@suse.de
- Add baselibs.conf as 32 bit libs are needed (bsc#1004947).
-------------------------------------------------------------------
Mon Apr 25 07:41:38 UTC 2016 - p.drouand@gmail.com
- Update to version 3.3-19
* No Changelog available
- Build against system libuuid
- Split libraries into two separate subpackages
- Remove infinipath-non_executable_stack.patch; fixed on upstream
release
-------------------------------------------------------------------
Mon Aug 31 07:40:43 CEST 2015 - pth@suse.de
- Fix source URI.
-------------------------------------------------------------------
Tue Aug 25 10:11:14 CEST 2015 - pth@suse.de
- Set libdir when calling make for installing.
- Add infinipath-non_executable_stack.patch to mark the stack
unexecutable (bsc#942689).
- Remove bogus line in spec file.
-------------------------------------------------------------------
Wed Jun 10 12:49:19 CEST 2015 - pth@suse.de
- Fix name of libdir.
-------------------------------------------------------------------
Fri May 29 11:13:39 CEST 2015 - pth@suse.de
- Adapt patches to changed sources.
-------------------------------------------------------------------
Fri Oct 31 15:09:00 UTC 2014 - Led <ledest@gmail.com>
- fix %%if version condition in spec
-------------------------------------------------------------------
Wed Oct 29 13:52:29 CET 2014 - pth@suse.de
- Only use -Wno-unused-but-set-variable for SLE12 and up.
- Don't use a macro for installing.
-------------------------------------------------------------------
Fri Oct 17 01:05:00 UTC 2014 - Led <ledest@gmail.com>
- replace ambiguous macro %%makeinstall with more common %%make_install
-------------------------------------------------------------------
Tue Jul 8 15:00:35 CEST 2014 - pth@suse.de
- Add COPYING to documentation.
-------------------------------------------------------------------
Fri Jun 6 13:36:47 CEST 2014 - pth@suse.de
- Document that the shared library package was renamed so the package
needs obsoletes/provides.
-------------------------------------------------------------------
Tue Jun 3 11:24:34 CEST 2014 - pth@suse.de
- Update to OFED 3.12 final.
-------------------------------------------------------------------
Tue Mar 18 11:07:05 CET 2014 - pth@suse.de
- Fix ExclusiveArch.
-------------------------------------------------------------------
Wed Mar 5 13:25:54 CET 2014 - pth@suse.de
- Add an ExclusiveArch as the package is only supported on
i686 and x86_64.
-------------------------------------------------------------------
Fri Jan 24 16:40:36 CET 2014 - pth@suse.de
- Fix Copyright in spec file.
-------------------------------------------------------------------
Fri Jan 17 14:53:25 CET 2014 - pth@suse.de
- Update to 3.2 from OFED 3.12
- Remove infinipath-psm-identical_field_names.patch which doesn't
apply anymore.
- Remove infinipath-psm-add_symbol_to_ignore.patch as the fix is
upstream.
-------------------------------------------------------------------
Fri Jul 12 11:33:48 CEST 2013 - pth@suse.de
- Update to latest version 3.1.
- Adapt infinipath-psm-add_symbol_to_ignore.patch to new sources.
- Add source URL.
-------------------------------------------------------------------
Tue Jul 9 15:22:05 CEST 2013 - pth@suse.de
- Fix spec by running service format_spec_file.
-------------------------------------------------------------------
Tue Jun 25 13:38:01 CEST 2013 - pth@suse.de
- Fix makefile so that the presence of _edata does not lead to a
failed build: infinipath-psm-add_symbol_to_ignore.patch
-------------------------------------------------------------------
Tue Oct 9 12:34:15 CEST 2012 - pth@suse.de
- Fix paths to libraries in %%files section.
-------------------------------------------------------------------
Thu Sep 13 16:32:01 CEST 2012 - pth@suse.de
- Update to latest version 3.0.1.
- Use RPM_OPT_FLAGS to define compiler options
(infinipath-psm-cflags.patch).
- Don't use -Werror as newer gccs warn of possible ono-inlining.
(infinipath-psm-no_werror.patch).
- Rename the member of a bitfield as newer gcc stops with error
(infinipath-psm-identical_field_names.patch).
- Don't install headers with executable flag set
(infinipath-psm-executable_headers.patch).
-------------------------------------------------------------------
Tue Sep 11 19:11:48 CEST 2012 - pth@suse.de
- Initial package based on the version in OFED 1.5.4.1
- Implement shared library policy.

138
infinipath-psm.spec Normal file
View File

@ -0,0 +1,138 @@
#
# spec file for package infinipath-psm
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define git_ver .26.604758e
Name: infinipath-psm
Version: 3.3
Release: 0
Summary: QLogic PSM Libraries
License: BSD-2-Clause OR GPL-2.0-only
Group: Productivity/Networking/System
URL: http://www.qlogic.com/
Source0: %{name}-%{version}%{git_ver}.tar.gz
Source1: baselibs.conf
# PATCH-FIX-UPSTREAM infinipath-psm-cflags.patch pth@suse.de
Patch0: infinipath-psm-cflags.patch
# PATCH-FIX-UPSTREAM infinipath-psm-no_werror.patch pth@suse.de
Patch1: infinipath-psm-no_werror.patch
# PATCH-FIX-UPSTREAM infinipath-psm-executable_headers.patch pth@suse.de
Patch3: infinipath-psm-executable_headers.patch
# PATCH-FIX-UPSTREAM bmwiedemann https://github.com/intel/psm/pull/16 boo#1047218
Patch4: reproducible.patch
# PATCH-FIX-UPSTREAM Include <sys/sysmacros.h> for minor
Patch5: sysmacros.patch
# PATCH-FIX-UPSTREAM FIx GCC10 support
Patch6: Add-missing-extern-keywords.patch
BuildRequires: libuuid-devel
Conflicts: infinipath-libs
ExclusiveArch: %ix86 x86_64
%define so_major 4
%define psm_so_major 1
%define lname libinfinipath%{so_major}
%define lnamepsm libpsm_infinipath%{psm_so_major}
%description
The PSM Messaging API, or PSM API, is QLogic's low-level
user-level communications interface for the Truescale
family of products. PSM users are enabled with mechanisms
necessary to implement higher level communications
interfaces in parallel environments.
%package devel
Summary: Development files for QLogic PSM
Group: Development/Libraries/C and C++
Requires: %{lnamepsm} = %{version}
Requires: %{lname} = %{version}
Requires: libuuid-devel
Conflicts: infinipath-devel
%description devel
Development files for the libpsm_infinipath library
%package -n %{lnamepsm}
Summary: Development files for QLogic PSM
Group: System/Libraries
Obsoletes: infinipath-psm < %{version}
Provides: infinipath-psm = %{version}
Conflicts: libpsm2-compat
# PSM1 library does not actually obsolete psm2-compat, BUT
# both RPM provide the same library leaving a choice for
# zypper/OBS. psm2-compat is to be used in extremely rare
# occasions by a knowing user wanting to try out their PSM1 application
# against PSM2 HW. Marking PSM1 as obsoleting psm2-compat
# fixes the issue and match RHEL behaviour. See bsc#1080773
Obsoletes: libpsm2-compat
%description -n %{lnamepsm}
The PSM Messaging API, or PSM API, is QLogic's low-level
user-level communications interface for the Truescale
family of products. PSM users are enabled with mechanisms
necessary to implement higher level communications
interfaces in parallel environments.
%package -n %{lname}
Summary: Development files for QLogic PSM
Group: System/Libraries
%description -n %{lname}
The PSM Messaging API, or PSM API, is QLogic's low-level
user-level communications interface for the Truescale
family of products. PSM users are enabled with mechanisms
necessary to implement higher level communications
interfaces in parallel environments.
%prep
%setup -q -n %{name}-%{version}%{git_ver}
%patch0
%patch1
%patch3
%patch4 -p1
%patch5 -p1
%patch6
%build
%define _lto_cflags %{nil}
export RPM_OPT_FLAGS="%{optflags} -Wno-unused-but-set-variable"
make libdir=%{_libdir} %{?_smp_mflags}
%install
make libdir=%{_libdir} DESTDIR=%{buildroot} install
%post -n %{lname} -p /sbin/ldconfig
%post -n %{lnamepsm} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%postun -n %{lnamepsm} -p /sbin/ldconfig
%files -n %{lname}
%defattr(-,root,root,-)
%{_libdir}/libinfinipath.so.*
%files -n %{lnamepsm}
%defattr(-,root,root,-)
%{_libdir}/libpsm_infinipath.so.*
%files devel
%defattr(-,root,root,-)
%{_libdir}/libpsm_infinipath.so
%{_libdir}/libinfinipath.so
%{_includedir}/psm.h
%{_includedir}/psm_mq.h
%changelog

42
reproducible.patch Normal file
View File

@ -0,0 +1,42 @@
From 47497ea8597baaa65d7781468d4db09abb8ebd53 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Sun, 23 Jul 2017 07:02:28 +0200
Subject: [PATCH] Allow to override build date
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Also uses UTC to be independent of timezone settings.
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d79c4bd..99406ef 100644
--- a/Makefile
+++ b/Makefile
@@ -270,7 +270,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${MAJOR}.${MINOR}
# file around. Generate it such that the ident command can find it
# and strings -a | grep InfiniPath does a reasonable job as well.
${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
- date +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
+ date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
$(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
$(CC) $(LDFLAGS) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared -Wl,--unique='*fastpath*' \
${${TARGLIB}-objs} _revision.o -L$(build_dir)/ipath $(LDLIBS)
Index: infinipath-psm-3.3.26.604758e/ipath/Makefile
===================================================================
--- infinipath-psm-3.3.26.604758e.orig/ipath/Makefile
+++ infinipath-psm-3.3.26.604758e/ipath/Makefile
@@ -70,7 +70,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${
# file around. Generate it such that the ident command can find it
# and strings -a | grep InfiniPath does a reasonable job as well.
${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
- date +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
+ date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
$(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
$(CC) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared \
-Wl,--unique='*fastpath*' \

12
sysmacros.patch Normal file
View File

@ -0,0 +1,12 @@
Index: infinipath-psm-3.3.26.604758e/ipath/ipath_proto.c
===================================================================
--- infinipath-psm-3.3.26.604758e.orig/ipath/ipath_proto.c
+++ infinipath-psm-3.3.26.604758e/ipath/ipath_proto.c
@@ -39,6 +39,7 @@
#include <sys/poll.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>