Skip to content
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

Arm64 CRC32 compiling warning suppression #5363

Closed
wants to merge 1 commit into from

Conversation

guyuqi
Copy link
Contributor

@guyuqi guyuqi commented May 28, 2019

When 'HAS_ARMV8_CRC' is enabled, 'rocksdb::crc32c::isPCLMULQDQ() / isSSE42()'
will not be used but have been actually defined.
So it's needed to suppress the warning here.

When 'HAS_ARMV8_CRC' is enabled, 'rocksdb::crc32c::isPCLMULQDQ() / isSSE42()'
will not be used but have been actually defined.
So it's needed to suppress the warning here.

Change-Id: I2a4510f821d2b89e7b5ee95e91fea29731acca50
Signed-off-by: Yuqi Gu <yuqi.gu@arm.com>
@miasantreble
Copy link
Contributor

is this change related to #5304? do we really need -Wno-unused-function flag in both places?

@Yikun
Copy link
Contributor

Yikun commented Jul 11, 2019

@miasantreble I think we still need this patch in the build of linux arm64. Otherwise, we will get back the error like when do make -j8 rocksdbjava:

util/crc32c.cc:404:13: error: ‘bool rocksdb::crc32c::isSSE42()’ defined but not used [-Werror=unused-function]
 static bool isSSE42() {
             ^
util/crc32c.cc:420:13: error: ‘bool rocksdb::crc32c::isPCLMULQDQ()’ defined but not used [-Werror=unused-function]
 static bool isPCLMULQDQ() {
             ^
cc1plus: all warnings being treated as errors
Makefile:1904: recipe for target 'jl/util/crc32c.o' failed
make: *** [jl/util/crc32c.o] Error 1

And the other potential choice is add the ifndef on these two method.

~/rcoksdb$ git diff util/crc32c.cc
diff --git a/util/crc32c.cc b/util/crc32c.cc
index e8d4116..16237ac 100644
--- a/util/crc32c.cc
+++ b/util/crc32c.cc
@@ -398,6 +398,7 @@ uint32_t ExtendImpl(uint32_t crc, const char* buf, size_t size) {
   return static_cast<uint32_t>(l ^ 0xffffffffu);
 }
 
+#ifndef HAVE_ARM64_CRC
 // Detect if SS42 or not.
 #ifndef HAVE_POWER8
 
@@ -436,6 +437,7 @@ static bool isPCLMULQDQ() {
 }
 
 #endif  // HAVE_POWER8
+#endif  // HAVE_ARM64_CRC

Both these two ways can work in my env, : ).

@guyuqi
Copy link
Contributor Author

guyuqi commented Jul 11, 2019

@miasantreble
Sorry for late response.
I think it makes sense to set the flag to 2 places for independent build system(make / cmake).

@siying
Copy link
Contributor

siying commented Jul 11, 2019

@Yikun can we do the second way?

@Yikun
Copy link
Contributor

Yikun commented Jul 12, 2019

@siying Sure, It's OK to me.

I submitted a PR #5565 , and if @guyuqi have no objection, it would be good merge it, or just squash it into this patch.

@siying siying closed this Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants