From f76e90ba61bd3e00010950cf6e6ce4c8063cfb6e Mon Sep 17 00:00:00 2001 From: zhangkun Date: Thu, 19 Jun 2025 11:46:54 +0800 Subject: [PATCH] feat: enable position independent code in CMake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added CMAKE_POSITION_INDEPENDENT_CODE ON to CMakeLists.txt to ensure the project builds with Position Independent Code (PIC) enabled. This is necessary for building shared libraries and ensures proper linking when the code is loaded at different memory addresses. PIC is particularly important for security features like ASLR (Address Space Layout Randomization). feat: 在 CMake 中启用位置无关代码 在 CMakeLists.txt 中添加了 CMAKE_POSITION_INDEPENDENT_CODE ON 设置,确保 项目以位置无关代码(PIC)方式构建。这对于构建共享库是必要的,并确保代码在 不同内存地址加载时能正确链接。位置无关代码对于 ASLR(地址空间布局随机化) 等安全特性尤为重要。 --- CMakeLists.txt | 1 + debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 56d083e..14df601 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(dde-session LANGUAGES CXX C) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX /usr) diff --git a/debian/changelog b/debian/changelog index a0ed6c1..7689fc4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dde-session (1.99.21) unstable; urgency=medium + + * feat: enable position independent code in CMake + + -- zhangkun Thu, 19 Jun 2025 11:00:01 +0800 + dde-session (1.99.20) unstable; urgency=medium * fix: start deepin-keyring-whitebox when dde-session starting