llvm-project
f341dab9 - [clang][RISCV][Zicfilp] Force user to use `-mcf-branch-label-scheme=unlabeled` (#152122)

Commit
72 days ago
[clang][RISCV][Zicfilp] Force user to use `-mcf-branch-label-scheme=unlabeled` (#152122) Expected Behavior: When `-fcf-protection=branch|full` is specified, it's an error to omit `-mcf-branch-label-scheme=unlabeled`. Context: When using forward-edge control flow integrity feature based on the RISC-V Zicfilp extension, the `-mcf-branch-label-scheme` option selects the encoding scheme used in the landing pad labels. The spec defines 2 schemes: `func-sig` and `unlabeled`, with the former specified as the default. However the `func-sig` backend is still under active development and won't land anytime soon; in the meanwhile, the `unlabeled` scheme almost has complete support in the toolchain now. Given that Clang currently accepts and defaults to `-mcf-branch-label-scheme=func-sig` but doesn't work correctly, we want to formally forbid the user from using `-mcf-branch-label-scheme=func-sig` for now until the `func-sig` scheme is properly supported. We choose to do so by forcing the user to specify `-mcf-branch-label-scheme=unlabeled` (instead of changing the default to `unlabeled`) so the default of `func-sig` can be retained according to the spec and build scripts targeting the current Clang can be forward-compatible with the Clang that supports the complete `func-sig` scheme.
Author
Parents
Loading