From 5f6321cb6b477f1f2c2448b7751546dc3189b73d Mon Sep 17 00:00:00 2001 From: "Marc A. Paradise" Date: Fri, 23 Aug 2024 16:25:12 -0400 Subject: [PATCH] remove libatomic dependency for keydb This is not easily available for platforms because it was only made separately installable in later versions of GCC than we're using. Since keydb will work without this (it does not use it on darwin), we're attempting to exclude the dependency entirely to work around this issue. Signed-off-by: Marc A. Paradise --- config/patches/keydb/remove-libatomic-dep | 55 +++++++++++++++++++++++ config/software/keydb.rb | 1 + 2 files changed, 56 insertions(+) create mode 100644 config/patches/keydb/remove-libatomic-dep diff --git a/config/patches/keydb/remove-libatomic-dep b/config/patches/keydb/remove-libatomic-dep new file mode 100644 index 000000000..9263d59e2 --- /dev/null +++ b/config/patches/keydb/remove-libatomic-dep @@ -0,0 +1,55 @@ +--- KeyDB-6.3.4-original/src/Makefile 2024-08-23 16:20:47.182590590 -0400 ++++ KeyDB-6.3.4/src/Makefile 2024-08-23 16:21:13.045995002 -0400 +@@ -25,7 +25,7 @@ + + # Default settings + STD=-pedantic -DREDIS_STATIC='' +-CXX_STD=-std=c++17 -pedantic -fno-rtti -D__STDC_FORMAT_MACROS ++CXX_STD=-std=c++17 -pedantic -fno-rtti -D__STDC_FORMAT_MACROS + ifneq (,$(findstring clang,$(CC))) + STD+=-Wno-c11-extensions + else +@@ -76,7 +76,7 @@ + FINAL_LIBS+= -lz -lcrypto -lbz2 -lzstd -llz4 -lsnappy + CXXFLAGS+= -I../deps/rocksdb/include/ -DENABLE_ROCKSDB + STORAGE_OBJ+= storage/rocksdb.o storage/rocksdbfactory.o +- FINAL_LIBS+= ../deps/rocksdb/librocksdb.a ++ FINAL_LIBS+= ../deps/rocksdb/librocksdb.a + DEPENDENCY_TARGETS+= rocksdb + endif + +@@ -99,7 +99,7 @@ + endif + + ifeq ($(COMPILER_NAME),clang) +- CXXFLAGS+= -stdlib=libc++ ++ CXXFLAGS+= -stdlib=libc++ + endif + + # To get ARM stack traces if KeyDB crashes we need a special C flag. +@@ -133,7 +133,7 @@ + + ifeq ($(NO_LICENSE_CHECK),yes) + CXXFLAGS+=-DNO_LICENSE_CHECK=1 +-endif ++endif + + # Override default settings if possible + -include .make-settings +@@ -144,16 +144,6 @@ + FINAL_LDFLAGS=$(LDFLAGS) $(KEYDB_LDFLAGS) $(DEBUG) + FINAL_LIBS+=-lm -lz -lcrypto + +-ifneq ($(uname_S),Darwin) +- ifneq ($(uname_S),FreeBSD) +- FINAL_LIBS+=-latomic +- endif +-endif +-# Linux ARM32 needs -latomic at linking time +-ifneq (,$(findstring armv,$(uname_M))) +- FINAL_LIBS+=-latomic +-endif +- + + ifeq ($(uname_S),SunOS) + # SunOS diff --git a/config/software/keydb.rb b/config/software/keydb.rb index 5788c46c8..84682870c 100644 --- a/config/software/keydb.rb +++ b/config/software/keydb.rb @@ -43,6 +43,7 @@ env["CFLAGS"] << " -I#{install_dir}/embedded/include" env["LDFLAGS"] << " -L#{install_dir}/embedded/lib" + patch source: "remove-libatomic-dep", env: env if suse? env["CFLAGS"] << " -fno-lto" env["CXXFLAGS"] << " -fno-lto"