summarylogtreecommitdiffstats
path: root/0001-Various-fixes-for-building-with-gcc-7.2.1.patch
blob: 503bdc42a8d13e8e8b81ab3a789469354e961527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
From 1913ba5d8941206c7f5a2d555ae3e0b41d6c9296 Mon Sep 17 00:00:00 2001
From: Walter Reiner <walter.reiner@wreiner.at>
Date: Sat, 3 Feb 2018 21:35:57 +0000
Subject: [PATCH] Various fixes for building with gcc 7.2.1

Fix from Intense Coin project for -Werror=stringop-overflow error: https://github.com/valiant1x/intensecoin/issues/10#issuecomment-355038612
Fix from rocksdb upstream for missing includes: https://github.com/facebook/rocksdb/commit/816c1e30ca73615c75fc208ddcc4b05012b30951.diff
Dirty fix from Ceph project for build error when jemalloc is present: https://www.spinics.net/lists/ceph-devel/msg31819.html
---
 CMakeLists.txt                                                         | 2 +-
 external/rocksdb/db/db_impl.cc                                         | 2 +-
 external/rocksdb/db/db_iterator_test.cc                                | 2 ++
 external/rocksdb/db/file_indexer.cc                                    | 2 ++
 external/rocksdb/db/version_builder.cc                                 | 1 +
 external/rocksdb/db/write_callback_test.cc                             | 1 +
 external/rocksdb/include/rocksdb/env.h                                 | 1 +
 external/rocksdb/java/rocksjni/portal.h                                | 1 +
 external/rocksdb/java/rocksjni/rocksjni.cc                             | 1 +
 external/rocksdb/tools/ldb_cmd.cc                                      | 1 +
 external/rocksdb/util/dynamic_bloom_test.cc                            | 1 +
 external/rocksdb/util/fault_injection_test_env.cc                      | 1 +
 external/rocksdb/util/sync_point.cc                                    | 1 +
 external/rocksdb/util/thread_local.h                                   | 1 +
 external/rocksdb/util/xfunc.h                                          | 1 +
 external/rocksdb/utilities/backupable/backupable_db.cc                 | 1 +
 external/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc   | 1 +
 external/rocksdb/utilities/persistent_cache/hash_table_evictable.h     | 1 +
 external/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc      | 1 +
 external/rocksdb/utilities/transactions/optimistic_transaction_test.cc | 1 +
 external/rocksdb/utilities/transactions/transaction_test.cc            | 1 +
 21 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e727d64..fe34f2d 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,7 +53,7 @@ else()
   else()
     set(ARCH_FLAG "-march=${ARCH}")
   endif()
-  set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Werror -Wno-error=extra -Wno-error=unused-function -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wno-error=unused-result")
+  set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings  -Wno-error=extra -Wno-error=unused-function -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wno-error=unused-result")
   if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
     set(WARNINGS "${WARNINGS} -Wno-error=mismatched-tags -Wno-error=null-conversion -Wno-overloaded-shift-op-parentheses -Wno-error=shift-count-overflow -Wno-error=tautological-constant-out-of-range-compare -Wno-error=unused-private-field -Wno-error=unneeded-internal-declaration -Wno-error=unused-function -Wno-error=missing-braces")
   else()
diff --git a/external/rocksdb/db/db_impl.cc b/external/rocksdb/db/db_impl.cc
index f750ef8..727b451 100755
--- a/external/rocksdb/db/db_impl.cc
+++ b/external/rocksdb/db/db_impl.cc
@@ -592,7 +592,7 @@ static void DumpMallocStats(std::string* stats) {
   std::unique_ptr<char> buf{new char[kMallocStatusLen + 1]};
   mstat.cur = buf.get();
   mstat.end = buf.get() + kMallocStatusLen;
-  malloc_stats_print(GetJemallocStatus, &mstat, "");
+  //malloc_stats_print(GetJemallocStatus, &mstat, "");
   stats->append(buf.get());
 #endif  // ROCKSDB_JEMALLOC
 }
diff --git a/external/rocksdb/db/db_iterator_test.cc b/external/rocksdb/db/db_iterator_test.cc
index a971835..069eab6 100755
--- a/external/rocksdb/db/db_iterator_test.cc
+++ b/external/rocksdb/db/db_iterator_test.cc
@@ -7,6 +7,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file. See the AUTHORS file for names of contributors.
 
