fix: add hardening compiler flags in Debian build#43
Conversation
1. Added DEB_CFLAGS_MAINT_APPEND with -Wall for warning flags 2. Added DEB_CXXFLAGS_MAINT_APPEND with -Wall for C++ warnings 3. Added extensive DEB_LDFLAGS_MAINT_APPEND with security hardening flags: - --as-needed for linker optimization - -z,relro for RELRO protection - -z,now for immediate binding - -z,noexecstack for stack protection - -E for exporting symbols These changes improve security hardening during package build by enabling additional compiler warnings and linker security features recommended for Debian packages. fix: 在 Debian 构建中添加加固编译标志 1. 添加 DEB_CFLAGS_MAINT_APPEND 包含 -Wall 警告标志 2. 添加 DEB_CXXFLAGS_MAINT_APPEND 包含 C++ 警告标志 3. 添加全面的 DEB_LDFLAGS_MAINT_APPEND 安全加固标志: - --as-needed 用于链接器优化 - -z,relro 用于 RELRO 保护 - -z,now 用于立即绑定 - -z,noexecstack 用于栈保护 - -E 用于导出符号 这些更改通过在包构建过程中启用额外的编译器警告和链接器安全功能来提高安全 性,这些是 Debian 包推荐的安全加固措施。
Reviewer's GuideEnhanced Debian package build by appending -Wall to C and C++ compiler flags and introducing multiple security hardening linker flags in debian/rules. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review在审查这段代码时,我注意到以下几点:
综上所述,这段代码的改动是合理的,有助于提高软件的安全性和性能。建议在每行新增的标志之间添加一个空行,以提高代码的可读性。 |
There was a problem hiding this comment.
Hey @mhduiy - I've reviewed your changes - here's some feedback:
- Consider adding -fstack-protector-strong to DEB_CFLAGS_MAINT_APPEND for stronger stack protection.
- Evaluate if the -E linker flag is necessary, as exporting all symbols may increase the attack surface; consider removing it or using --export-dynamic selectively.
- Consider including -z,defs in DEB_LDFLAGS_MAINT_APPEND to catch undefined symbol references at link time.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding -fstack-protector-strong to DEB_CFLAGS_MAINT_APPEND for stronger stack protection.
- Evaluate if the -E linker flag is necessary, as exporting all symbols may increase the attack surface; consider removing it or using --export-dynamic selectively.
- Consider including -z,defs in DEB_LDFLAGS_MAINT_APPEND to catch undefined symbol references at link time.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TAG Bot New tag: 0.1.16 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
These changes improve security hardening during package build by enabling additional compiler warnings and linker security features recommended for Debian packages.
fix: 在 Debian 构建中添加加固编译标志
这些更改通过在包构建过程中启用额外的编译器警告和链接器安全功能来提高安全
性,这些是 Debian 包推荐的安全加固措施。
Summary by Sourcery
Enable Debian build hardening by appending compiler warning and linker security flags
Build: