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

Fix Compilation on ppc64le using Clang 11 #7713

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions util/crc32c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ static inline void Slow_CRC32(uint64_t* l, uint8_t const **p) {
table0_[c >> 24];
}

#if defined HAVE_SSE42 && defined NO_THREEWAY_CRC32C
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of builds seem broken, probably from this?

static inline void Fast_CRC32(uint64_t* l, uint8_t const **p) {
#ifndef HAVE_SSE42
Slow_CRC32(l, p);
Expand All @@ -359,6 +360,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) {
Expand Down
6 changes: 3 additions & 3 deletions util/crc32c_ppc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ unsigned int __crc32_vpmsum(unsigned int crc, unsigned char const *p,
unsigned long len);

static uint32_t crc32_vpmsum(uint32_t crc, unsigned char const *data,
unsigned len) {
size_t len) {
unsigned int prealign;
unsigned int tail;

Expand Down Expand Up @@ -67,7 +67,7 @@ static uint32_t crc32_vpmsum(uint32_t crc, unsigned char const *data,
* does not gracefully handle the case where the data pointer is NULL. There
* may be room for performance improvement here.
*/
uint32_t crc32c_ppc(uint32_t crc, unsigned char const *data, unsigned len) {
uint32_t crc32c_ppc(uint32_t crc, unsigned char const *data, size_t len) {
unsigned char *buf2;

if (!data) {
Expand All @@ -87,7 +87,7 @@ uint32_t crc32c_ppc(uint32_t crc, unsigned char const *data, unsigned len) {
* ppc systems using power7 or below) in order to compile properly
* there, even though it won't be called.
*/
uint32_t crc32c_ppc(uint32_t crc, unsigned char const *data, unsigned len) {
uint32_t crc32c_ppc(uint32_t crc, unsigned char const *data, size_t len) {
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion util/crc32c_ppc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
#endif

extern uint32_t crc32c_ppc(uint32_t crc, unsigned char const *buffer,
unsigned len);
size_t len);

#ifdef __cplusplus
}
Expand Down
4 changes: 4 additions & 0 deletions util/crc32c_ppc_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).

#if defined (__clang__)
#include "ppc-asm.h"
#else
#include <ppc-asm.h>
#endif
#include "ppc-opcode.h"

#undef toc
Expand Down
Loading