Compare commits

..

No commits in common. "rawhide" and "f33" have entirely different histories.

6 changed files with 131 additions and 1 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/vmemcache-0.8.tar.gz

View file

@ -0,0 +1,38 @@
From e2d1353a064a7ed93d7f384798ab1ae4a7bc0003 Mon Sep 17 00:00:00 2001
From: Adam Borowski <kilobyte@angband.pl>
Date: Tue, 25 Aug 2020 13:01:47 +0200
Subject: [PATCH] Don't let gcc replace Zalloc by calloc.
gcc-10's "tree pattern" optimizations have gotten smarter (or "smarter"...)
and recognize malloc+memset as something that can be replaced with calloc.
Alas, we rely on actual malloc calls (and instrumenting calloc is trickier
than it seems), thus let's disable these optimizations.
Because of paranoia, instead of a specific -fno- attribute, I'm disabling
all optimizations for this function -- who knows that gcc-11 or clang-256
will do?
This was hidden by our Malloc redirection before, but LTO manages to
find out the redirection was unused, and reveal the pattern.
---
src/util.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/util.c b/src/util.c
index ab3117f..c93e2fa 100644
--- a/src/util.c
+++ b/src/util.c
@@ -56,8 +56,10 @@ unsigned long long Mmap_align;
* Zalloc -- allocate zeroed memory
*/
void *
+__attribute__((optimize(0)))
Zalloc(size_t sz)
{
+ /* gcc likes to replace this function as calloc() if optimizing */
void *ret = Malloc(sz);
if (!ret)
return NULL;
--
2.28.0

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# vmemcache
The vmemcache package

View file

@ -1 +0,0 @@
Discontinued upstream

1
sources Normal file
View file

@ -0,0 +1 @@
SHA512 (vmemcache-0.8.tar.gz) = 75d9759052faddc08ad515ed4e890385a5939943a376c9117666b7380395e4ab402929760e9cf48401e11da5b294b6749feba3e89ea7be24a754ac4644e520d8

88
vmemcache.spec Normal file
View file

@ -0,0 +1,88 @@
# The tests are failing for some reason if built out-of-source
%global __cmake_in_source_build 1
Name: vmemcache
Version: 0.8
Release: 7%{?dist}
Summary: Buffer-based LRU cache
License: BSD
URL: https://github.com/pmem/vmemcache
Source0: https://github.com/pmem/vmemcache/archive/%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-Don-t-let-gcc-replace-Zalloc-by-calloc.patch
ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64
BuildRequires: cmake
BuildRequires: valgrind
BuildRequires: valgrind-devel
BuildRequires: pkg-config
BuildRequires: gcc
BuildRequires: pandoc
%description
Vmemcache is a volatile filesystem based key:value cache. It works best
when backed with a DAX-capable persistent memory device, but can work on
tmpfs or on legacy disks.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q
%patch0 -p1
%build
%cmake
%cmake_build
%install
%cmake_install
%check
%ctest
%files
%{_libdir}/libvmemcache.so.0*
%license LICENSE
%files devel
%{_includedir}/*.h
%{_mandir}/*/vmemcache*
%{_libdir}/libvmemcache.so
%{_libdir}/pkgconfig/libvmemcache.pc
%doc ChangeLog
%changelog
* Tue Aug 25 2020 Adam Borowski <kilobyte@angband.pl> 0.8-7
- Re-enable LTO
- Disable optimizations for a function miscompiled by new GCC.
* Thu Aug 06 2020 Jeff Law <law@redhat.com> - 0.8-6
- Disable LTO
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-5
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Apr 15 2019 Adam Borowski <kilobyte@angband.pl> 0.8-1
- Initial packaging