From 54b97991deaaa04e87e4f3704b0dfcdcdd098a4b Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:01:12 -0700 Subject: [PATCH] fix(NODE-6265): add Spectre Mitigation and CFG (#190) --- binding.gyp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/binding.gyp b/binding.gyp index 0407d77f..1eb34762 100644 --- a/binding.gyp +++ b/binding.gyp @@ -21,15 +21,24 @@ }, 'cflags!': [ '-fno-exceptions' ], 'cflags_cc!': [ '-fno-exceptions' ], + 'msvs_configuration_attributes': { + 'SpectreMitigation': 'Spectre' + }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1, 'AdditionalOptions': [ + '/guard:cf', '/w34244', '/w34267', '/ZH:SHA_256' ] }, + 'VCLinkerTool': { + 'AdditionalOptions': [ + '/guard:cf' + ] + } }, 'conditions': [ ['OS=="mac"', { 'cflags+': ['-fvisibility=hidden'] }],