File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 2828 'clang%' : 0 ,
2929 'error_on_warn%' : 'false' ,
3030 'suppress_all_error_on_warn%' : 'false' ,
31+ 'control_flow_guard%' : 'false' ,
3132
3233 'openssl_product' : '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)' ,
3334 'openssl_no_asm%' : 0 ,
310311 '/Zm2000' ,
311312 ],
312313 }],
314+ ['control_flow_guard=="true"' , {
315+ 'AdditionalOptions' : [
316+ '/guard:cf' , # Control Flow Guard
317+ ],
318+ }],
313319 ],
314320 'BufferSecurityCheck' : 'true' ,
315321 'DebugInformationFormat' : 1 , # /Z7 embed info in .obj files
336342 ['target_arch=="arm64"' , {
337343 'TargetMachine' : 0 , # NotSet. MACHINE:ARM64 is inferred from the input files.
338344 }],
345+ ['control_flow_guard=="true"' , {
346+ 'AdditionalOptions' : [
347+ '/guard:cf' , # Control Flow Guard
348+ ],
349+ }],
339350 ],
340351 'GenerateDebugInformation' : 'true' ,
341352 'SuppressStartupBanner' : 'true' ,
Original file line number Diff line number Diff line change 819819 default = None ,
820820 help = 'do not install the bundled Corepack' )
821821
822+ parser .add_argument ('--control-flow-guard' ,
823+ action = 'store_true' ,
824+ dest = 'enable_cfg' ,
825+ default = None ,
826+ help = 'enable Control Flow Guard (CFG)' )
827+
822828# Dummy option for backwards compatibility
823829parser .add_argument ('--without-report' ,
824830 action = 'store_true' ,
@@ -1436,6 +1442,7 @@ def configure_node(o):
14361442 o ['variables' ]['node_prefix' ] = options .prefix
14371443 o ['variables' ]['node_install_npm' ] = b (not options .without_npm )
14381444 o ['variables' ]['node_install_corepack' ] = b (not options .without_corepack )
1445+ o ['variables' ]['control_flow_guard' ] = b (options .enable_cfg )
14391446 o ['variables' ]['node_use_amaro' ] = b (not options .without_amaro )
14401447 o ['variables' ]['debug_node' ] = b (options .debug_node )
14411448 o ['default_configuration' ] = 'Debug' if options .debug else 'Release'
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ set no_shared_roheap=
7272set doc =
7373set extra_msbuild_args =
7474set compile_commands =
75+ set cfg =
7576set exit_code = 0
7677
7778:next-arg
@@ -150,6 +151,7 @@ if /i "%1"=="no-shared-roheap" set no_shared_roheap=1&goto arg-ok
150151if /i " %1 " == " doc" set doc = 1& goto arg-ok
151152if /i " %1 " == " binlog" set extra_msbuild_args = /binaryLogger:out\%config% \node.binlog& goto arg-ok
152153if /i " %1 " == " compile-commands" set compile_commands = 1& goto arg-ok
154+ if /i " %1 " == " cfg" set cfg = 1& goto arg-ok
153155
154156echo Error: invalid command line option `%1 `.
155157exit /b 1
@@ -210,6 +212,8 @@ if defined no_shared_roheap set configure_flags=%configure_flags% --disable-shar
210212if defined DEBUG_HELPER set configure_flags = %configure_flags% --verbose
211213if defined ccache_path set configure_flags = %configure_flags% --use-ccache-win
212214if defined compile_commands set configure_flags = %configure_flags% -C
215+ if defined cfg set configure_flags = %configure_flags% --control-flow-guard
216+
213217if " %target_arch% " == " x86" if " %PROCESSOR_ARCHITECTURE% " == " AMD64" set configure_flags = %configure_flags% --no-cross-compiling
214218
215219if not exist " %~dp0 deps\icu" goto no-depsicu
You can’t perform that action at this time.
0 commit comments