Skip to content

Commit acf8ce9

Browse files
committed
fix: update build hardening flags and cmake configuration
1. Removed redundant compiler flags from CMakeLists.txt that are now handled by debian/rules 2. Added security hardening build options in debian/rules including: - Enabling all hardening features - Adding -Wall warning flags for C/C++ - Setting secure linker flags (RELRO, NOW, noexecstack) 3. Cleaned up CMake configuration by removing duplicate flags that are now handled at Debian build level fix: 更新构建加固标志和cmake配置 1. 从CMakeLists.txt中移除了现在由debian/rules处理的冗余编译器标志 2. 在debian/rules中添加了安全加固构建选项包括: - 启用所有加固功能 - 为C/C++添加-Wall警告标志 - 设置安全链接器标志(RELRO, NOW, noexecstack) 3. 通过移除现在由Debian构建层处理的重复标志来清理CMake配置
1 parent daebebf commit acf8ce9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

debian/rules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22

33
include /usr/share/dpkg/default.mk
44

5+
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6+
export DEB_CFLAGS_MAINT_APPEND = -Wall
7+
export DEB_CXXFLAGS_MAINT_APPEND = -Wall
8+
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-E
9+
510
%:
611
dh $@ --buildsystem=cmake

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ find_package(Dtk${DTK_VERSION_MAJOR} REQUIRED COMPONENTS Tools)
77
set(CMAKE_INCLUDE_CURRENT_DIR ON)
88

99
set (CMAKE_CXX_STANDARD 11)
10-
set(CMAKE_CXX_FLAGS "-W -Wall -fPIC -fstack-protector-all -z relro -z noexecstack -z now -pie")
1110

1211
# qdbusxml2cpp-fix
1312
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/dbusinterface/)

0 commit comments

Comments
 (0)