diff --git a/configure.py b/configure.py index 62f041ce52bf85..e55c5a6353417b 100755 --- a/configure.py +++ b/configure.py @@ -1268,9 +1268,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 93e4235a0f3efd..62fa1e7e4efa4b 100644 --- a/node.gyp +++ b/node.gyp @@ -468,6 +468,9 @@ }, 'conditions': [ + ['target_arch=="arm64"', { + 'cflags': ['-msign-return-address=all'], # Pointer authentication. + }], ['OS in "aix os400"', { 'ldflags': [ '-Wl,-bnoerrmsg',