about summary refs log tree commit diff
path: root/pkgs/tools/filesystems/bcache-tools
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2015-06-12 13:57:05 -0700
committerWilliam A. Kennington III <william@wkennington.com>2015-06-12 13:57:05 -0700
commitdce591e0b8f99322b2063940c39c892cb03e6d27 (patch)
treed256446f83ac4b6668b0d8e392163d9ac07875b7 /pkgs/tools/filesystems/bcache-tools
parent458552f614676a338272ca064a3207305345d4f9 (diff)
downloadnixlib-dce591e0b8f99322b2063940c39c892cb03e6d27.tar
nixlib-dce591e0b8f99322b2063940c39c892cb03e6d27.tar.gz
nixlib-dce591e0b8f99322b2063940c39c892cb03e6d27.tar.bz2
nixlib-dce591e0b8f99322b2063940c39c892cb03e6d27.tar.lz
nixlib-dce591e0b8f99322b2063940c39c892cb03e6d27.tar.xz
nixlib-dce591e0b8f99322b2063940c39c892cb03e6d27.tar.zst
nixlib-dce591e0b8f99322b2063940c39c892cb03e6d27.zip
bcache-tools: Add gcc5 compatability patch
Diffstat (limited to 'pkgs/tools/filesystems/bcache-tools')
-rw-r--r--pkgs/tools/filesystems/bcache-tools/default.nix5
-rw-r--r--pkgs/tools/filesystems/bcache-tools/fix-static.patch22
2 files changed, 26 insertions, 1 deletions
diff --git a/pkgs/tools/filesystems/bcache-tools/default.nix b/pkgs/tools/filesystems/bcache-tools/default.nix
index a4b1363d841d..14d8d282c81c 100644
--- a/pkgs/tools/filesystems/bcache-tools/default.nix
+++ b/pkgs/tools/filesystems/bcache-tools/default.nix
@@ -21,7 +21,10 @@ stdenv.mkDerivation rec {
         -i Makefile
   '';
 
-  patches = [ ./bcache-udev-modern.patch ];
+  patches = [
+    ./bcache-udev-modern.patch
+    ./fix-static.patch
+  ];
 
   preBuild = ''
     export makeFlags="$makeFlags PREFIX=\"$out\" UDEVLIBDIR=\"$out/lib/udev/\"";
diff --git a/pkgs/tools/filesystems/bcache-tools/fix-static.patch b/pkgs/tools/filesystems/bcache-tools/fix-static.patch
new file mode 100644
index 000000000000..e5dd2df5299d
--- /dev/null
+++ b/pkgs/tools/filesystems/bcache-tools/fix-static.patch
@@ -0,0 +1,22 @@
+diff --git a/bcache.c b/bcache.c
+index 8f37445..79806d8 100644
+--- a/bcache.c
++++ b/bcache.c
+@@ -26,7 +26,7 @@
+  * x^7 + x^4 + x + 1
+ */
+ 
+-static const uint64_t crc_table[256] = {
++const uint64_t crc_table[256] = {
+ 	0x0000000000000000ULL, 0x42F0E1EBA9EA3693ULL, 0x85E1C3D753D46D26ULL,
+ 	0xC711223CFA3E5BB5ULL, 0x493366450E42ECDFULL, 0x0BC387AEA7A8DA4CULL,
+ 	0xCCD2A5925D9681F9ULL, 0x8E224479F47CB76AULL, 0x9266CC8A1C85D9BEULL,
+@@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = {
+ 	0x9AFCE626CE85B507ULL
+ };
+ 
+-inline uint64_t crc64(const void *_data, size_t len)
++uint64_t crc64(const void *_data, size_t len)
+ {
+ 	uint64_t crc = 0xFFFFFFFFFFFFFFFFULL;
+ 	const unsigned char *data = _data;