From f1e628e7afbf4a6ccd976f865271955ed0d8575e Mon Sep 17 00:00:00 2001 From: Raphael Borun Das Gupta Date: Sun, 11 Oct 2020 15:25:28 +0200 Subject: [PATCH 1/3] foundationdb: refresh gcc-fixes-patch by applying it to apple/foundationdb@5.1.7 and running git diff > ${path_to_nixpkgs}/pkgs/servers/foundationdb/patches/gcc-fixes.patch again. --- .../servers/foundationdb/patches/gcc-fixes.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/foundationdb/patches/gcc-fixes.patch b/pkgs/servers/foundationdb/patches/gcc-fixes.patch index 295e405b9fc..7de05644796 100644 --- a/pkgs/servers/foundationdb/patches/gcc-fixes.patch +++ b/pkgs/servers/foundationdb/patches/gcc-fixes.patch @@ -1,5 +1,5 @@ diff --git a/fdbrpc/ContinuousSample.h b/fdbrpc/ContinuousSample.h -index 54ff1b1..577c228 100644 +index 54ff1b109..577c228ae 100644 --- a/fdbrpc/ContinuousSample.h +++ b/fdbrpc/ContinuousSample.h @@ -26,6 +26,7 @@ @@ -11,7 +11,7 @@ index 54ff1b1..577c228 100644 template class ContinuousSample { diff --git a/fdbrpc/Smoother.h b/fdbrpc/Smoother.h -index 3ed8e6e..fb46947 100644 +index 3ed8e6e98..fb4694750 100644 --- a/fdbrpc/Smoother.h +++ b/fdbrpc/Smoother.h @@ -23,6 +23,7 @@ @@ -30,7 +30,7 @@ index 3ed8e6e..fb46947 100644 \ No newline at end of file +#endif diff --git a/fdbrpc/libcoroutine/Coro.c b/fdbrpc/libcoroutine/Coro.c -index cbfdc8f..9993cee 100644 +index cbfdc8fde..9993cee44 100644 --- a/fdbrpc/libcoroutine/Coro.c +++ b/fdbrpc/libcoroutine/Coro.c @@ -66,6 +66,8 @@ VALGRIND_STACK_DEREGISTER((coro)->valgrindStackId) @@ -43,7 +43,7 @@ index cbfdc8f..9993cee 100644 extern intptr_t g_stackYieldLimit; diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp -index 819c513..acfbfe7 100644 +index 819c513c6..acfbfe7db 100644 --- a/fdbserver/Knobs.cpp +++ b/fdbserver/Knobs.cpp @@ -20,6 +20,7 @@ @@ -55,7 +55,7 @@ index 819c513..acfbfe7 100644 ServerKnobs const* SERVER_KNOBS = new ServerKnobs(); diff --git a/flow/Knobs.cpp b/flow/Knobs.cpp -index b485a84..82541d4 100644 +index b485a8495..82541d439 100644 --- a/flow/Knobs.cpp +++ b/flow/Knobs.cpp @@ -20,6 +20,7 @@ @@ -67,7 +67,7 @@ index b485a84..82541d4 100644 FlowKnobs const* FLOW_KNOBS = new FlowKnobs(); diff --git a/flow/Platform.cpp b/flow/Platform.cpp -index 69dac88..69b86d4 100644 +index 69dac889a..69b86d4ff 100644 --- a/flow/Platform.cpp +++ b/flow/Platform.cpp @@ -623,7 +623,7 @@ void getDiskStatistics(std::string const& directory, uint64_t& currentIOs, uint6 @@ -80,7 +80,7 @@ index 69dac88..69b86d4 100644 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 +index 5421b83b5..711a96093 100755 --- a/flow/TDMetric.actor.h +++ b/flow/TDMetric.actor.h @@ -36,6 +36,7 @@ @@ -92,7 +92,7 @@ index 5421b83..711a960 100755 struct MetricNameRef { MetricNameRef() {} diff --git a/flow/flow.h b/flow/flow.h -index 0c220af..f685fbc 100644 +index 0c220afae..f685fbc63 100644 --- a/flow/flow.h +++ b/flow/flow.h @@ -248,19 +248,6 @@ public: From 4406883af179fc5962302b07ee6ce511f6f81d94 Mon Sep 17 00:00:00 2001 From: Raphael Borun Das Gupta Date: Sun, 11 Oct 2020 15:32:17 +0200 Subject: [PATCH 2/3] foundationdb: fix "was not declared" build errors Since glibc 2.28, `` no longer includes ``, which provides these macros, so we have to explicitly import the latter, too, to fix the following build problems: flow/Platform.cpp: In function 'void getDiskStatistics(const string&, uint64_t&, uint64_t&, uint64_t&, uint64_t&, uint64_t&, uint64_t&)': flow/Platform.cpp:626:56: error: 'gnu_dev_major' was not declared in this scope if(majorId == (unsigned int) gnu_dev_major(buf.st_dev) && minorId == (unsigned int) gnu_dev_minor(buf.st_dev)) { ^ flow/Platform.cpp:626:111: error: 'gnu_dev_minor' was not declared in this scope if(majorId == (unsigned int) gnu_dev_major(buf.st_dev) && minorId == (unsigned int) gnu_dev_minor(buf.st_dev)) { ^ --- pkgs/servers/foundationdb/patches/gcc-fixes.patch | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/foundationdb/patches/gcc-fixes.patch b/pkgs/servers/foundationdb/patches/gcc-fixes.patch index 7de05644796..7e591dd55f5 100644 --- a/pkgs/servers/foundationdb/patches/gcc-fixes.patch +++ b/pkgs/servers/foundationdb/patches/gcc-fixes.patch @@ -67,10 +67,18 @@ index b485a8495..82541d439 100644 FlowKnobs const* FLOW_KNOBS = new FlowKnobs(); diff --git a/flow/Platform.cpp b/flow/Platform.cpp -index 69dac889a..69b86d4ff 100644 +index 69dac889a..62bda9edb 100644 --- a/flow/Platform.cpp +++ b/flow/Platform.cpp -@@ -623,7 +623,7 @@ void getDiskStatistics(std::string const& directory, uint64_t& currentIOs, uint6 +@@ -40,6 +40,7 @@ + #include + + #include ++#include + #include + #include + #include +@@ -623,7 +624,7 @@ void getDiskStatistics(std::string const& directory, uint64_t& currentIOs, uint6 unsigned int minorId; disk_stream >> majorId; disk_stream >> minorId; From 450de176cf6cedd7d331406cd3f4315b2fbf5d1b Mon Sep 17 00:00:00 2001 From: Raphael Borun Das Gupta Date: Sun, 11 Oct 2020 18:07:08 +0200 Subject: [PATCH 3/3] foundationdb: fix build: use glibc's gettid() to avoid build error due to conflicting declaration: flow/Profiler.actor.cpp: In function 'uint64_t gettid()': flow/Profiler.actor.cpp:56:17: error: ambiguating new declaration of 'uint64_t gettid()' FILE* f; ^ In file included from /nix/store/4wy9j24psf9ny4di3anjs7yk2fvfb0gq-glibc-2.31-dev/include/unistd.h:1170:0, from ./flow/Platform.h:49, from ./flow/flow.h:40, from flow/Profiler.actor.cpp:39: /nix/store/4wy9j24psf9ny4di3anjs7yk2fvfb0gq-glibc-2.31-dev/include/bits/unistd_ext.h:34:16: note: old declaration '__pid_t gettid()' extern __pid_t gettid (void) __THROW; ^~~~~~ --- pkgs/servers/foundationdb/patches/gcc-fixes.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/servers/foundationdb/patches/gcc-fixes.patch b/pkgs/servers/foundationdb/patches/gcc-fixes.patch index 7e591dd55f5..a5c77d463fb 100644 --- a/pkgs/servers/foundationdb/patches/gcc-fixes.patch +++ b/pkgs/servers/foundationdb/patches/gcc-fixes.patch @@ -87,6 +87,19 @@ index 69dac889a..62bda9edb 100644 std::string ignore; uint64_t rd_ios; /* # of reads completed */ // This is the total number of reads completed successfully. +diff --git a/flow/Profiler.actor.cpp b/flow/Profiler.actor.cpp +index 27af613e6..69f38c237 100644 +--- a/flow/Profiler.actor.cpp ++++ b/flow/Profiler.actor.cpp +@@ -35,8 +35,6 @@ + + extern volatile int profilingEnabled; + +-static uint64_t gettid() { return syscall(__NR_gettid); } +- + struct SignalClosure { + void (* func)(int, siginfo_t*, void*, void*); + void *userdata; diff --git a/flow/TDMetric.actor.h b/flow/TDMetric.actor.h index 5421b83b5..711a96093 100755 --- a/flow/TDMetric.actor.h