From 999ff83cc04f175f4290d1b282c27f95d5ace6ec Mon Sep 17 00:00:00 2001 From: greensue Date: Tue, 17 Sep 2024 20:14:09 +0800 Subject: [PATCH] open cfi Signed-off-by: s00502827 --- common.gypi | 1 + tools/v8_gypfiles/toolchain.gypi | 4 ++++ 2 files changed, 5 insertions(+) mode change 100644 => 100755 common.gypi mode change 100644 => 100755 tools/v8_gypfiles/toolchain.gypi diff --git a/common.gypi b/common.gypi old mode 100644 new mode 100755 index 38471d46..7893a1ab --- a/common.gypi +++ b/common.gypi @@ -340,6 +340,7 @@ }], [ 'target_arch=="arm64"', { 'msvs_configuration_platform': 'arm64', + 'cflags': ['-mbranch-protection=pac-ret+b-key+bti'], }], ['asan == 1 and OS != "mac" and OS != "zos"', { 'cflags+': [ diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi old mode 100644 new mode 100755 index 535cc9ee..365f6c05 --- a/tools/v8_gypfiles/toolchain.gypi +++ b/tools/v8_gypfiles/toolchain.gypi @@ -51,6 +51,7 @@ # on the target. 'v8_can_use_vfp32dregs%': 'false', 'arm_test_noprobe%': 'off', + 'arm_control_flow_integrity': 1, # Similar to vfp but on MIPS. 'v8_can_use_fpu_instructions%': 'true', @@ -271,6 +272,9 @@ ['v8_control_flow_integrity==1', { 'cflags': [ '-mbranch-protection=standard' ], }], + ['arm_control_flow_integrity==1', { + 'cflags': [ '-mbranch-protection=pac-ret+b-key+bti' ], + }], ], 'target_conditions': [ ['_toolset == "target"', { -- Gitee