@@ -541,7 +541,7 @@ if platform.system() == 'Darwin':
541
541
"env SDKROOT=%s %r -toolchain-stdlib-rpath -Xlinker -rpath -Xlinker /usr/lib/swift %s %s %s"
542
542
% (shell_quote (config .host_sdkroot ), config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options ))
543
543
config .host_build_swift = (
544
- "%s -sdk %s -target %s -I %s -L %s"
544
+ "%s -sdk %s -target %s -no-toolchain-stdlib-rpath - I %s -L %s"
545
545
% (config .swiftc_driver , config .host_sdkroot , config .host_triple , config .swift_host_lib_dir , config .swift_host_lib_dir ))
546
546
else :
547
547
config .swift_driver = (
@@ -550,14 +550,27 @@ else:
550
550
if kIsWindows :
551
551
config .swift_driver += " -libc " + config .swift_stdlib_msvc_runtime
552
552
config .swiftc_driver = (
553
- "%r -toolchain-stdlib-rpath %s %s %s"
554
- % (config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options ))
553
+ "%r %s %s %s %s" % (
554
+ config .swiftc ,
555
+ '' if kIsWindows else '-toolchain-stdlib-rpath' ,
556
+ mcp_opt ,
557
+ config .swift_test_options ,
558
+ config .swift_driver_test_options
559
+ )
560
+ )
555
561
# Parse the host triple.
556
562
(host_cpu , host_vendor , host_os , host_vers ) = re .match ('([^-]+)-([^-]+)-([^0-9-]+)(.*)' , config .host_triple ).groups ()
557
563
toolchain_lib_dir = make_path (config .swift_lib_dir , 'swift' , host_os )
558
564
config .host_build_swift = (
559
- "%s -target %s -I %s -L %s -Xlinker -rpath -Xlinker %s"
560
- % (config .swiftc_driver , config .host_triple , config .swift_host_lib_dir , config .swift_host_lib_dir , toolchain_lib_dir ))
565
+ "%s -target %s -g %s -I %s -L %s %s" % (
566
+ config .swiftc_driver ,
567
+ config .host_triple ,
568
+ '' if kIsWindows else '-no-toolchain-stdlib-rpath' ,
569
+ config .swift_host_lib_dir ,
570
+ config .swift_host_lib_dir ,
571
+ '' if kIsWindows else '-Xlinker -rpath -Xlinker {}' .format (toolchain_lib_dir )
572
+ )
573
+ )
561
574
562
575
config .substitutions .append ( ('%llvm_obj_root' , config .llvm_obj_root ) )
563
576
config .substitutions .append ( ('%swift-bin-dir' , config .swift_bin_dir ) )
0 commit comments