diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b958dc8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/1.8-rc1.tar.gz diff --git a/0001-Fix-FTBFS-with-gcc-10.patch b/0001-Fix-FTBFS-with-gcc-10.patch new file mode 100644 index 0000000..8f1c9f3 --- /dev/null +++ b/0001-Fix-FTBFS-with-gcc-10.patch @@ -0,0 +1,31 @@ +From b5496d84986419f6923042bc2bda05d736b4aea6 Mon Sep 17 00:00:00 2001 +From: Adam Borowski +Date: Sun, 26 Jan 2020 07:54:27 +0100 +Subject: [PATCH] Fix FTBFS with gcc-10. + +--- + src/jemalloc/jemalloc.mk | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/jemalloc/jemalloc.mk b/src/jemalloc/jemalloc.mk +index 89c25b47e..c6606fb35 100644 +--- a/src/jemalloc/jemalloc.mk ++++ b/src/jemalloc/jemalloc.mk +@@ -83,12 +83,12 @@ CFLAGS_FILTER += -Wlanguage-extension-token + CFLAGS_FILTER += -Wfloat-equal + CFLAGS_FILTER += -Wswitch-default + CFLAGS_FILTER += -Wcast-function-type +-JEMALLOC_CFLAGS=$(filter-out $(CFLAGS_FILTER), $(CFLAGS)) ++JEMALLOC_CFLAGS=$(filter-out $(CFLAGS_FILTER), $(CFLAGS)) -fcommon + ifeq ($(shell uname -s),FreeBSD) + JEMALLOC_CFLAGS += -I/usr/local/include + endif + JEMALLOC_REMOVE_LDFLAGS_TMP = -Wl,--warn-common +-JEMALLOC_LDFLAGS=$(filter-out $(JEMALLOC_REMOVE_LDFLAGS_TMP), $(LDFLAGS)) ++JEMALLOC_LDFLAGS=$(filter-out $(JEMALLOC_REMOVE_LDFLAGS_TMP), $(LDFLAGS)) -fcommon + JEMALLOC_CFG_OUT_FILES_FIRST=$(firstword $(JEMALLOC_CFG_OUT_FILES)) + JEMALLOC_CFG_OUT_FILES_REST=$(filter-out $(JEMALLOC_CFG_OUT_FILES_FIRST), $(JEMALLOC_CFG_OUT_FILES)) + +-- +2.20.1 + diff --git a/sources b/sources new file mode 100644 index 0000000..980b80e --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (1.8-rc1.tar.gz) = 25e5905804ecc8fbd087f77e305d028e313d73c6f72df4ab0a24b51779f64f84d17c996da3fbcdf716b7cbe8c3662ab08cacce69f61072410254ee6689025528 diff --git a/vmem.spec b/vmem.spec new file mode 100644 index 0000000..a7aa659 --- /dev/null +++ b/vmem.spec @@ -0,0 +1,218 @@ + +# rpmbuild options: +# --define _testconfig + +%define upstreamversion 1.8-rc1 + +Name: vmem +Version: 1.8~rc1 +Release: 1%{?dist} +Summary: Volatile Memory Development Kit +License: BSD +URL: http://pmem.io/vmem + +Source0: https://github.com/pmem/vmem/archive/%{upstreamversion}.tar.gz +Patch0: 0001-Fix-FTBFS-with-gcc-10.patch + + +BuildRequires: gcc +BuildRequires: make +BuildRequires: glibc-devel +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: man +BuildRequires: pkgconfig + +# for tests +BuildRequires: gdb +BuildRequires: bc +#BuildRequires: valgrind + +# Debug variants of the libraries should be filtered out of the provides. +%global __provides_exclude_from ^%{_libdir}/vmem_debug/.*\\.so.*$ + +# By design, no 32-bit architectures are supported. As for 64-bit archs, +# there's generally no reason porting couldn't be done, but someone would +# need to do the work. Outside of x86_64, aarch64 works -- but no one did +# any serious testing. +# +# Bugs reported for the PMDK project that VMEM originally comes from: + +# https://bugzilla.redhat.com/show_bug.cgi?id=1340634 +# https://bugzilla.redhat.com/show_bug.cgi?id=1340635 +# https://bugzilla.redhat.com/show_bug.cgi?id=1340636 +# https://bugzilla.redhat.com/show_bug.cgi?id=1340637 + +ExclusiveArch: x86_64 + +%description +vmem and vmmalloc are libraries for using persistent memory as volatile +heap for malloc-like allocations. + + +%package -n libvmem +Summary: Volatile Memory allocation library +%description -n libvmem +The libvmem library turns a pool of persistent memory into a volatile +memory pool, similar to the system heap but kept separate and with +its own malloc-style API. + +%files -n libvmem +%{_libdir}/libvmem.so.* +%license LICENSE +%doc ChangeLog README.md + + +%package -n libvmem-devel +Summary: Development files for the Volatile Memory allocation library +Requires: libvmem = %{version}-%{release} +%description -n libvmem-devel +The libvmem library turns a pool of persistent memory into a volatile +memory pool, similar to the system heap but kept separate and with +its own malloc-style API. + +This sub-package contains libraries and header files for developing +applications that want to make use of libvmem. + +%files -n libvmem-devel +%{_libdir}/libvmem.so +%{_libdir}/pkgconfig/libvmem.pc +%{_includedir}/libvmem.h +%{_mandir}/man7/libvmem.7.gz +%{_mandir}/man3/vmem_*.3.gz +%license LICENSE +%doc ChangeLog README.md + + +%package -n libvmem-debug +Summary: Debug variant of the Volatile Memory allocation library +Requires: libvmem = %{version}-%{release} +%description -n libvmem-debug +The libvmem library turns a pool of persistent memory into a volatile +memory pool, similar to the system heap but kept separate and with +its own malloc-style API. + +This sub-package contains debug variant of the library, providing +run-time assertions and trace points. The typical way to access the +debug version is to set the environment variable LD_LIBRARY_PATH to +/usr/lib64/vmem_debug. + +%files -n libvmem-debug +%dir %{_libdir}/vmem_debug +%{_libdir}/vmem_debug/libvmem.so +%{_libdir}/vmem_debug/libvmem.so.* +%license LICENSE +%doc ChangeLog README.md + + +%package -n libvmmalloc +Summary: Dynamic to Persistent Memory allocation translation library +%description -n libvmmalloc +The libvmmalloc library transparently converts all the dynamic memory +allocations into persistent memory allocations. This allows the use +of persistent memory as volatile memory without modifying the target +application. + +The typical usage of libvmmalloc is to load it via the LD_PRELOAD +environment variable. + +%files -n libvmmalloc +%{_libdir}/libvmmalloc.so.* +%license LICENSE +%doc ChangeLog README.md + + +%package -n libvmmalloc-devel +Summary: Development files for the Dynamic-to-Persistent allocation library +Requires: libvmmalloc = %{version}-%{release} +%description -n libvmmalloc-devel +The libvmmalloc library transparently converts all the dynamic memory +allocations into persistent memory allocations. This allows the use +of persistent memory as volatile memory without modifying the target +application. + +This sub-package contains libraries and header files for developing +applications that want to specifically make use of libvmmalloc. + +%files -n libvmmalloc-devel +%{_libdir}/libvmmalloc.so +%{_libdir}/pkgconfig/libvmmalloc.pc +%{_includedir}/libvmmalloc.h +%{_mandir}/man7/libvmmalloc.7.gz +%license LICENSE +%doc ChangeLog README.md + + +%package -n libvmmalloc-debug +Summary: Debug variant of the Dynamic-to-Persistent allocation library +Requires: libvmmalloc = %{version}-%{release} +%description -n libvmmalloc-debug +The libvmmalloc library transparently converts all the dynamic memory +allocations into persistent memory allocations. This allows the use +of persistent memory as volatile memory without modifying the target +application. + +This sub-package contains debug variant of the library, providing +run-time assertions and trace points. The typical way to access the +debug version is to set the environment variable LD_LIBRARY_PATH to +/usr/lib64/vmem_debug. + +%files -n libvmmalloc-debug +%dir %{_libdir}/vmem_debug +%{_libdir}/vmem_debug/libvmmalloc.so +%{_libdir}/vmem_debug/libvmmalloc.so.* +%license LICENSE +%doc ChangeLog README.md + + +%prep +%setup -q -n vmem-%{upstreamversion} +%patch0 -p1 + + +%build +# For debug build default flags may be overriden to disable compiler +# optimizations. +CFLAGS="%{optflags}" \ +LDFLAGS="%{?__global_ldflags}" \ +make %{?_smp_mflags} NORPATH=1 + + +# Override LIB_AR with empty string to skip installation of static libraries +%install +make install DESTDIR=%{buildroot} \ + LIB_AR= \ + prefix=%{_prefix} \ + libdir=%{_libdir} \ + includedir=%{_includedir} \ + mandir=%{_mandir} \ + bindir=%{_bindir} \ + sysconfdir=%{_sysconfdir} \ + docdir=%{_docdir} + + + +%check +%if 0%{?_skip_check} == 1 + echo "Check skipped" +%else + %if %{defined _testconfig} + cp %{_testconfig} src/test/testconfig.sh + %else + echo "TEST_DIR=/tmp" > src/test/testconfig.sh + echo 'TEST_BUILD="debug nondebug"' >> src/test/testconfig.sh + %endif + make check +%endif + +%ldconfig_scriptlets -n libvmem +%ldconfig_scriptlets -n libvmmalloc + +%if 0%{?__debug_package} == 0 +%debug_package +%endif + + +%changelog +* Fri Jan 24 2020 Adam Borowski - 1.8~rc1 +- Initial RPM release