From c3d3c82f3a1751f063a3e77b4bde47f1802a517e Mon Sep 17 00:00:00 2001 From: John Sully Date: Fri, 27 Mar 2020 12:46:25 -0400 Subject: [PATCH] Raspberry Pi fixes (compile and replication) --- src/Makefile | 6 +++++- src/replication.cpp | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 9ab3a8a72..91677a6dd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -82,6 +82,10 @@ ifneq (,$(findstring armv,$(uname_M))) endif endif +ifneq (,$(findstring armv,$(uname_M))) + FINAL_LIBS+=-latomic +endif + # Backwards compatibility for selecting an allocator ifeq ($(USE_TCMALLOC),yes) MALLOC=tcmalloc @@ -105,7 +109,7 @@ endif FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) FINAL_CXXFLAGS=$(CXX_STD) $(WARN) $(OPT) $(DEBUG) $(CXXFLAGS) $(REDIS_CFLAGS) FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG) -FINAL_LIBS=-lm -lcurl +FINAL_LIBS+=-lm -lcurl DEBUG=-g -ggdb ifeq ($(uname_S),SunOS) diff --git a/src/replication.cpp b/src/replication.cpp index 6f38ee0bc..dcd6a915b 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -357,8 +357,8 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) { char szMvcc[128]; incrementMvccTstamp(); uint64_t mvccTstamp = getMvccTstamp(); - int cchMvccNum = snprintf(szMvcc, sizeof(szMvcc), "%lu", mvccTstamp); - int cchMvcc = snprintf(szMvcc, sizeof(szMvcc), "$%d\r\n%lu\r\n", cchMvccNum, mvccTstamp); + int cchMvccNum = snprintf(szMvcc, sizeof(szMvcc), "%" PRIu64, mvccTstamp); + int cchMvcc = snprintf(szMvcc, sizeof(szMvcc), "$%d\r\n%" PRIu64 "\r\n", cchMvccNum, mvccTstamp); cchMvcc = std::min(cchMvcc, sizeof(szMvcc)); // tricky snprintf /* Write the command to the replication backlog if any. */