File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 2727
2828 'clang%' : 0 ,
2929 'error_on_warn%' : 'false' ,
30+ 'cfg%' : 'false' ,
3031
3132 'openssl_product' : '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)' ,
3233 'openssl_no_asm%' : 0 ,
309310 '/Zm2000' ,
310311 ],
311312 }],
313+ ['cfg=="true"' , {
314+ 'AdditionalOptions' : [
315+ '/guard:cf' , # Control Flow Guard
316+ ],
317+ }],
312318 ],
313319 'BufferSecurityCheck' : 'true' ,
314320 'DebugInformationFormat' : 1 , # /Z7 embed info in .obj files
335341 ['target_arch=="arm64"' , {
336342 'TargetMachine' : 0 , # NotSet. MACHINE:ARM64 is inferred from the input files.
337343 }],
344+ ['cfg=="true"' , {
345+ 'AdditionalOptions' : [
346+ '/guard:cf' , # Control Flow Guard
347+ ],
348+ }],
338349 ],
339350 'GenerateDebugInformation' : 'true' ,
340351 'SuppressStartupBanner' : 'true' ,
Original file line number Diff line number Diff line change 791791 default = None ,
792792 help = 'do not install the bundled Corepack' )
793793
794+ parser .add_argument ('--cfg' ,
795+ action = 'store_true' ,
796+ dest = 'enable_cfg' ,
797+ default = None ,
798+ help = 'enable Control Flow Guard (CFG)' )
799+
794800# Dummy option for backwards compatibility
795801parser .add_argument ('--without-report' ,
796802 action = 'store_true' ,
@@ -1394,6 +1400,7 @@ def configure_node(o):
13941400 o ['variables' ]['node_prefix' ] = options .prefix
13951401 o ['variables' ]['node_install_npm' ] = b (not options .without_npm )
13961402 o ['variables' ]['node_install_corepack' ] = b (not options .without_corepack )
1403+ o ['variables' ]['cfg' ] = b (options .enable_cfg )
13971404 o ['variables' ]['node_use_amaro' ] = b (not options .without_amaro )
13981405 o ['variables' ]['debug_node' ] = b (options .debug_node )
13991406 o ['default_configuration' ] = 'Debug' if options .debug else 'Release'
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ set no_shared_roheap=
7171set doc =
7272set extra_msbuild_args =
7373set compile_commands =
74+ set cfg =
7475set exit_code = 0
7576
7677:next-arg
@@ -148,6 +149,7 @@ if /i "%1"=="no-shared-roheap" set no_shared_roheap=1&goto arg-ok
148149if /i " %1 " == " doc" set doc = 1& goto arg-ok
149150if /i " %1 " == " binlog" set extra_msbuild_args = /binaryLogger:out\%config% \node.binlog& goto arg-ok
150151if /i " %1 " == " compile-commands" set compile_commands = 1& goto arg-ok
152+ if /i " %1 " == " cfg" set cfg = 1& goto arg-ok
151153
152154echo Error: invalid command line option `%1 `.
153155exit /b 1
@@ -207,6 +209,7 @@ if defined openssl_no_asm set configure_flags=%configure_flags% --openssl-no-a
207209if defined no_shared_roheap set configure_flags = %configure_flags% --disable-shared-readonly-heap
208210if defined DEBUG_HELPER set configure_flags = %configure_flags% --verbose
209211if defined compile_commands set configure_flags = %configure_flags% -C
212+ if defined cfg set configure_flags = %configure_flags% --cfg
210213
211214if " %target_arch% " == " x86" (
212215 echo " 32-bit Windows builds are not supported anymore."
You can’t perform that action at this time.
0 commit comments