This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new b50ec8ec6b9 cmake/armv8-m: add PACBTI build flags
b50ec8ec6b9 is described below

commit b50ec8ec6b914006e68103439657cd743bfdeda3
Author: chao an <[email protected]>
AuthorDate: Tue Oct 20 14:56:07 2026 +0800

    cmake/armv8-m: add PACBTI build flags
    
    The Make-based ARMv8-M toolchain configuration already appends the PACBTI
    architecture extension and enables standard branch protection when
    CONFIG_ARM_PACBTI is selected.  The CMake path, however, only handled DSP,
    MVE, FPU and CMSE flags, so CMake builds did not get the same PACBTI code
    generation options.
    
    Add the missing CMake handling for CONFIG_ARM_PACBTI by appending +pacbti to
    the ARMv8-M architecture extension string and passing
    -mbranch-protection=standard to the compiler.  This keeps the CMake and Make
    build paths aligned for Cortex-M85 and other ARMv8-M targets that expose the
    PACBTI capability.
    
    Signed-off-by: chao an <[email protected]>
---
 arch/arm/src/cmake/armv8-m.cmake | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/src/cmake/armv8-m.cmake b/arch/arm/src/cmake/armv8-m.cmake
index 24fb13efd3f..9fcf6e83193 100644
--- a/arch/arm/src/cmake/armv8-m.cmake
+++ b/arch/arm/src/cmake/armv8-m.cmake
@@ -51,6 +51,11 @@ if(CONFIG_ARM_DSP)
   set(EXTCPUFLAGS +dsp)
 endif()
 
+if(CONFIG_ARM_PACBTI)
+  string(APPEND EXTCPUFLAGS +pacbti)
+  list(APPEND PLATFORM_FLAGS -mbranch-protection=standard)
+endif()
+
 if(CONFIG_ARCH_CORTEXM23)
   list(APPEND PLATFORM_FLAGS -mtune=cortex-m23 -march=armv8-m.main
        -mfloat-abi=soft)

Reply via email to