From a480003e46cc2d78f5d4d23b53f87b243b449838 Mon Sep 17 00:00:00 2001 From: Hillwood Yang Date: Sun, 19 Nov 2023 16:29:04 +0800 Subject: [PATCH] fix: recompile with fPIC for libgrand-search-daemon Fix build on 64bit arch Log: The compiler may report an error and exit, the error is like this: /usr/lib64/gcc/aarch64-suse-linux/13/../../../../aarch64-suse-linux/bin/ld: /tmp/ccNUyrNk.ltrans0.ltrans.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `db_list_insert_node' which may bind externally can not be used when making a shared object; recompile with -fPIC --- src/libgrand-search-daemon/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libgrand-search-daemon/CMakeLists.txt b/src/libgrand-search-daemon/CMakeLists.txt index 05c74e18..fcc73639 100644 --- a/src/libgrand-search-daemon/CMakeLists.txt +++ b/src/libgrand-search-daemon/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 14) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE -pie") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE -pie -fPIC") # 设置库名 set(LIB_NAME ${DAEMON_LIB_NAME})