@@ -378,15 +378,22 @@ else:
378378 test_resource_dir = make_path (config .swift_lib_dir , 'swift' )
379379config .swift_system_overlay_opt = ""
380380config .clang_system_overlay_opt = ""
381+ config .windows_vfs_overlay_opt = ""
381382if kIsWindows :
382383 # ucrt.modulemap currently requires -fbuiltin-headers-in-system-modules. -strict-implicit-module-context
383384 # is necessary for -Xcc arguments to be passed through ModuleInterfaceLoader.
384385 config .swift_system_overlay_opt = "-vfsoverlay {} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" .format (
385386 os .path .join (config .swift_obj_root , "stdlib" , "windows-vfs-overlay.yaml" )
386387 )
388+ # this variant is for extract-symbolgraph which doesn't accept all the same arugments as swiftc
389+ # so the extra ceremony lets us pass in the relevant pieces needed for Windows SDK access.
390+ config .windows_vfs_overlay_opt = "-Xcc -vfsoverlay -Xcc {} -Xcc -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" .format (
391+ os .path .join (config .swift_obj_root , "stdlib" , "windows-vfs-overlay.yaml" )
392+ )
387393 config .clang_system_overlay_opt = "-Xcc -ivfsoverlay -Xcc {} -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" .format (
388394 os .path .join (config .swift_obj_root , "stdlib" , "windows-vfs-overlay.yaml" )
389395 )
396+ config .substitutions .append ( ('%windows_vfs_overlay_opt' , config .windows_vfs_overlay_opt ) )
390397stdlib_resource_dir_opt = config .resource_dir_opt
391398sourcekitd_framework_dir = config .swift_lib_dir
392399config .substitutions .append ( ('%test-resource-dir' , test_resource_dir ) )
@@ -1341,7 +1348,7 @@ if run_vendor == 'apple':
13411348 "-Xlinker -rpath -Xlinker %r " +
13421349 "-Xlinker -rpath -Xlinker /usr/lib/swift " +
13431350 # This ensures LC_LOAD_DYLIB rewrite will succeed in %target-codesign (rdar://7885126):
1344- "-Xlinker -headerpad_max_install_names " +
1351+ "-Xlinker -headerpad_max_install_names " +
13451352 "%s %s %s %s" ) %
13461353 (xcrun_prefix , config .swiftc , target_options ,
13471354 extra_frameworks_dir ,
@@ -1389,7 +1396,7 @@ if run_vendor == 'apple':
13891396 ("%s %s %s -F %r -toolchain-stdlib-rpath %s " +
13901397 "-Xlinker -rpath -Xlinker /usr/lib/swift " +
13911398 # This ensures LC_LOAD_DYLIB rewrite will succeed in %target-codesign (rdar://7885126):
1392- "-Xlinker -headerpad_max_install_names " +
1399+ "-Xlinker -headerpad_max_install_names " +
13931400 " %s %s %s" ) %
13941401 (xcrun_prefix , config .swiftc , target_options ,
13951402 extra_frameworks_dir ,
@@ -1538,7 +1545,7 @@ if run_vendor == 'apple':
15381545 config .target_swiftc_driver = (
15391546 ("%s %s -toolchain-stdlib-rpath %s " +
15401547 # This ensures LC_LOAD_DYLIB rewrite will succeed in %target-codesign (rdar://7885126):
1541- "-Xlinker -headerpad_max_install_names " +
1548+ "-Xlinker -headerpad_max_install_names " +
15421549 "-Xlinker -rpath -Xlinker /usr/lib/swift %s %s " )%
15431550 (xcrun_prefix , config .swiftc , target_options , config .swift_driver_test_options , swiftc_platform_remap_config ))
15441551 config .target_stdlib_swiftc_driver = config .target_swiftc_driver
@@ -2226,7 +2233,7 @@ def configure_remote_run():
22262233 "--input-prefix '{0}' " .format (config .swift_src_root ) +
22272234 "--output-prefix %t " +
22282235 "--remote-dir '{0}'%t " .format (remote_tmp_dir ) +
2229- "{0} " .format (' ' .join (remote_run_extra_args )) +
2236+ "{0} " .format (' ' .join (remote_run_extra_args )) +
22302237 "{0}" .format (remote_run_host ))
22312238 config .target_swift_reflection_test = os .path .join (
22322239 remote_tmp_dir , 'bin' , swift_reflection_test_name )
0 commit comments