Skip to content

Conversation

@mhduiy
Copy link
Contributor

@mhduiy mhduiy commented Jul 2, 2025

  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配置

Summary by Sourcery

Consolidate security and warning flags into debian/rules for build hardening and clean up redundant CMake settings

Enhancements:

  • Enable comprehensive security hardening and warning flags in the Debian build configuration

Build:

  • Remove redundant compiler flags from CMakeLists.txt now managed by debian/rules
  • Add secure linker flags (RELRO, NOW, noexecstack) and -Wall warnings to debian/rules

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配置
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mhduiy - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • debian/rules文件中新增的编译选项可能会影响构建过程,需要确认这些选项是否适用于所有目标平台。
  • CMakeLists.txt文件中移除了-fstack-protector-all选项,这可能会降低程序的安全性,需要评估是否确实需要移除。

是否建议立即修改:

  • 是,需要确保新增的编译选项不会导致构建失败或影响程序的安全性。如果移除-fstack-protector-all选项是有意为之,应确保程序的安全性不会因此受到影响。

@sourcery-ai
Copy link

sourcery-ai bot commented Jul 2, 2025

Reviewer's Guide

This PR consolidates security hardening and warning flags into the Debian build layer by removing redundant flags from CMakeLists.txt and introducing comprehensive build-hardening and warning options in debian/rules.

File-Level Changes

Change Details Files
Remove redundant compiler and linker flags from CMakeLists.txt
  • Delete CMAKE_CXX_FLAGS line
  • Strip out -W, -Wall, -fPIC, -fstack-protector-all, -z relro, -z noexecstack, -z now and -pie flags
src/CMakeLists.txt
Add comprehensive security hardening and warning flags in debian/rules
  • Enable all available hardening features
  • Add -Wall warning flags for C/C++
  • Set RELRO, NOW and noexecstack linker flags
debian/rules

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mhduiy mhduiy merged commit acf8ce9 into linuxdeepin:master Jul 3, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants