[pac] Add a specific flag for enabling PAC only The configuration option 'arm_control_flow_integrity' allows to configure various level of control flow integrity checks for AArch64 architecture. Currently it is only possible to enable Pointer Authentication as well as Branch Target Instructions together. This change will allow to enable PAC independently from BTI. Bug: chromium:919548 Change-Id: Iefb016d44382785ebc5afd3e846a19ff81ba780e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/60728 Reviewed-by: Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com> Tested-by: Andre Kempe <andre.kempe@arm.com> Commit-Queue: Alexis Hétu <sugoi@google.com>
diff --git a/BUILD.gn b/BUILD.gn index 7d84b99..3379d5b 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -70,6 +70,9 @@ if (arm_control_flow_integrity == "standard") { cflags += [ "-mbranch-protection=standard" ] asmflags += [ "-mbranch-protection=standard" ] + } else if (arm_control_flow_integrity == "pac") { + cflags += [ "-mbranch-protection=pac-ret" ] + asmflags += [ "-mbranch-protection=pac-ret" ] } else { assert(arm_control_flow_integrity == "none", "Invalid branch protection option!")