diff --git a/common.gypi b/common.gypi old mode 100644 new mode 100755 index 38471d4639eb5e3ee5c0da4e117f716b7cc06177..7893a1ab1173d02cdced98f1837e417674b74002 --- 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/features.gypi b/tools/v8_gypfiles/features.gypi old mode 100644 new mode 100755 index aa59713bbbe9edb54848d60f692f6171f4704c25..8fd14e50216125947f844c471564af87b67a6eed --- a/tools/v8_gypfiles/features.gypi +++ b/tools/v8_gypfiles/features.gypi @@ -234,7 +234,7 @@ # Enable control-flow integrity features, such as pointer authentication # for ARM64. - 'v8_control_flow_integrity%': 0, + 'v8_control_flow_integrity%': 1, # Enable V8 zone compression experimental feature. # Sets -DV8_COMPRESS_ZONES. diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi old mode 100644 new mode 100755 index 535cc9ee1fee0d8b50ab7372ca56bec0b9595ca9..d2f678439ae47ca6b0f7a46b2071638b2776a695 --- a/tools/v8_gypfiles/toolchain.gypi +++ b/tools/v8_gypfiles/toolchain.gypi @@ -269,7 +269,7 @@ ], 'conditions': [ ['v8_control_flow_integrity==1', { - 'cflags': [ '-mbranch-protection=standard' ], + 'cflags': [ '-mbranch-protection=pac-ret+b-key+bti' ], }], ], 'target_conditions': [ diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp old mode 100644 new mode 100755 index cddf33676a664139d9d70a206dd6644099666b46..4478d34f541982858b63c17d038a8d090c4bd02a --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -342,6 +342,11 @@ 'type': 'static_library', 'toolsets': ['target'], 'conditions': [ + ['v8_control_flow_integrity==1', { + 'sources': [ + '<(V8_ROOT)/src/deoptimizer/deoptimizer-cfi-builtins.cc', + ], + }], ['want_separate_host_toolset', { 'conditions': [ ['v8_target_arch=="arm64"', { @@ -373,6 +378,10 @@ ] }], ], + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + '<(generate_bytecode_output_root)', + ], 'sources': [ '<(V8_ROOT)/src/init/setup-isolate-deserialize.cc', ], @@ -1453,6 +1462,11 @@ ['enable_lto=="true"', { 'ldflags': [ '-fno-lto' ], }], + ['v8_control_flow_integrity==1', { + 'sources': [ + '<(V8_ROOT)/src/deoptimizer/deoptimizer-cfi-empty.cc', + ], + }], ], }, # mksnapshot {