Skip to content
Permalink
Browse files

Post-merge build fixes

- Don't add DZSTD_STATIC_LINKING_ONLY
- Don't use upstream's way of linking with Jemalloc (MyRocks/MariaDB has
  its own in build_rocksdb.cmake)
- Don't depend on libunwind
  • Loading branch information...
spetrunia committed Jun 16, 2019
1 parent 15087b4 commit a0251c7d755cadd749d3e19975b247fe50bcf8db
Showing with 23 additions and 18 deletions.
  1. +21 −18 storage/rocksdb/CMakeLists.txt
  2. +2 −0 storage/rocksdb/build_rocksdb.cmake
@@ -162,23 +162,25 @@ if (UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
endif()

IF (WITH_JEMALLOC)
FIND_LIBRARY(JEMALLOC_LIBRARY
NAMES libjemalloc${PIC_EXT}.a jemalloc
HINTS ${WITH_JEMALLOC}/lib)
SET(rocksdb_static_libs ${rocksdb_static_libs}
${JEMALLOC_LIBRARY})
ADD_DEFINITIONS(-DROCKSDB_JEMALLOC)
ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
ENDIF()

IF (WITH_UNWIND)
FIND_LIBRARY(UNWIND_LIBRARY
NAMES libunwind${PIC_EXT}.a unwind
HINTS ${WITH_UNWIND}/lib)
SET(rocksdb_static_libs ${rocksdb_static_libs}
${UNWIND_LIBRARY})
ENDIF()
# IF (WITH_JEMALLOC)
# FIND_LIBRARY(JEMALLOC_LIBRARY
# NAMES libjemalloc${PIC_EXT}.a jemalloc
# HINTS ${WITH_JEMALLOC}/lib)
# SET(rocksdb_static_libs ${rocksdb_static_libs}
# ${JEMALLOC_LIBRARY})
# ADD_DEFINITIONS(-DROCKSDB_JEMALLOC)
# ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
# ENDIF()

# MariaDB: Q: why does the upstream add libunwind for a particular
# storage engine?
#IF (WITH_UNWIND)
# FIND_LIBRARY(UNWIND_LIBRARY
# NAMES libunwind${PIC_EXT}.a unwind
# HINTS ${WITH_UNWIND}/lib)
# SET(rocksdb_static_libs ${rocksdb_static_libs}
# ${UNWIND_LIBRARY})
#ENDIF()


TARGET_LINK_LIBRARIES(rocksdb rocksdb_aux_lib)
@@ -209,7 +211,8 @@ ENDIF()
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
IF(HAVE_SCHED_GETCPU)
ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU=1)
ADD_DEFINITIONS(-DZSTD_STATIC_LINKING_ONLY)
# MariaDB: don't do this:
# ADD_DEFINITIONS(-DZSTD_STATIC_LINKING_ONLY)
ENDIF()

IF (WITH_TBB)
@@ -21,11 +21,13 @@ else()
if(WITH_ROCKSDB_JEMALLOC)
find_package(JeMalloc REQUIRED)
add_definitions(-DROCKSDB_JEMALLOC)
ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
include_directories(${JEMALLOC_INCLUDE_DIR})
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# FreeBSD has jemaloc as default malloc
add_definitions(-DROCKSDB_JEMALLOC)
ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
set(WITH_JEMALLOC ON)
endif()
endif()

0 comments on commit a0251c7

Please sign in to comment.
You can’t perform that action at this time.