Skip to content

Commit

Permalink
fix: remove -fPIE from generic CXXFLAGS
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
felixonmars committed Sep 19, 2023
1 parent f66f34a commit ae16eaa
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/grand-search-daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
1 change: 0 additions & 1 deletion src/grand-search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
1 change: 0 additions & 1 deletion src/libgrand-search-daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion tests/grand-search-dock-plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/grand-search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/libgrand-search-daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion tests/preview-plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae16eaa

Please sign in to comment.