Fix build of db_stress with LIB_MODE=shared (#7098)

Summary:
by tracking and linking against runtime dependent libraries in
Makefile

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7098

Test Plan: look for fix in CircleCI

Reviewed By: riversand963

Differential Revision: D22420860

Pulled By: pdillinger

fbshipit-source-id: d211d709214bf5306db68e43b7a2f18169281022
This commit is contained in:
Peter Dillinger 2020-07-07 16:47:20 -07:00 committed by Facebook GitHub Bot
parent dbf5c55812
commit 787bf79fa0

View File

@ -636,12 +636,18 @@ LIBRARY=$(SHARED1)
TEST_LIBRARY=$(SHARED_TEST_LIBRARY) TEST_LIBRARY=$(SHARED_TEST_LIBRARY)
TOOLS_LIBRARY=$(SHARED_TOOLS_LIBRARY) TOOLS_LIBRARY=$(SHARED_TOOLS_LIBRARY)
STRESS_LIBRARY=$(SHARED_STRESS_LIBRARY) STRESS_LIBRARY=$(SHARED_STRESS_LIBRARY)
ifeq ($(DEBUG_LEVEL),0)
STRESS_LIBRARY_RUNTIME_DEPS=$(SHARED_TOOLS_LIBRARY)
else
STRESS_LIBRARY_RUNTIME_DEPS=$(SHARED_TEST_LIBRARY) $(SHARED_TOOLS_LIBRARY)
endif
CLOUD_LIBRARY=$(SHARED_CLOUD_LIBRARY) CLOUD_LIBRARY=$(SHARED_CLOUD_LIBRARY)
else else
LIBRARY=$(STATIC_LIBRARY) LIBRARY=$(STATIC_LIBRARY)
TEST_LIBRARY=$(STATIC_TEST_LIBRARY) TEST_LIBRARY=$(STATIC_TEST_LIBRARY)
TOOLS_LIBRARY=$(STATIC_TOOLS_LIBRARY) TOOLS_LIBRARY=$(STATIC_TOOLS_LIBRARY)
STRESS_LIBRARY=$(STATIC_STRESS_LIBRARY) STRESS_LIBRARY=$(STATIC_STRESS_LIBRARY)
STRESS_LIBRARY_RUNTIME_DEPS=
endif endif
ROCKSDB_MAJOR = $(shell egrep "ROCKSDB_MAJOR.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) ROCKSDB_MAJOR = $(shell egrep "ROCKSDB_MAJOR.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3)
@ -1182,15 +1188,9 @@ $(SHARED_TOOLS_LIBRARY): $(TOOL_OBJECTS) $(TESTUTIL) $(SHARED1)
$(AM_V_AR)rm -f $@ $(STATIC_TOOLS_LIBRARY) $(AM_V_AR)rm -f $@ $(STATIC_TOOLS_LIBRARY)
$(AM_SHARE) $(AM_SHARE)
ifeq ($(DEBUG_LEVEL),0) $(SHARED_STRESS_LIBRARY): $(ANALYZE_OBJECTS) $(STRESS_OBJECTS) $(STRESS_LIBRARY_RUNTIME_DEPS) $(SHARED1)
$(SHARED_STRESS_LIBRARY): $(ANALYZE_OBJECTS) $(STRESS_OBJECTS) $(SHARED_TOOLS_LIBRARY) $(SHARED1)
$(AM_V_AR)rm -f $@ $(STATIC_STRESS_LIBRARY) $(AM_V_AR)rm -f $@ $(STATIC_STRESS_LIBRARY)
$(AM_SHARE) $(AM_SHARE)
else
$(SHARED_STRESS_LIBRARY): $(ANALYZE_OBJECTS) $(STRESS_OBJECTS) $(SHARED_TOOLS_LIBRARY) $(TEST_LIBRARY) $(SHARED1)
$(AM_V_AR)rm -f $@ $(STATIC_STRESS_LIBRARY)
$(AM_SHARE)
endif
librocksdb_env_basic_test.a: $(OBJ_DIR)/env/env_basic_test.o $(LIB_OBJECTS) $(TESTHARNESS) librocksdb_env_basic_test.a: $(OBJ_DIR)/env/env_basic_test.o $(LIB_OBJECTS) $(TESTHARNESS)
$(AM_V_AR)rm -f $@ $(AM_V_AR)rm -f $@
@ -1222,7 +1222,7 @@ memtablerep_bench: $(OBJ_DIR)/memtable/memtablerep_bench.o $(TESTUTIL) $(LIBRARY
filter_bench: $(OBJ_DIR)/util/filter_bench.o $(LIBRARY) filter_bench: $(OBJ_DIR)/util/filter_bench.o $(LIBRARY)
$(AM_LINK) $(AM_LINK)
db_stress: $(OBJ_DIR)/db_stress_tool/db_stress.o $(STRESS_LIBRARY) $(LIBRARY) db_stress: $(OBJ_DIR)/db_stress_tool/db_stress.o $(STRESS_LIBRARY) $(STRESS_LIBRARY_RUNTIME_DEPS) $(LIBRARY)
$(AM_LINK) $(AM_LINK)
write_stress: $(OBJ_DIR)/tools/write_stress.o $(LIBRARY) write_stress: $(OBJ_DIR)/tools/write_stress.o $(LIBRARY)