diff --git a/configure.py b/configure.py index a6dae354d4233f..e2bb9dce127950 100755 --- a/configure.py +++ b/configure.py @@ -1247,9 +1247,7 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int(cross_compiling) - # Enable branch protection for arm64 if target_arch == 'arm64': - o['cflags']+=['-msign-return-address=all'] o['variables']['arm_fpu'] = options.arm_fpu or 'neon' if options.node_snapshot_main is not None: diff --git a/node.gyp b/node.gyp index 448cb8a8c7cd49..6cec024ffe722e 100644 --- a/node.gyp +++ b/node.gyp @@ -109,6 +109,9 @@ }, 'conditions': [ + ['target_arch=="arm64"', { + 'cflags': ['-msign-return-address=all'], # Pointer authentication. + }], ['OS=="aix"', { 'ldflags': [ '-Wl,-bnoerrmsg',