diff --git a/node.gyp b/node.gyp index 4a2632c541c380..0c317dc127ed53 100644 --- a/node.gyp +++ b/node.gyp @@ -479,8 +479,20 @@ }, 'conditions': [ + # Pointer authentication for ARM64. ['target_arch=="arm64"', { - 'cflags': ['-mbranch-protection=standard'], # Pointer authentication. + 'target_conditions': [ + ['_toolset=="host"', { + 'conditions': [ + ['host_arch=="arm64"', { + 'cflags': ['-mbranch-protection=standard'], + }], + ], + }], + ['_toolset=="target"', { + 'cflags': ['-mbranch-protection=standard'], + }], + ], }], ['OS in "aix os400"', { 'ldflags': [