+#include <functional>
+
 #include "db/db_test_util.h"
 #include "port/stack_trace.h"
 #include "rocksdb/iostats_context.h"
diff --git a/external/rocksdb/db/file_indexer.cc b/external/rocksdb/db/file_indexer.cc
index 9b31c2b..dc614a8 100755
--- a/external/rocksdb/db/file_indexer.cc
+++ b/external/rocksdb/db/file_indexer.cc
@@ -7,6 +7,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file. See the AUTHORS file for names of contributors.
 
+#include <functional>
+
 #include "db/file_indexer.h"
 #include <algorithm>
 #include "rocksdb/comparator.h"
diff --git a/external/rocksdb/db/version_builder.cc b/external/rocksdb/db/version_builder.cc
index 2837686..d4c9c2f 100755
--- a/external/rocksdb/db/version_builder.cc
+++ b/external/rocksdb/db/version_builder.cc
@@ -13,6 +13,7 @@
 #define __STDC_FORMAT_MACROS
 #endif
 
+#include <functional>
 #include <inttypes.h>
 #include <algorithm>
 #include <atomic>
diff --git a/external/rocksdb/db/write_callback_test.cc b/external/rocksdb/db/write_callback_test.cc
index 33aaab7..8e167b4 100755
--- a/external/rocksdb/db/write_callback_test.cc
+++ b/external/rocksdb/db/write_callback_test.cc
@@ -5,6 +5,7 @@
 
 #ifndef ROCKSDB_LITE
 
+#include <functional>
 #include <string>
 #include <utility>
 #include <vector>
diff --git a/external/rocksdb/include/rocksdb/env.h b/external/rocksdb/include/rocksdb/env.h
index 2d33da2..57212d0 100755
--- a/external/rocksdb/include/rocksdb/env.h
+++ b/external/rocksdb/include/rocksdb/env.h
@@ -21,6 +21,7 @@
 #include <cstdarg>
 #include <limits>
 #include <memory>
+#include <functional>
 #include <string>
 #include <vector>
 #include "rocksdb/status.h"
diff --git a/external/rocksdb/java/rocksjni/portal.h b/external/rocksdb/java/rocksjni/portal.h
index 4d7e502..e12a9ee 100755
--- a/external/rocksdb/java/rocksjni/portal.h
+++ b/external/rocksdb/java/rocksjni/portal.h
@@ -11,6 +11,7 @@
 #define JAVA_ROCKSJNI_PORTAL_H_
 
 #include <jni.h>
+#include <functional>
 #include <limits>
 #include <string>
 #include <vector>
diff --git a/external/rocksdb/java/rocksjni/rocksjni.cc b/external/rocksdb/java/rocksjni/rocksjni.cc
index 4c68178..6712083 100755
--- a/external/rocksdb/java/rocksjni/rocksjni.cc
+++ b/external/rocksdb/java/rocksjni/rocksjni.cc
@@ -9,6 +9,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <functional>
 #include <memory>
 #include <string>
 #include <tuple>
diff --git a/external/rocksdb/tools/ldb_cmd.cc b/external/rocksdb/tools/ldb_cmd.cc
index b56eb4c..66ae9dd 100755
--- a/external/rocksdb/tools/ldb_cmd.cc
+++ b/external/rocksdb/tools/ldb_cmd.cc
@@ -40,6 +40,7 @@
 #include <stdexcept>
 #include <string>
 #include <fstream>
