From ae16eaa13f923c49751a0bd2c63093a6c97ce724 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 19 Sep 2023 08:56:34 +0300 Subject: [PATCH] fix: remove -fPIE from generic CXXFLAGS They are not applicable for shared libraries and breaks building. Please use --enable-default-pie for gcc instead of inserting PIE flags to every package. ``` relocation R_X86_64_PC32 against symbol `_ZN26ComDeepinAnythingInterface16staticMetaObjectE' can not be used when making a shared object; recompile with -fPIC ``` --- src/grand-search-daemon/CMakeLists.txt | 1 - src/grand-search/CMakeLists.txt | 1 - src/libgrand-search-daemon/CMakeLists.txt | 1 - tests/grand-search-dock-plugin/CMakeLists.txt | 2 +- tests/grand-search/CMakeLists.txt | 2 +- tests/libgrand-search-daemon/CMakeLists.txt | 2 +- tests/preview-plugin/CMakeLists.txt | 2 +- 7 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/grand-search-daemon/CMakeLists.txt b/src/grand-search-daemon/CMakeLists.txt index e21155a0..56bd64cd 100644 --- a/src/grand-search-daemon/CMakeLists.txt +++ b/src/grand-search-daemon/CMakeLists.txt @@ -5,7 +5,6 @@ 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(BIN_NAME ${DAEMON_BIN_NAME}) diff --git a/src/grand-search/CMakeLists.txt b/src/grand-search/CMakeLists.txt index 392e36ae..f50913bd 100644 --- a/src/grand-search/CMakeLists.txt +++ b/src/grand-search/CMakeLists.txt @@ -5,7 +5,6 @@ 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(BIN_NAME ${SEARCH_BIN_NAME}) diff --git a/src/libgrand-search-daemon/CMakeLists.txt b/src/libgrand-search-daemon/CMakeLists.txt index 05c74e18..3c0aa2ff 100644 --- a/src/libgrand-search-daemon/CMakeLists.txt +++ b/src/libgrand-search-daemon/CMakeLists.txt @@ -5,7 +5,6 @@ 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(LIB_NAME ${DAEMON_LIB_NAME}) diff --git a/tests/grand-search-dock-plugin/CMakeLists.txt b/tests/grand-search-dock-plugin/CMakeLists.txt index c8802015..a885e0a4 100644 --- a/tests/grand-search-dock-plugin/CMakeLists.txt +++ b/tests/grand-search-dock-plugin/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} -g -Wall -Wl,--as-need -fPIE") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wl,--as-need") # 定义可执行程序名称 set(BIN_NAME test-dde-grand-search-dock-plugin) diff --git a/tests/grand-search/CMakeLists.txt b/tests/grand-search/CMakeLists.txt index 55756391..37cfd4ca 100644 --- a/tests/grand-search/CMakeLists.txt +++ b/tests/grand-search/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} -g -Wall -Wl,--as-need -fPIE") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wl,--as-need") # 定义可执行程序名称 set(BIN_NAME test-dde-grand-search) diff --git a/tests/libgrand-search-daemon/CMakeLists.txt b/tests/libgrand-search-daemon/CMakeLists.txt index 8d7d25b4..3d01105d 100644 --- a/tests/libgrand-search-daemon/CMakeLists.txt +++ b/tests/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} -g -Wall -Wl,--as-need -fPIE") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wl,--as-need") # 应用库目录 set(LIB_BASE_DIR "${LIB_PLATFORM_DIR}/${BIN_NAME}") diff --git a/tests/preview-plugin/CMakeLists.txt b/tests/preview-plugin/CMakeLists.txt index 4011e10d..733ae0c2 100644 --- a/tests/preview-plugin/CMakeLists.txt +++ b/tests/preview-plugin/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} -g -Wall -Wl,--as-need -fPIE") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wl,--as-need") # 定义可执行程序名称 set(BIN_NAME test-preview-plugin)