Add a preprocessor definitions to indidcate the landing pad labeling …#76
Open
kito-cheng wants to merge 1 commit intomainfrom
Open
Add a preprocessor definitions to indidcate the landing pad labeling …#76kito-cheng wants to merge 1 commit intomainfrom
kito-cheng wants to merge 1 commit intomainfrom
Conversation
8ab23cf to
779beee
Compare
mylai-mtk
reviewed
May 14, 2024
21aac32 to
3e51600
Compare
…scheme and shadow stack.
Also add 2 more macros to let user able to determine the scheme.
Example code:
```c
#ifdef __riscv_landing_pad
#if defined(__riscv_landing_pad_unlabeled)
...
#elif defined(__riscv_landing_pad_func_sig)
...
#else
#error "Unknown labeling scheme"
#endif
#endif
```
971a381 to
21882fa
Compare
Collaborator
Author
|
Changes:
|
mylai-mtk
added a commit
to llvm/llvm-project
that referenced
this pull request
May 19, 2025
…109600) This patch adds preprocessor macros when Zicfilp CFI is enabled. To be specific: + `#define __riscv_landing_pad 1` when `-fcf-protection=[full|branch]` + `#define __riscv_landing_pad_unlabeled 1` when `-fcf-protection=[full|branch] -mcf-branch-label-scheme=unlabeled` The macros are proposed in riscv-non-isa/riscv-c-api-doc#76 , and the CLI flags are from riscv-non-isa/riscv-toolchain-conventions#54.
llvm-sync bot
pushed a commit
to arm/arm-toolchain
that referenced
this pull request
May 19, 2025
…or macros (#109600) This patch adds preprocessor macros when Zicfilp CFI is enabled. To be specific: + `#define __riscv_landing_pad 1` when `-fcf-protection=[full|branch]` + `#define __riscv_landing_pad_unlabeled 1` when `-fcf-protection=[full|branch] -mcf-branch-label-scheme=unlabeled` The macros are proposed in riscv-non-isa/riscv-c-api-doc#76 , and the CLI flags are from riscv-non-isa/riscv-toolchain-conventions#54.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…scheme and shadow stack
__riscv_landing_pad: Defined if the landing pad is enabled.__riscv_landing_pad_unlabeled: Defined if the unlabeled labeling scheme is enabled.__riscv_shadow_stack: Defined if the shadow stack is enabled.