From 9747ae759b9e14ab001173fb2d973b9c511a99ae Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Tue, 25 Apr 2017 17:48:46 +0300 Subject: [PATCH] Switch to upstream patch for building with GCC 7 Signed-off-by: Jonathan Dieter --- ...common-Fix-overflow-error-with-GCC-7.patch | 43 ++++++++++++------- lizardfs.spec | 9 ++-- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/0001-common-Fix-overflow-error-with-GCC-7.patch b/0001-common-Fix-overflow-error-with-GCC-7.patch index 05b32d3..f9ba771 100644 --- a/0001-common-Fix-overflow-error-with-GCC-7.patch +++ b/0001-common-Fix-overflow-error-with-GCC-7.patch @@ -1,37 +1,48 @@ -From 40848993ca0b4ce826b37508b740055d97a961e2 Mon Sep 17 00:00:00 2001 +From ada5b685cf961b62a33afd2c79ad59d78a2789be Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Mon, 24 Apr 2017 21:16:12 +0300 -Subject: [PATCH] [common] Fix overflow error with GCC 7 +Subject: [PATCH] common: Fix overflow error with GCC 7 -Make sure n is always added to unsigned 1 to avoid overflow errors +This commit makes sure n is unsigned to avoid overflow errors in GCC 7. + +Closes #540 Signed-off-by: Jonathan Dieter + +Change-Id: I09ae619029b756a11eeffee8fb55ffe2914c3e9a --- - src/common/galois_coeff.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + src/common/galois_coeff.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/galois_coeff.h b/src/common/galois_coeff.h -index 305bd10..da5a683 100644 +index 305bd10..07708ba 100644 --- a/src/common/galois_coeff.h +++ b/src/common/galois_coeff.h -@@ -38,7 +38,7 @@ constexpr uint8_t gf_mul2(uint8_t x) { +@@ -1,5 +1,5 @@ + /* +- Copyright 2016 Skytechnology sp. z o.o. ++ Copyright 2017 Skytechnology sp. z o.o. + + This file is part of LizardFS. + +@@ -37,7 +37,7 @@ constexpr uint8_t gf_mul2(uint8_t x) { + * \param n Internal variable used for recursion. * \return log(x) */ - constexpr uint8_t gf_log(uint8_t x, uint8_t pow2n = 2, uint8_t n = 1) { -- return x == pow2n ? n : gf_log(x, gf_mul2(pow2n), n + 1); -+ return x == pow2n ? n : gf_log(x, gf_mul2(pow2n), n + 1U); +-constexpr uint8_t gf_log(uint8_t x, uint8_t pow2n = 2, uint8_t n = 1) { ++constexpr uint8_t gf_log(uint8_t x, uint8_t pow2n = 2, unsigned n = 1) { + return x == pow2n ? n : gf_log(x, gf_mul2(pow2n), n + 1); } - /*! \brief Compute base 2 exponent in GF(2^8). -@@ -48,7 +48,7 @@ constexpr uint8_t gf_log(uint8_t x, uint8_t pow2n = 2, uint8_t n = 1) { +@@ -47,7 +47,7 @@ constexpr uint8_t gf_log(uint8_t x, uint8_t pow2n = 2, uint8_t n = 1) { + * \param n Internal variable used for recursion. * \return exp(x) */ - constexpr uint8_t gf_exp(uint8_t x, uint8_t pow2n = 2, uint8_t n = 1) { -- return x == n ? pow2n : gf_exp(x, gf_mul2(pow2n), n + 1); -+ return x == n ? pow2n : gf_exp(x, gf_mul2(pow2n), n + 1U); +-constexpr uint8_t gf_exp(uint8_t x, uint8_t pow2n = 2, uint8_t n = 1) { ++constexpr uint8_t gf_exp(uint8_t x, uint8_t pow2n = 2, unsigned n = 1) { + return x == n ? pow2n : gf_exp(x, gf_mul2(pow2n), n + 1); } - /*! \brief Returns lookup table for base 2 logarithm in GF(2^8). */ -- 2.9.3 diff --git a/lizardfs.spec b/lizardfs.spec index 3ffd419..450b81b 100644 --- a/lizardfs.spec +++ b/lizardfs.spec @@ -1,7 +1,7 @@ Name: lizardfs Summary: Distributed, fault tolerant file system Version: 3.10.6 -Release: 6%{?dist} +Release: 7%{?dist} # LizardFS is under GPLv3 while crcutil is under ASL 2.0 and there's one header, # src/common/coroutine.h, under the Boost license License: GPLv3 and ASL 2.0 and Boost @@ -10,14 +10,14 @@ URL: http://www.lizardfs.org/ Source: https://github.com/lizardfs/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: pam-lizardfs Source2: 95-lizardfs.conf -# Upstream patch at https://github.com/lizardfs/lizardfs/commit/bf9a99963cfbd46962579a5617bff8c20bc8339c # Allows us to create sparse files in el7 +# Upstream patch at https://github.com/lizardfs/lizardfs/commit/bf9a99963cfbd46962579a5617bff8c20bc8339c Patch1: 0001-chunkserver-Add-alternative-include-path-for-falloca.patch # Make sure we drop supplementary groups when running setgid # Pull request at https://github.com/lizardfs/lizardfs/pull/533 Patch2: 0001-main-Remove-supplementary-groups-when-dropping-privi.patch # Fix overflow error in GCC 7 -# Pull request at https://github.com/lizardfs/lizardfs/pull/540 +# Upstream patch at https://github.com/lizardfs/lizardfs/commit/d65ce8aa4c10e914840d78246249b2451bd46ad2 Patch3: 0001-common-Fix-overflow-error-with-GCC-7.patch BuildRequires: fuse-devel BuildRequires: cmake @@ -414,6 +414,9 @@ install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/security/limits.d/95-lizardf %changelog +* Tue Apr 25 2017 Jonathan Dieter - 3.10.6-7 +- Switch to upstream patch for building with GCC 7 + * Mon Apr 24 2017 Jonathan Dieter - 3.10.6-6 - Add patch to fix building in Rawhide