@@ -547,42 +547,30 @@ else:
547547 config .swift_driver = (
548548 "%r %s %s %s"
549549 % (config .swift , mcp_opt , config .swift_test_options , config .swift_driver_test_options ))
550-
551550 if kIsWindows :
552551 config .swift_driver += " -libc " + config .swift_stdlib_msvc_runtime
553-
554552 config .swiftc_driver = (
555- "%r -g %s %s %s %s" % (
553+ "%r %s %s %s %s" % (
556554 config .swiftc ,
557- '' if kIsWindows else '-no- toolchain-stdlib-rpath' ,
555+ '' if kIsWindows else '-toolchain-stdlib-rpath' ,
558556 mcp_opt ,
559557 config .swift_test_options ,
560558 config .swift_driver_test_options
561559 )
562560 )
563-
564561 # Parse the host triple.
565562 (host_cpu , host_vendor , host_os , host_vers ) = re .match ('([^-]+)-([^-]+)-([^0-9-]+)(.*)' , config .host_triple ).groups ()
566563 toolchain_lib_dir = make_path (config .swift_lib_dir , 'swift' , host_os )
567- if kIsWindows :
568- config .host_build_swift = (
569- "%s -target %s -I %s -L %s" % (
570- config .swiftc_driver ,
571- config .host_triple ,
572- config .swift_host_lib_dir ,
573- config .swift_host_lib_dir ,
574- )
575- )
576- else :
577- config .host_build_swift = (
578- "%s -target %s -g -no-toolchain-stdlib-rpath -I %s -L %s -Xlinker -rpath -Xlinker %s" % (
579- config .swiftc_driver ,
580- config .host_triple ,
581- config .swift_host_lib_dir ,
582- config .swift_host_lib_dir ,
583- toolchain_lib_dir
584- )
564+ config .host_build_swift = (
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 )
585572 )
573+ )
586574
587575config .substitutions .append ( ('%llvm_obj_root' , config .llvm_obj_root ) )
588576config .substitutions .append ( ('%swift-bin-dir' , config .swift_bin_dir ) )
0 commit comments