Commit c482a66b authored by André Kempe's avatar André Kempe Committed by V8 LUCI CQ

Enable PAC and BTI for runtime generated code.

This patch enables PAC and BTI for runtime generated code when PAC
is enabled. Additional BTI landing pads will resolve to NOOP when
running on non BTI device and will not cause functional problems.

Change-Id: I3993481df2c3c47e3e81bfb76a8c355f642cd572
Bug: chromium:919548, v8:10026
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548457Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Andre Kempe <andre.kempe@arm.com>
Cr-Commit-Position: refs/heads/main@{#79630}
parent e71ce309
......@@ -474,7 +474,8 @@ if (v8_multi_arch_build &&
# Check if it is a Chromium build and activate PAC/BTI if needed.
# TODO(cavalcantii): have a single point of integration with PAC/BTI flags.
if (build_with_chromium && v8_current_cpu == "arm64" &&
arm_control_flow_integrity == "standard") {
(arm_control_flow_integrity == "standard" ||
arm_control_flow_integrity == "pac")) {
v8_control_flow_integrity = true
}
......@@ -1044,8 +1045,8 @@ config("toolchain") {
defines += [ "V8_TARGET_ARCH_ARM64" ]
if (current_cpu == "arm64") {
# This will enable PAC+BTI in code generation and static code.
if (v8_control_flow_integrity) {
# TODO(v8:10026): Enable this in src/build.
if (v8_control_flow_integrity &&
(!build_with_chromium || arm_control_flow_integrity == "standard")) {
cflags += [ "-mbranch-protection=standard" ]
asmflags = [ "-mmark-bti-property" ]
} else if (build_with_chromium && arm_control_flow_integrity == "pac") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment