From b09a6b6a5d7c7c2de81325b3c1ab687536059009 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 18 May 2016 17:48:06 +0200 Subject: [PATCH] Fix modules compilation when libc malloc is used. Compiling Redis worked as a side effect of jemalloc target specifying -ldl as needed linker options, otherwise it is not provided during linking and dlopen() API will remain unresolved symbols. --- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index c390d3f2e..d73f381bf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -55,7 +55,7 @@ endif FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -I../deps/geohash-int FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG) -FINAL_LIBS=-lm +FINAL_LIBS=-lm -ldl DEBUG=-g -ggdb ifeq ($(uname_S),SunOS) @@ -95,7 +95,7 @@ endif ifeq ($(MALLOC),jemalloc) DEPENDENCY_TARGETS+= jemalloc FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include - FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a -ldl + FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a endif REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)