Skip to content

Commit

Permalink
remove libatomic dependency for keydb
Browse files Browse the repository at this point in the history
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 <marc.paradise@progress.com>
  • Loading branch information
marcparadise committed Aug 23, 2024
1 parent cd0dbdf commit 5f6321c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
55 changes: 55 additions & 0 deletions config/patches/keydb/remove-libatomic-dep
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions config/software/keydb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5f6321c

Please sign in to comment.