chore: Update CMake configuration for improved security and threading…#146
Conversation
… support - Added required Threads package to CMakeLists.txt - Enhanced compiler flags for position-independent code and security features - Updated build dependencies in debian/control to include libc6-dev
Reviewer's GuideThis PR refines the CMake build by enabling threading support, augmenting compiler and linker flags for position-independent code and security hardening, and updates the Debian packaging dependencies accordingly. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @dengzhongyuan365-dev - I've reviewed your changes - here's some feedback:
- Wrap Linux-specific linker flags (-z relro, ‑z now, ‑z noexecstack) in an if(UNIX AND CMAKE_SYSTEM_NAME STREQUAL "Linux") block to prevent portability issues on other platforms.
- Unify PIC/PIE usage by applying ‑fPIC only to shared libraries and ‑fPIE to executables rather than globally setting ‑fPIC in CMAKE_C_FLAGS to avoid unnecessary binary overhead.
- Instead of mutating CMAKE_EXE_LINKER_FLAGS globally, consider using target_link_options or target_compile_options for each target to scope the security and optimization flags more precisely.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Wrap Linux-specific linker flags (-z relro, ‑z now, ‑z noexecstack) in an if(UNIX AND CMAKE_SYSTEM_NAME STREQUAL "Linux") block to prevent portability issues on other platforms.
- Unify PIC/PIE usage by applying ‑fPIC only to shared libraries and ‑fPIE to executables rather than globally setting ‑fPIC in CMAKE_C_FLAGS to avoid unnecessary binary overhead.
- Instead of mutating CMAKE_EXE_LINKER_FLAGS globally, consider using target_link_options or target_compile_options for each target to scope the security and optimization flags more precisely.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review代码审查意见:
总体来说,这些改动提高了代码的安全性,但是需要确保这些改动不会对项目的构建和运行产生负面影响。如果可能,应该在测试环境中验证这些改动的影响。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind 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 |
… support
Summary by Sourcery
Update the CMake configuration to enable threading support, strengthen security compiler/linker flags, and refresh Debian build dependencies.
Enhancements:
Build: