From: Kefu Chai Date: Mon, 22 Oct 2018 05:13:11 +0000 (+0800) Subject: cmake: should compile libzstd with -fPIC X-Git-Tag: v14.1.0~1119^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=669853e0188e846f762996e8340fba9d196f056d;p=ceph.git cmake: should compile libzstd with -fPIC otherwise we will have /usr/bin/ld: libzstd/lib/libzstd.a(error_private.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC Signed-off-by: Kefu Chai --- diff --git a/src/compressor/zstd/CMakeLists.txt b/src/compressor/zstd/CMakeLists.txt index c730e48b16d6..76709bbb6646 100644 --- a/src/compressor/zstd/CMakeLists.txt +++ b/src/compressor/zstd/CMakeLists.txt @@ -10,6 +10,7 @@ ExternalProject_Add(zstd_ext -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_FLAGS=${ZSTD_C_FLAGS} -DCMAKE_AR=${CMAKE_AR} + -DCMAKE_POSITION_INDEPENDENT_CODE=${ENABLE_SHARED} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzstd BUILD_COMMAND $(MAKE) libzstd_static INSTALL_COMMAND "true")