+#include <functional>
 
 namespace rocksdb {
 
diff --git a/external/rocksdb/util/dynamic_bloom_test.cc b/external/rocksdb/util/dynamic_bloom_test.cc
index 5b8ec74..0886f79 100755
--- a/external/rocksdb/util/dynamic_bloom_test.cc
+++ b/external/rocksdb/util/dynamic_bloom_test.cc
@@ -21,6 +21,7 @@ int main() {
 #include <memory>
 #include <thread>
 #include <vector>
+#include <functional>
 #include <gflags/gflags.h>
 
 #include "dynamic_bloom.h"
diff --git a/external/rocksdb/util/fault_injection_test_env.cc b/external/rocksdb/util/fault_injection_test_env.cc
index 9898a0d..2123a5c 100755
--- a/external/rocksdb/util/fault_injection_test_env.cc
+++ b/external/rocksdb/util/fault_injection_test_env.cc
@@ -13,6 +13,7 @@
 
 #include "util/fault_injection_test_env.h"
 #include <utility>
+#include <functional>
 
 namespace rocksdb {
 
diff --git a/external/rocksdb/util/sync_point.cc b/external/rocksdb/util/sync_point.cc
index 2aba000..f0d84bd 100755
--- a/external/rocksdb/util/sync_point.cc
+++ b/external/rocksdb/util/sync_point.cc
@@ -5,6 +5,7 @@
 
 #include "util/sync_point.h"
 #include <thread>
+#include <functional>
 #include "port/port.h"
 #include "util/random.h"
 
diff --git a/external/rocksdb/util/thread_local.h b/external/rocksdb/util/thread_local.h
index 08eabd0..de31018 100755
--- a/external/rocksdb/util/thread_local.h
+++ b/external/rocksdb/util/thread_local.h
@@ -9,6 +9,7 @@
 
 #pragma once
 
+#include <functional>
 #include <atomic>
 #include <memory>
 #include <unordered_map>
diff --git a/external/rocksdb/util/xfunc.h b/external/rocksdb/util/xfunc.h
index e19a03f..7c6482c 100755
--- a/external/rocksdb/util/xfunc.h
+++ b/external/rocksdb/util/xfunc.h
@@ -4,6 +4,7 @@
 //  of patent rights can be found in the PATENTS file in the same directory.
 #pragma once
 
+#include <functional>
 #include <cstdlib>
 #include <string>
 
diff --git a/external/rocksdb/utilities/backupable/backupable_db.cc b/external/rocksdb/utilities/backupable/backupable_db.cc
index fb2a68b..67cde26 100755
--- a/external/rocksdb/utilities/backupable/backupable_db.cc
+++ b/external/rocksdb/utilities/backupable/backupable_db.cc
@@ -26,6 +26,7 @@
 #define __STDC_FORMAT_MACROS
 #endif  // __STDC_FORMAT_MACROS
 
+#include <functional>
 #include <inttypes.h>
 #include <stdlib.h>
 #include <algorithm>
diff --git a/external/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc b/external/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc
index ef77252..99ffb7b 100755
--- a/external/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc
+++ b/external/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc
@@ -6,6 +6,7 @@
 
 #include "utilities/persistent_cache/block_cache_tier_file.h"
 
+#include <functional>
 #include <unistd.h>
 #include <memory>
 #include <vector>
diff --git a/external/rocksdb/utilities/persistent_cache/hash_table_evictable.h b/external/rocksdb/utilities/persistent_cache/hash_table_evictable.h
index da13c0e..4fd97e2 100755
--- a/external/rocksdb/utilities/persistent_cache/hash_table_evictable.h
+++ b/external/rocksdb/utilities/persistent_cache/hash_table_evictable.h
@@ -7,6 +7,7 @@
 
 #ifndef ROCKSDB_LITE
 
+#include <functional>
 #include "util/random.h"
 #include "utilities/persistent_cache/hash_table.h"
 #include "utilities/persistent_cache/lrulist.h"
diff --git a/external/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc b/external/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc
index aca9fca..87dbd37 100755
--- a/external/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc
+++ b/external/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc
@@ -7,6 +7,7 @@
 
 #include "utilities/persistent_cache/volatile_tier_impl.h"
 
+#include <functional>
 #include <string>
 
 namespace rocksdb {
diff --git a/external/rocksdb/utilities/transactions/optimistic_transaction_test.cc b/external/rocksdb/utilities/transactions/optimistic_transaction_test.cc
index fd90f24..2ce0c24 100755
--- a/external/rocksdb/utilities/transactions/optimistic_transaction_test.cc
+++ b/external/rocksdb/utilities/transactions/optimistic_transaction_test.cc
@@ -5,6 +5,7 @@
 
 #ifndef ROCKSDB_LITE
 
+#include <functional>
 #include <string>
 #include <thread>
 
diff --git a/external/rocksdb/utilities/transactions/transaction_test.cc b/external/rocksdb/utilities/transactions/transaction_test.cc
index 5d8e40c..9966649 100755
--- a/external/rocksdb/utilities/transactions/transaction_test.cc
+++ b/external/rocksdb/utilities/transactions/transaction_test.cc
@@ -5,6 +5,7 @@
 
 #ifndef ROCKSDB_LITE
 
+#include <functional>
 #include <string>
 #include <thread>
 
-- 
2.16.1