From 8e6ff044e138471b94437bb3d9cac2a7f0c8ec73 Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Wed, 1 Jul 2020 10:29:39 -0700 Subject: [PATCH] Fix release build and fbcode+clang+shared (#7062) Summary: Follow-up to https://github.com/facebook/rocksdb/issues/6660. Release build had linker error. fbcode+clang+shared build was erroring on unused parameter '-nostdinc'. Fixes https://github.com/facebook/rocksdb/issues/7061 Pull Request resolved: https://github.com/facebook/rocksdb/pull/7062 Test Plan: make release, USE_CLANG=1 LIB_MODE=shared make check, etc. Reviewed By: siying Differential Revision: D22335663 Pulled By: pdillinger fbshipit-source-id: 261cd959ca1f6c273dc763a70020a535ba8e81de --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b58b64e2b6..a19d2ff964 100644 --- a/Makefile +++ b/Makefile @@ -231,8 +231,8 @@ LIB_SOURCES += utilities/env_librados.cc LDFLAGS += -lrados endif -AM_LINK = $(AM_V_CCLD)$(CXX) $(patsubst lib%.a, -l%, $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^)) $(EXEC_LDFLAGS) -o $@ -L. $(LDFLAGS) $(COVERAGEFLAGS) -AM_SHARE = $(AM_V_CCLD) $(CXX) $(PLATFORM_SHARED_LDFLAGS)$@ $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) -L. $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^) $(LDFLAGS) -o $@ +AM_LINK = $(AM_V_CCLD)$(CXX) -L. $(patsubst lib%.a, -l%, $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^)) $(EXEC_LDFLAGS) -o $@ $(LDFLAGS) $(COVERAGEFLAGS) +AM_SHARE = $(AM_V_CCLD) $(CXX) $(PLATFORM_SHARED_LDFLAGS)$@ -L. $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^) $(LDFLAGS) -o $@ # Detect what platform we're building on. # Export some common variables that might have been passed as Make variables @@ -616,7 +616,7 @@ ALL_STATIC_LIBS = $(STATIC_LIBRARY) $(STATIC_TEST_LIBRARY) $(STATIC_TOOLS_LIBRAR SHARED_TEST_LIBRARY = ${LIBNAME}_test$(LIBDEBUG).$(PLATFORM_SHARED_EXT) SHARED_TOOLS_LIBRARY = ${LIBNAME}_tools$(LIBDEBUG).$(PLATFORM_SHARED_EXT) SHARED_STRESS_LIBRARY = ${LIBNAME}_stress$(LIBDEBUG).$(PLATFORM_SHARED_EXT) - + ALL_SHARED_LIBS = $(SHARED1) $(SHARED2) $(SHARED3) $(SHARED4) $(SHARED_TEST_LIBRARY) $(SHARED_TOOLS_LIBRARY) $(SHARED_STRESS_LIBRARY) ifeq ($(LIB_MODE),shared) @@ -674,7 +674,7 @@ $(SHARED3): $(SHARED4) endif # PLATFORM_SHARED_VERSIONED $(SHARED4): $(LIB_OBJECTS) - $(AM_V_CCLD) $(CXX) $(PLATFORM_SHARED_LDFLAGS)$(SHARED3) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(LIB_OBJECTS) $(LDFLAGS) -o $@ + $(AM_V_CCLD) $(CXX) $(PLATFORM_SHARED_LDFLAGS)$(SHARED3) $(LIB_OBJECTS) $(LDFLAGS) -o $@ endif # PLATFORM_SHARED_EXT .PHONY: blackbox_crash_test check clean coverage crash_test ldb_tests package \ @@ -1211,7 +1211,7 @@ filter_bench: $(OBJ_DIR)/util/filter_bench.o $(LIBRARY) $(AM_LINK) ifeq ($(DEBUG_LEVEL),0) -db_stress: $(OBJ_DIR)/db_stress_tool/db_stress.o $(STRESS_OBJECTS) $(LIBRARY) +db_stress: $(OBJ_DIR)/db_stress_tool/db_stress.o $(STRESS_OBJECTS) $(TESTUTIL) $(LIBRARY) $(AM_LINK) else db_stress: $(OBJ_DIR)/db_stress_tool/db_stress.o $(STRESS_OBJECTS) $(TEST_LIBRARY) $(LIBRARY)