Skip to content

Add "PACBTI" to -mcpu flag in cbuildgen #2285

@AlbertHuang-CPU

Description

@AlbertHuang-CPU

PACBTI are introduced to v8.1m CPU such as CM85, CM52, SMC3.
They are enabled by default with these CPU specified in -mcpu flag.
We need to address the requirement for both sides of the coin.
1, to actually enable PACBTI, use -mbranch-protection and --library_security=protection, and this is reflected by CMake variable BRANCHPROT.
2, to disable(exclude) PACBTI, the compiler provide "+nopacbti" option for the -mcpu flag. There is currently no implementation for explicit excluding it.

Background information:
This is requested by CM52 user. For those customers who don't need PACBTI, they want to make it clear when they don't include PACBTI in HW the SW(toolchain) will also exclude it. Otherwise there will be confusion, e.g. the uVision will display "-mcpu=cortex-m52+pacbti" by default.
The queary above triggered AC upgrade from
https://developer.arm.com/documentation/109443/6-22-1LTS/armclang-Reference/Other-Compiler-specific-Features/Supported-architecture-feature-combinations-for-specific-processors?lang=en
to
https://developer.arm.com/documentation/109443/6-22-2LTS/armclang-Reference/Other-Compiler-specific-Features/Supported-architecture-feature-combinations-for-specific-processors?lang=en

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions