diff --git a/configure.py b/configure.py index f189ba2bf0..2602f6403e 100755 --- a/configure.py +++ b/configure.py @@ -1345,6 +1345,7 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int(cross_compiling) 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 67909bdeb8..b38250a8cc 100644 --- node.gyp 2024-10-07 13:02:39 +++ node.gyp 2024-10-07 13:02:45 @@ -472,36 +472,6 @@ { "cflags": [ "-Wno-restrict" - ] - } - ], - [ - "target_arch==\"arm64\"", - { - "target_conditions": [ - [ - "_toolset==\"host\"", - { - "conditions": [ - [ - "host_arch==\"arm64\"", - { - "cflags": [ - "-mbranch-protection=standard" - ] - } - ] - ] - } - ], - [ - "_toolset==\"target\"", - { - "cflags": [ - "-mbranch-protection=standard" - ] - } - ] ] } ],