Skip to content

Commit

Permalink
Disable jemalloc static check when linked dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Laurin committed Feb 11, 2015
1 parent 1d30a29 commit ceaa211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions configure
Expand Up @@ -137,8 +137,10 @@ configure () {
if [[ "$ALLOCATOR" = system ]]; then
var MALLOC_LIBS ""
var MALLOC_LIBS_DEP ""
boolvar STATIC_MALLOC false
else
check_lib "$ALLOCATOR" require
boolvar STATIC_MALLOC contains "$static_libs" "$ALLOCATOR"
macro MALLOC_LIBS "\$($(uc $ALLOCATOR)_LIBS)"
macro MALLOC_LIBS_DEP "\$($(uc $ALLOCATOR)_LIBS_DEP)"
fi
Expand Down Expand Up @@ -801,6 +803,7 @@ fetch_lib () {
macro "$(uc "$1")_LIBS_DEP" "\$(SUPPORT_BUILD_DIR)/${pkg}_$version/lib/lib$1.a"
macro "$(uc "$1")_INCLUDE" "-isystem \$(SUPPORT_BUILD_DIR)/${pkg}_$version/include"
macro "$(uc "$1")_INCLUDE_DEP" "\$(SUPPORT_BUILD_DIR)/${pkg}_$version/include"
static_libs="$static_libs $1"
}

# require_dep <name>
Expand Down
2 changes: 1 addition & 1 deletion src/build.mk
Expand Up @@ -329,7 +329,7 @@ rethinkdb: $(BUILD_DIR)/$(SERVER_EXEC_NAME)
RETHINKDB_DEPENDENCIES_LIBS := $(MALLOC_LIBS_DEP) $(V8_LIBS_DEP) $(PROTOBUF_LIBS_DEP) $(RE2_LIBS_DEP) $(Z_LIBS_DEP) $(CURL_LIBS_DEP) $(CRYPTO_LIBS_DEP)

MAYBE_CHECK_STATIC_MALLOC =
ifeq ($(filter -l%, $(value MALLOC_LIBS)),) # if the allocator is not dynamically linked
ifeq ($(STATIC_MALLOC),1) # if the allocator is statically linked
ifeq (tcmalloc,$(ALLOCATOR))
MAYBE_CHECK_STATIC_MALLOC = objdump -T $@ | c++filt | grep -q 'tcmalloc::\|google_malloc' ||
MAYBE_CHECK_STATIC_MALLOC += (echo "Failed to link in TCMalloc." >&2 && false)
Expand Down

0 comments on commit ceaa211

Please sign in to comment.