summary refs log tree commit diff
path: root/pkgs/servers/foundationdb
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-02-01 17:42:03 +0100
committerMaximilian Bosch <maximilian@mbosch.me>2020-02-01 17:42:03 +0100
commitea8ae88f0447b0cf7aa8a07844cac78e001f5622 (patch)
tree3c9e5c92d6f3fd72d2a622ee39ddd52306010f28 /pkgs/servers/foundationdb
parent1bb18d9e8dbe537225c8d6ae8476aae3c40df368 (diff)
parent5ff1a53a32b332e3b1a1e295e12e184c65833d13 (diff)
downloadnixpkgs-ea8ae88f0447b0cf7aa8a07844cac78e001f5622.tar
nixpkgs-ea8ae88f0447b0cf7aa8a07844cac78e001f5622.tar.gz
nixpkgs-ea8ae88f0447b0cf7aa8a07844cac78e001f5622.tar.bz2
nixpkgs-ea8ae88f0447b0cf7aa8a07844cac78e001f5622.tar.lz
nixpkgs-ea8ae88f0447b0cf7aa8a07844cac78e001f5622.tar.xz
nixpkgs-ea8ae88f0447b0cf7aa8a07844cac78e001f5622.tar.zst
nixpkgs-ea8ae88f0447b0cf7aa8a07844cac78e001f5622.zip
Merge branch 'staging' into glibc230
Diffstat (limited to 'pkgs/servers/foundationdb')
-rw-r--r--pkgs/servers/foundationdb/default.nix4
-rw-r--r--pkgs/servers/foundationdb/patches/gcc-fixes.patch117
-rw-r--r--pkgs/servers/foundationdb/vsmake.nix12
3 files changed, 124 insertions, 9 deletions
diff --git a/pkgs/servers/foundationdb/default.nix b/pkgs/servers/foundationdb/default.nix
index b7f52e4b836..0e608051a9e 100644
--- a/pkgs/servers/foundationdb/default.nix
+++ b/pkgs/servers/foundationdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, stdenv49, gccStdenv, llvmPackages
+{ gcc6Stdenv, stdenv, gccStdenv, llvmPackages
 , lib, fetchurl, fetchpatch, fetchFromGitHub
 
 , cmake, ninja, which, findutils, m4, gawk
@@ -42,6 +42,7 @@ in with builtins; {
     patches = [
       ./patches/ldflags-5.1.patch
       ./patches/fix-scm-version.patch
+      ./patches/gcc-fixes.patch
       python3-six-patch
       python3-print-patch
     ];
@@ -55,6 +56,7 @@ in with builtins; {
     patches = [
       ./patches/ldflags-5.2.patch
       ./patches/fix-scm-version.patch
+      ./patches/gcc-fixes.patch
       python3-six-patch
       python3-print-patch
     ];
diff --git a/pkgs/servers/foundationdb/patches/gcc-fixes.patch b/pkgs/servers/foundationdb/patches/gcc-fixes.patch
new file mode 100644
index 00000000000..295e405b9fc
--- /dev/null
+++ b/pkgs/servers/foundationdb/patches/gcc-fixes.patch
@@ -0,0 +1,117 @@
+diff --git a/fdbrpc/ContinuousSample.h b/fdbrpc/ContinuousSample.h
+index 54ff1b1..577c228 100644
+--- a/fdbrpc/ContinuousSample.h
++++ b/fdbrpc/ContinuousSample.h
+@@ -26,6 +26,7 @@
+ #include "flow/IRandom.h"
+ #include <vector>
+ #include <algorithm>
++#include <cmath>
+ 
+ template <class T>
+ class ContinuousSample {
+diff --git a/fdbrpc/Smoother.h b/fdbrpc/Smoother.h
+index 3ed8e6e..fb46947 100644
+--- a/fdbrpc/Smoother.h
++++ b/fdbrpc/Smoother.h
+@@ -23,6 +23,7 @@
+ #pragma once
+ 
+ #include "flow/flow.h"
++#include <cmath>
+ 
+ struct Smoother {
+ 	// Times (t) are expected to be nondecreasing
+@@ -90,4 +91,4 @@ struct TimerSmoother {
+ 	double time, total, estimate;
+ };
+ 
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/fdbrpc/libcoroutine/Coro.c b/fdbrpc/libcoroutine/Coro.c
+index cbfdc8f..9993cee 100644
+--- a/fdbrpc/libcoroutine/Coro.c
++++ b/fdbrpc/libcoroutine/Coro.c
+@@ -66,6 +66,8 @@ VALGRIND_STACK_DEREGISTER((coro)->valgrindStackId)
+ #define STACK_DEREGISTER(coro)
+ #endif
+ 
++#pragma GCC diagnostic ignored "-Wreturn-local-addr"
++
+ // Define outside
+ extern intptr_t g_stackYieldLimit;
+ 
+diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp
+index 819c513..acfbfe7 100644
+--- a/fdbserver/Knobs.cpp
++++ b/fdbserver/Knobs.cpp
+@@ -20,6 +20,7 @@
+ 
+ #include "Knobs.h"
+ #include "fdbrpc/Locality.h"
++#include <cmath>
+ 
+ ServerKnobs const* SERVER_KNOBS = new ServerKnobs();
+ 
+diff --git a/flow/Knobs.cpp b/flow/Knobs.cpp
+index b485a84..82541d4 100644
+--- a/flow/Knobs.cpp
++++ b/flow/Knobs.cpp
+@@ -20,6 +20,7 @@
+ 
+ #include "Knobs.h"
+ #include "flow/flow.h"
++#include <cmath>
+ 
+ FlowKnobs const* FLOW_KNOBS = new FlowKnobs();
+ 
+diff --git a/flow/Platform.cpp b/flow/Platform.cpp
+index 69dac88..69b86d4 100644
+--- a/flow/Platform.cpp
++++ b/flow/Platform.cpp
+@@ -623,7 +623,7 @@ void getDiskStatistics(std::string const& directory, uint64_t& currentIOs, uint6
+ 		unsigned int minorId;
+ 		disk_stream >> majorId;
+ 		disk_stream >> minorId;
+-		if(majorId == (unsigned int) major(buf.st_dev) && minorId == (unsigned int) minor(buf.st_dev)) {
++		if(majorId == (unsigned int) gnu_dev_major(buf.st_dev) && minorId == (unsigned int) gnu_dev_minor(buf.st_dev)) {
+ 			std::string ignore;
+ 			uint64_t rd_ios;	/* # of reads completed */
+ 			//	    This is the total number of reads completed successfully.
+diff --git a/flow/TDMetric.actor.h b/flow/TDMetric.actor.h
+index 5421b83..711a960 100755
+--- a/flow/TDMetric.actor.h
++++ b/flow/TDMetric.actor.h
+@@ -36,6 +36,7 @@
+ #include "CompressedInt.h"
+ #include <algorithm>
+ #include <functional>
++#include <cmath>
+ 
+ struct MetricNameRef {
+ 	MetricNameRef() {}
+diff --git a/flow/flow.h b/flow/flow.h
+index 0c220af..f685fbc 100644
+--- a/flow/flow.h
++++ b/flow/flow.h
+@@ -248,19 +248,6 @@ public:
+ 		}
+ 	}
+ 
+-	bool operator == (ErrorOr const& o) const {
+-		return error == o.error && (!present() || get() == o.get());
+-	}
+-	bool operator != (ErrorOr const& o) const {
+-		return !(*this == o);
+-	}
+-
+-	bool operator < (ErrorOr const& o) const {
+-		if (error != o.error) return error < o.error;
+-		if (!present()) return false;
+-		return get() < o.get();
+-	}
+-
+ 	bool isError() const { return error.code() != invalid_error_code; }
+ 	bool isError(int code) const { return error.code() == code; }
+ 	Error getError() const { ASSERT(isError()); return error; }
diff --git a/pkgs/servers/foundationdb/vsmake.nix b/pkgs/servers/foundationdb/vsmake.nix
index 0265e18861e..a7eedb8408b 100644
--- a/pkgs/servers/foundationdb/vsmake.nix
+++ b/pkgs/servers/foundationdb/vsmake.nix
@@ -1,7 +1,7 @@
 # This builder is for FoundationDB's original, somewhat strange visual studio +
 # make build system. In FoundationDB 6.1 and later, there's a new CMake system
 # (which will eventually become the default version.)
-{ stdenv49, lib, fetchurl, fetchFromGitHub
+{ gcc6Stdenv, lib, fetchurl, fetchFromGitHub
 
 , which, findutils, m4, gawk
 , python, openjdk, mono, libressl
@@ -12,7 +12,7 @@ let
   # hysterical raisins dictate a version of boost this old. however,
   # we luckily do not need to build anything, we just need the header
   # files.
-  boost152 = stdenv49.mkDerivation {
+  boost152 = gcc6Stdenv.mkDerivation {
     name = "boost-headers-1.52.0";
 
     src = fetchurl {
@@ -33,10 +33,6 @@ let
     # the revision can be inferred from the fdb tagging policy
     , rev    ? "refs/tags/${version}"
 
-    # in theory newer versions of fdb support newer compilers, but they
-    # don't :( maybe one day
-    , stdenv ? stdenv49
-
     # in theory newer versions of fdb support newer boost versions, but they
     # don't :( maybe one day
     , boost ? boost152
@@ -45,7 +41,7 @@ let
     , officialRelease ? true
 
     , patches ? []
-    }: stdenv.mkDerivation {
+    }: gcc6Stdenv.mkDerivation {
         pname = "foundationdb";
         inherit version;
 
@@ -143,7 +139,7 @@ let
 
         outputs = [ "out" "lib" "dev" "pythonsrc" ];
 
-        meta = with stdenv.lib; {
+        meta = with gcc6Stdenv.lib; {
           description = "Open source, distributed, transactional key-value store";
           homepage    = https://www.foundationdb.org;
           license     = licenses.asl20;