Skip to content

Commit

Permalink
Merge PR ceph#23432 into master
Browse files Browse the repository at this point in the history
* refs/pull/23432/head:
	Revert "rocksdb: pickup change to link against libsnappy.a"
	cmake,make-dist: revert "build gperftools if WITH_STATIC_LIBSTDCXX"
	cmake: cleanup snappy related script
	debian: strip "-Wl,-Bsymbolic-functions" from LDFLAGS
  • Loading branch information
liewegas committed Aug 7, 2018
2 parents 61615e0 + 01f18ef commit 3988351
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 87 deletions.
12 changes: 3 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,7 @@ endif(WITH_LZ4)
#if allocator is set on command line make sure it matches below strings
if(ALLOCATOR)
if(${ALLOCATOR} MATCHES "tcmalloc(_minimal)?")
if(GPERFTOOLS_USE_STATIC_LIBS)
include(Buildgperftools)
else()
find_package(gperftools REQUIRED)
endif()
find_package(gperftools REQUIRED)
set(HAVE_LIBTCMALLOC ON)
elseif(${ALLOCATOR} STREQUAL "jemalloc")
find_package(JeMalloc REQUIRED)
Expand All @@ -329,10 +325,8 @@ if(ALLOCATOR)
message(FATAL_ERROR "Unsupported allocator selected: ${ALLOCATOR}")
endif()
else(ALLOCATOR)
if(NOT GPERFTOOLS_USE_STATIC_LIBS)
find_package(gperftools)
set(HAVE_LIBTCMALLOC ${gperftools_FOUND})
endif()
find_package(gperftools)
set(HAVE_LIBTCMALLOC ${gperftools_FOUND})
if(NOT gperftools_FOUND)
find_package(JeMalloc)
endif()
Expand Down
42 changes: 0 additions & 42 deletions cmake/modules/Buildgperftools.cmake

This file was deleted.

15 changes: 12 additions & 3 deletions cmake/modules/Findsnappy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# SNAPPY_LIBRARIES - List of libraries when using snappy.
# SNAPPY_FOUND - True if snappy found.

find_package(PkgConfig)
find_package(PkgConfig QUIET REQUIRED)
pkg_search_module(PC_snappy
QUIET snappy)
snappy QUIET)

find_path(SNAPPY_INCLUDE_DIR
NAMES snappy.h
Expand All @@ -22,8 +22,17 @@ find_library(SNAPPY_LIBRARIES
${SNAPPY_ROOT_DIR}/lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(snappy DEFAULT_MSG SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)
find_package_handle_standard_args(snappy
DEFAULT_MSG SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)

mark_as_advanced(
SNAPPY_LIBRARIES
SNAPPY_INCLUDE_DIR)

if(snappy_FOUND AND NOT (TARGET snappy::snappy))
add_library(snappy::snappy UNKNOWN IMPORTED)
set_target_properties(snappy::snappy PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SNAPPY_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${SNAPPY_LIBRARIES}")
endif()
7 changes: 7 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ export DH_VERBOSE=1
export DESTDIR=$(CURDIR)/debian/tmp

export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
ifneq (,$(findstring WITH_STATIC_LIBSTDCXX,$(CEPH_EXTRA_CMAKE_ARGS)))
# dh_auto_build sets LDFLAGS with `dpkg-buildflags --get LDFLAGS` on ubuntu,
# which makes the application aborts when the shared library throws
# exception, so strip this linker option,
# see http://tracker.ceph.com/issues/25209
export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
endif

extraopts += -DWITH_OCF=ON -DWITH_LTTNG=ON -DWITH_PYTHON3=ON -DWITH_MGR_DASHBOARD_FRONTEND=OFF
extraopts += -DWITH_CEPHFS_JAVA=ON
Expand Down
24 changes: 0 additions & 24 deletions make-dist
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,6 @@ download_boost() {
rm -rf src/boost
}

download_gperftools() {
version=$1
shift
sha256=$1
shift
dname=gperftools-$version
fname=$dname.tar.gz
url=https://github.com/gperftools/gperftools/releases/download/$dname/$fname

if ! wget -c --no-verbose -O $fname $url; then
echo "Download of $url failed"
exit 1
elif [ $(sha256sum $fname | awk '{print $1}') != $sha256 ]; then
echo "Error: failed to download gperftools: SHA256 mismatch."
exit 1
fi
tar xzf $fname -C src
mv src/$dname src/gperftools
tar cf ${outfile}.gperftools.tar ${outfile}/src/gperftools
rm -rf src/gperftools
}

_python_autoselect() {
python_command=
for interpreter in python2.7 python3 ; do
Expand Down Expand Up @@ -158,11 +136,9 @@ download_boost $boost_version 2684c972994ee57fc5632e03bf044746f6eb45d4920c343937
https://dl.bintray.com/boostorg/release/$boost_version/source \
https://downloads.sourceforge.net/project/boost/boost/$boost_version \
https://download.ceph.com/qa
download_gperftools 2.7 1ee8c8699a0eff6b6a203e59b43330536b22bbcbe6448f54c7091e5efb0763c9
build_dashboard_frontend
tar --concatenate -f $outfile.all.tar $outfile.version.tar
tar --concatenate -f $outfile.all.tar $outfile.boost.tar
tar --concatenate -f $outfile.all.tar $outfile.gperftools.tar
tar --concatenate -f $outfile.all.tar $outfile.tar
tar --concatenate -f $outfile.all.tar dashboard_frontend.tar
mv $outfile.all.tar $outfile.tar
Expand Down
2 changes: 1 addition & 1 deletion src/compressor/snappy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(snappy_sources
add_library(ceph_snappy SHARED ${snappy_sources})
target_include_directories(ceph_snappy SYSTEM PRIVATE
"${SNAPPY_INCLUDE_DIR}")
target_link_libraries(ceph_snappy ${SNAPPY_LIBRARIES})
target_link_libraries(ceph_snappy snappy::snappy)
set_target_properties(ceph_snappy PROPERTIES
VERSION 2.0.0
SOVERSION 2
Expand Down
8 changes: 1 addition & 7 deletions src/perfglue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ endif()
option(WITH_PROFILER "build extra profiler binaries" OFF)

if(WITH_PROFILER)
if(GPERFTOOLS_USE_STATIC_LIBS)
if(NOT TARGET gperftools::profiler)
include(Buildgperftools)
endif()
else()
find_package(gperftools REQUIRED profiler)
endif()
find_package(gperftools REQUIRED profiler)
add_library(cpu_profiler STATIC
cpu_profiler.cc)
target_link_libraries(cpu_profiler
Expand Down
2 changes: 1 addition & 1 deletion src/rocksdb

0 comments on commit 3988351

Please sign in to comment.