-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rocksdb.patch to work with newer versions of gcc #11
Open
connorgorman
wants to merge
1
commit into
main
Choose a base branch
from
cgorman-rocksdb-patch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
diff --git a/options/db_options.h b/options/db_options.h | ||
index 42a58e256..96d475d5b 100644 | ||
--- a/options/db_options.h | ||
+++ b/options/db_options.h | ||
@@ -98,7 +98,6 @@ struct ImmutableDBOptions { | ||
struct MutableDBOptions { | ||
static const char* kName() { return "MutableDBOptions"; } | ||
MutableDBOptions(); | ||
- explicit MutableDBOptions(const MutableDBOptions& options) = default; | ||
explicit MutableDBOptions(const DBOptions& options); | ||
|
||
void Dump(Logger* log) const; | ||
diff --git a/util/crc32c.cc b/util/crc32c.cc | ||
index 959658099..80094239c 100644 | ||
--- a/util/crc32c.cc | ||
+++ b/util/crc32c.cc | ||
@@ -41,7 +41,7 @@ | ||
|
||
#endif | ||
|
||
-#if defined(__linux__) && defined(HAVE_ARM64_CRC) | ||
+#if defined(HAVE_ARM64_CRC) | ||
bool pmull_runtime_flag = false; | ||
#endif | ||
|
||
@@ -346,6 +346,9 @@ static inline void Slow_CRC32(uint64_t* l, uint8_t const **p) { | ||
table0_[c >> 24]; | ||
} | ||
|
||
+#if (!(defined(HAVE_POWER8) && defined(HAS_ALTIVEC))) && \ | ||
+ (!defined(HAVE_ARM64_CRC)) || \ | ||
+ defined(NO_THREEWAY_CRC32C) | ||
static inline void Fast_CRC32(uint64_t* l, uint8_t const **p) { | ||
#ifndef HAVE_SSE42 | ||
Slow_CRC32(l, p); | ||
@@ -359,6 +362,7 @@ static inline void Fast_CRC32(uint64_t* l, uint8_t const **p) { | ||
*p += 4; | ||
#endif | ||
} | ||
+#endif | ||
|
||
template<void (*CRC32)(uint64_t*, uint8_t const**)> | ||
uint32_t ExtendImpl(uint32_t crc, const char* buf, size_t size) { | ||
@@ -474,7 +478,7 @@ static bool isAltiVec() { | ||
} | ||
#endif | ||
|
||
-#if defined(__linux__) && defined(HAVE_ARM64_CRC) | ||
+#if defined(HAVE_ARM64_CRC) | ||
uint32_t ExtendARMImpl(uint32_t crc, const char *buf, size_t size) { | ||
return crc32c_arm64(crc, (const unsigned char *)buf, size); | ||
} | ||
@@ -494,7 +498,7 @@ std::string IsFastCrc32Supported() { | ||
has_fast_crc = false; | ||
arch = "PPC"; | ||
#endif | ||
-#elif defined(__linux__) && defined(HAVE_ARM64_CRC) | ||
+#elif defined(HAVE_ARM64_CRC) | ||
if (crc32c_runtime_check()) { | ||
has_fast_crc = true; | ||
arch = "Arm64"; | ||
@@ -1227,7 +1231,7 @@ uint32_t crc32c_3way(uint32_t crc, const char* buf, size_t len) { | ||
static inline Function Choose_Extend() { | ||
#ifdef HAVE_POWER8 | ||
return isAltiVec() ? ExtendPPCImpl : ExtendImpl<Slow_CRC32>; | ||
-#elif defined(__linux__) && defined(HAVE_ARM64_CRC) | ||
+#elif defined(HAVE_ARM64_CRC) | ||
if(crc32c_runtime_check()) { | ||
pmull_runtime_flag = crc32c_pmull_runtime_check(); | ||
return ExtendARMImpl; | ||
diff --git a/util/crc32c_arm64.cc b/util/crc32c_arm64.cc | ||
index 566810f4b..80dbf0528 100644 | ||
--- a/util/crc32c_arm64.cc | ||
+++ b/util/crc32c_arm64.cc | ||
@@ -5,9 +5,11 @@ | ||
|
||
#include "util/crc32c_arm64.h" | ||
|
||
-#if defined(__linux__) && defined(HAVE_ARM64_CRC) | ||
+#if defined(HAVE_ARM64_CRC) | ||
|
||
+#if defined(__linux__) | ||
#include <asm/hwcap.h> | ||
+#endif | ||
#ifdef ROCKSDB_AUXV_GETAUXVAL_PRESENT | ||
#include <sys/auxv.h> | ||
#endif | ||
@@ -65,8 +67,8 @@ __attribute__((__no_sanitize__("alignment"))) | ||
__attribute__((__no_sanitize_undefined__)) | ||
#endif | ||
#endif | ||
-uint32_t crc32c_arm64(uint32_t crc, unsigned char const *data, | ||
- unsigned len) { | ||
+uint32_t | ||
+crc32c_arm64(uint32_t crc, unsigned char const *data, size_t len) { | ||
const uint8_t *buf8; | ||
const uint64_t *buf64 = (uint64_t *)data; | ||
int length = (int)len; | ||
diff --git a/util/crc32c_arm64.h b/util/crc32c_arm64.h | ||
index a12354683..b16b1f3e0 100644 | ||
--- a/util/crc32c_arm64.h | ||
+++ b/util/crc32c_arm64.h | ||
@@ -7,6 +7,7 @@ | ||
#define UTIL_CRC32C_ARM64_H | ||
|
||
#include <cinttypes> | ||
+#include <cstddef> | ||
|
||
#if defined(__aarch64__) || defined(__AARCH64__) | ||
|
||
@@ -33,7 +34,8 @@ | ||
PREF4X64L1(buffer, (PREF_OFFSET), 8) \ | ||
PREF4X64L1(buffer, (PREF_OFFSET), 12) | ||
|
||
-extern uint32_t crc32c_arm64(uint32_t crc, unsigned char const *data, unsigned len); | ||
+extern uint32_t crc32c_arm64(uint32_t crc, unsigned char const *data, | ||
+ size_t len); | ||
extern uint32_t crc32c_runtime_check(void); | ||
extern bool crc32c_pmull_runtime_check(void); | ||
|
||
diff --git a/utilities/env_mirror.cc b/utilities/env_mirror.cc | ||
index dbb5e8021..d420bbd00 100644 | ||
--- a/utilities/env_mirror.cc | ||
+++ b/utilities/env_mirror.cc | ||
@@ -27,13 +27,17 @@ class SequentialFileMirror : public SequentialFile { | ||
if (as == Status::OK()) { | ||
char* bscratch = new char[n]; | ||
Slice bslice; | ||
+#ifndef NDEBUG | ||
size_t off = 0; | ||
+#endif | ||
size_t left = aslice.size(); | ||
while (left) { | ||
Status bs = b_->Read(left, &bslice, bscratch); | ||
+#ifndef NDEBUG | ||
assert(as == bs); | ||
assert(memcmp(bscratch, scratch + off, bslice.size()) == 0); | ||
off += bslice.size(); | ||
+#endif | ||
left -= bslice.size(); | ||
} | ||
delete[] bscratch; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Should we have the patch in stackrox/stackrox as well?
We're setting a precedent for having the patch in this documentation repo.
I'm fine with this, but it also means you definitely need to have a look in this repo as well even if you only want to start working on stackrox/stackrox.