From 669853e0188e846f762996e8340fba9d196f056d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 22 Oct 2018 13:13:11 +0800 Subject: [PATCH] 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 --- src/compressor/zstd/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compressor/zstd/CMakeLists.txt b/src/compressor/zstd/CMakeLists.txt index c730e48b16d..76709bbb664 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") -- 2.39.5