@@ -380,12 +380,12 @@ if kIsWindows:
380
380
config .swift_driver_test_options ,
381
381
config .swift_stdlib_msvc_runtime )) )
382
382
config .substitutions .append ( ('%swiftc_driver' ,
383
- "%r %s %s %s" % (config .swiftc , mcp_opt ,
384
- config .swift_test_options ,
385
- config .swift_driver_test_options )) )
383
+ "%r -toolchain-stdlib-rpath %s %s %s" % (config .swiftc , mcp_opt ,
384
+ config .swift_test_options ,
385
+ config .swift_driver_test_options )) )
386
386
else :
387
387
config .substitutions .append ( ('%swift_driver' , "env SDKROOT= %r %s %s %s" % (config .swift , mcp_opt , config .swift_test_options , config .swift_driver_test_options )) )
388
- config .substitutions .append ( ('%swiftc_driver' , "env SDKROOT= %r %s %s %s" % (config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options )) )
388
+ config .substitutions .append ( ('%swiftc_driver' , "env SDKROOT= %r -toolchain-stdlib-rpath %s %s %s" % (config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options )) )
389
389
config .substitutions .append ( ('%sil-opt' , "%r %s %s" % (config .sil_opt , mcp_opt , config .sil_test_options )) )
390
390
config .substitutions .append ( ('%sil-func-extractor' , "%r %s" % (config .sil_func_extractor , mcp_opt )) )
391
391
config .substitutions .append ( ('%sil-llvm-gen' , "%r %s" % (config .sil_llvm_gen , mcp_opt )) )
@@ -771,7 +771,8 @@ if run_vendor == 'apple':
771
771
(run_cpu , run_os , run_vers , clang_mcp_opt ))
772
772
773
773
config .target_build_swift = (
774
- "%s %s %s -F %r -Xlinker -rpath -Xlinker %r %s %s %s %s" %
774
+ ("%s %s %s -F %r -toolchain-stdlib-rpath " +
775
+ "-Xlinker -rpath -Xlinker %r %s %s %s %s" ) %
775
776
(xcrun_prefix , config .swiftc , target_options ,
776
777
extra_frameworks_dir ,
777
778
"/tmp/swifttest-device/lib" ,
@@ -805,7 +806,7 @@ if run_vendor == 'apple':
805
806
(run_cpu , run_os , run_vers , clang_mcp_opt ))
806
807
807
808
config .target_build_swift = (
808
- "%s %s %s -F %r %s %s %s %s" %
809
+ "%s %s %s -F %r -toolchain-stdlib-rpath %s %s %s %s" %
809
810
(xcrun_prefix , config .swiftc , target_options ,
810
811
extra_frameworks_dir ,
811
812
sdk_overlay_linker_opt , config .swift_test_options ,
@@ -839,7 +840,9 @@ if run_vendor == 'apple':
839
840
(run_cpu , run_os , run_vers , clang_mcp_opt ))
840
841
841
842
config .target_build_swift = (
842
- "%s %s %s -F %r -Xlinker -rpath -Xlinker %r %s %s %s %s -F %r -Xlinker -rpath -Xlinker %r"
843
+ ("%s %s %s -F %r -toolchain-stdlib-rpath "
844
+ + "-Xlinker -rpath -Xlinker %r %s %s %s %s "
845
+ + "-F %r -Xlinker -rpath -Xlinker %r" )
843
846
% (xcrun_prefix , config .swiftc , target_options ,
844
847
extra_frameworks_dir , extra_frameworks_dir ,
845
848
sdk_overlay_linker_opt , config .swift_test_options ,
@@ -889,7 +892,7 @@ if run_vendor == 'apple':
889
892
subst_target_swift_ide_test_mock_sdk_after = \
890
893
target_options_for_mock_sdk_after
891
894
config .target_swiftc_driver = (
892
- "%s %s %s" %
895
+ "%s %s -toolchain-stdlib-rpath %s" %
893
896
(xcrun_prefix , config .swiftc , target_options ))
894
897
config .target_clang = (
895
898
"%s clang++ %s" %
@@ -1009,7 +1012,7 @@ elif run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'wi
1009
1012
% (libdispatch_source_dir , libdispatch_swift_module_dir , libdispatch_artifact_dir ))
1010
1013
1011
1014
config .target_build_swift = (
1012
- '%s -target %s %s %s %s %s %s'
1015
+ '%s -target %s -toolchain-stdlib-rpath %s %s %s %s %s'
1013
1016
% (config .swiftc , config .variant_triple , resource_dir_opt , mcp_opt ,
1014
1017
config .swift_test_options , config .swift_driver_test_options ,
1015
1018
swift_execution_tests_extra_flags ))
@@ -1037,7 +1040,7 @@ elif run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'wi
1037
1040
subst_target_swift_ide_test_mock_sdk = config .target_swift_ide_test
1038
1041
subst_target_swift_ide_test_mock_sdk_after = ""
1039
1042
config .target_swiftc_driver = (
1040
- "%s -target %s %s %s" %
1043
+ "%s -target %s -toolchain-stdlib-rpath %s %s" %
1041
1044
(config .swiftc , config .variant_triple , resource_dir_opt , mcp_opt ))
1042
1045
config .target_swift_modulewrap = (
1043
1046
'%s -modulewrap -target %s' %
@@ -1153,6 +1156,7 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
1153
1156
config .target_swiftc_driver = ' ' .join ([
1154
1157
config .swiftc ,
1155
1158
'-target' , config .variant_triple ,
1159
+ '-toolchain-stdlib-rpath' ,
1156
1160
'-Xcc' , '--sysroot={}' .format (config .variant_sdk ),
1157
1161
'-Xclang-linker' , '--sysroot={}' .format (config .variant_sdk ),
1158
1162
'-tools-directory' , tools_directory ,
0 commit comments