From c66483c132bd52bc1f22f6a91843476fd375043c Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Tue, 7 Apr 2015 13:22:22 -0700 Subject: [PATCH] Fix github issue #563 Summary: As described in https://github.com/facebook/rocksdb/issues/563, we should add minor version to SONAME, since we break ABI with minor releases. I also turned PLATFORM_SHARED_VERSIONED to true by default. This is true in LevelDB and it was switched to false by D15117 for no apparent reason. It should only be false for iOS. Test Plan: `make shared_lib` produced librocksdb.dylib.3.10.0 Reviewers: sdong, yhchiang, meyering Reviewed By: meyering Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D36573 --- Makefile | 6 +++--- build_tools/build_detect_platform | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index efb97fa6d..f5e786ecb 100644 --- a/Makefile +++ b/Makefile @@ -141,8 +141,8 @@ install: for header in `find "include/rocksdb" -type f -name *.h`; do \ install -C -m 644 $$header $(INSTALL_PATH)/$$header; \ done - [ ! -e $(LIBRARY) ] || install -C -m 644 $(LIBRARY) $(INSTALL_PATH)/lib - [ ! -e $(SHARED) ] || install -C -m 644 $(SHARED) $(INSTALL_PATH)/lib + [ ! -e $(LIBRARY) ] || install -C -m 755 $(LIBRARY) $(INSTALL_PATH)/lib + [ -n '$(SHARED)' ] && install -C -m 755 $(SHARED) $(INSTALL_PATH)/lib #------------------------------------------------- WARNING_FLAGS = -W -Wextra -Wall -Wsign-compare -Wshadow \ @@ -319,7 +319,7 @@ $(SHARED3): $(SHARED4) endif $(SHARED4): - $(CXX) $(PLATFORM_SHARED_LDFLAGS)$(SHARED2) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(LIB_SOURCES) $(LDFLAGS) -o $@ + $(CXX) $(PLATFORM_SHARED_LDFLAGS)$(SHARED3) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(LIB_SOURCES) $(LDFLAGS) -o $@ endif # PLATFORM_SHARED_EXT diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform index 9052e77bb..f866beacb 100755 --- a/build_tools/build_detect_platform +++ b/build_tools/build_detect_platform @@ -95,7 +95,7 @@ PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS" PLATFORM_SHARED_EXT="so" PLATFORM_SHARED_LDFLAGS="-shared -Wl,-soname -Wl," PLATFORM_SHARED_CFLAGS="-fPIC" -PLATFORM_SHARED_VERSIONED=false +PLATFORM_SHARED_VERSIONED=true # generic port files (working on all platform by #ifdef) go directly in /port GENERIC_PORT_FILES=`cd "$ROCKSDB_ROOT"; find port -name '*.cc' | tr "\n" " "` @@ -115,6 +115,7 @@ case "$TARGET_OS" in PLATFORM_SHARED_EXT=dylib PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name " CROSS_COMPILE=true + PLATFORM_SHARED_VERSIONED= ;; Linux) PLATFORM=OS_LINUX