Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multilib PACBTI mapping #501

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

vhscampos
Copy link
Member

Follow up to #467.

This patch fixes the multilib mapping for -mbranch-protection.

Firstly, the multilib flag to be inserted should be -mbranch-protection=standard as it is the flag expected by the PACBTI-M multilib variants.

Secondly, the PACBTI-M variant should also match to configurations where the branch protection is restricted to only one of PAC or BTI, like in -mbranch-protection=bti or -mbranch-protection=pac-ret. Before this patch, the variant would only match if both features were requested at the same time. This is safe to do because instructions from either feature have no effect if that feature is disabled at runtime.

cmake/multilib.yaml.in Outdated Show resolved Hide resolved
Follow up to [ARM-software#467](ARM-software#467).

This patch fixes the multilib mapping for PACBTI-M.

The PACBTI-M variant should also match to configurations where
the branch protection is restricted to only one of PAC or BTI, like in
`-mbranch-protection=bti` or `-mbranch-protection=pac-ret`. Before this
patch, the variant would only match if both features were requested at
the same time. This is safe to do because instructions from either
feature have no effect if that feature is disabled at runtime.

This change also replaces ocurrences of `-mbranch-protection=standard`
by `-mbranch-protection=pac-ret+bti` because the latter is more
explicit.
Copy link
Collaborator

@pratlucas pratlucas left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this! LGTM.

@vhscampos vhscampos merged commit aa8112c into ARM-software:main Sep 13, 2024
1 check passed
@vhscampos vhscampos deleted the multilib-pacbti-mapping branch September 13, 2024 10:58
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.

2 participants