@@ -375,10 +375,10 @@ config.substitutions.append( ('%swift_driver_plain', "%r" % config.swift) )
375
375
config .substitutions .append ( ('%swiftc_driver_plain' , "%r" % config .swiftc ) )
376
376
if kIsWindows :
377
377
config .substitutions .append ( ('%swift_driver' , "%r %s %s %s" % (config .swift , mcp_opt , config .swift_test_options , config .swift_driver_test_options )) )
378
- config .substitutions .append ( ('%swiftc_driver' , "%r %s %s %s" % (config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options )) )
378
+ config .substitutions .append ( ('%swiftc_driver' , "%r -toolchain-stdlib-rpath %s %s %s" % (config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options )) )
379
379
else :
380
380
config .substitutions .append ( ('%swift_driver' , "env SDKROOT= %r %s %s %s" % (config .swift , mcp_opt , config .swift_test_options , config .swift_driver_test_options )) )
381
- config .substitutions .append ( ('%swiftc_driver' , "env SDKROOT= %r %s %s %s" % (config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options )) )
381
+ 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 )) )
382
382
config .substitutions .append ( ('%sil-opt' , "%r %s %s" % (config .sil_opt , mcp_opt , config .sil_test_options )) )
383
383
config .substitutions .append ( ('%sil-func-extractor' , "%r %s" % (config .sil_func_extractor , mcp_opt )) )
384
384
config .substitutions .append ( ('%sil-llvm-gen' , "%r %s" % (config .sil_llvm_gen , mcp_opt )) )
@@ -691,7 +691,8 @@ if run_vendor == 'apple':
691
691
(run_cpu , run_os , run_vers , clang_mcp_opt ))
692
692
693
693
config .target_build_swift = (
694
- "%s %s %s -F %r -Xlinker -rpath -Xlinker %r %s %s %s %s" %
694
+ ("%s %s %s -F %r -toolchain-stdlib-rpath " +
695
+ "-Xlinker -rpath -Xlinker %r %s %s %s %s" ) %
695
696
(xcrun_prefix , config .swiftc , target_options ,
696
697
extra_frameworks_dir ,
697
698
"/tmp/swifttest-device/lib" ,
@@ -725,7 +726,7 @@ if run_vendor == 'apple':
725
726
(run_cpu , run_os , run_vers , clang_mcp_opt ))
726
727
727
728
config .target_build_swift = (
728
- "%s %s %s -F %r %s %s %s %s" %
729
+ "%s %s %s -F %r -toolchain-stdlib-rpath %s %s %s %s" %
729
730
(xcrun_prefix , config .swiftc , target_options ,
730
731
extra_frameworks_dir ,
731
732
sdk_overlay_linker_opt , config .swift_test_options ,
@@ -759,7 +760,9 @@ if run_vendor == 'apple':
759
760
(run_cpu , run_os , run_vers , clang_mcp_opt ))
760
761
761
762
config .target_build_swift = (
762
- "%s %s %s -F %r -Xlinker -rpath -Xlinker %r %s %s %s %s -F %r -Xlinker -rpath -Xlinker %r"
763
+ ("%s %s %s -F %r -toolchain-stdlib-rpath "
764
+ + "-Xlinker -rpath -Xlinker %r %s %s %s %s "
765
+ + "-F %r -Xlinker -rpath -Xlinker %r" )
763
766
% (xcrun_prefix , config .swiftc , target_options ,
764
767
extra_frameworks_dir , extra_frameworks_dir ,
765
768
sdk_overlay_linker_opt , config .swift_test_options ,
@@ -809,7 +812,7 @@ if run_vendor == 'apple':
809
812
subst_target_swift_ide_test_mock_sdk_after = \
810
813
target_options_for_mock_sdk_after
811
814
config .target_swiftc_driver = (
812
- "%s %s %s" %
815
+ "%s %s -toolchain-stdlib-rpath %s" %
813
816
(xcrun_prefix , config .swiftc , target_options ))
814
817
config .target_clang = (
815
818
"%s clang++ %s" %
@@ -906,7 +909,7 @@ elif run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'wi
906
909
config .target_runtime = "native"
907
910
config .target_swift_autolink_extract = inferSwiftBinary ("swift-autolink-extract" )
908
911
config .target_build_swift = (
909
- '%s -target %s %s %s %s %s %s'
912
+ '%s -target %s -toolchain-stdlib-rpath %s %s %s %s %s'
910
913
% (config .swiftc , config .variant_triple , resource_dir_opt , mcp_opt ,
911
914
config .swift_test_options , config .swift_driver_test_options ,
912
915
swift_execution_tests_extra_flags ))
@@ -934,7 +937,7 @@ elif run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'wi
934
937
subst_target_swift_ide_test_mock_sdk = config .target_swift_ide_test
935
938
subst_target_swift_ide_test_mock_sdk_after = ""
936
939
config .target_swiftc_driver = (
937
- "%s -target %s %s %s" %
940
+ "%s -target %s -toolchain-stdlib-rpath %s %s" %
938
941
(config .swiftc , config .variant_triple , resource_dir_opt , mcp_opt ))
939
942
config .target_swift_modulewrap = (
940
943
'%s -modulewrap -target %s' %
@@ -1054,6 +1057,7 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
1054
1057
config .target_swiftc_driver = ' ' .join ([
1055
1058
config .swiftc ,
1056
1059
'-target' , config .variant_triple ,
1060
+ '-toolchain-stdlib-rpath' ,
1057
1061
'-sdk' , config .variant_sdk ,
1058
1062
'-tools-directory' , tools_directory ,
1059
1063
android_link_paths_opt , resource_dir_opt , mcp_opt ,
0 commit comments