@@ -533,35 +533,31 @@ lit_config.note("Using code completion cache: " + completion_cache_path)
533
533
534
534
config .swift_host_lib_dir = make_path (config .swift_lib_dir , 'swift' , 'host' )
535
535
536
- if kIsWindows :
537
- config .swift_driver = (
538
- "%r %s %s %s -libc %s" % (config .swift , mcp_opt ,
539
- config .swift_test_options ,
540
- config .swift_driver_test_options ,
541
- config .swift_stdlib_msvc_runtime ))
542
- config .swiftc_driver = (
543
- "%r -toolchain-stdlib-rpath %s %s %s" % (config .swiftc , mcp_opt ,
544
- config .swift_test_options ,
545
- config .swift_driver_test_options ))
546
- else :
536
+ if platform .system () == 'Darwin' :
547
537
config .swift_driver = (
548
538
"env SDKROOT=%s %r %s %s %s"
549
539
% (shell_quote (config .host_sdkroot ), config .swift , mcp_opt , config .swift_test_options , config .swift_driver_test_options ))
550
540
config .swiftc_driver = (
551
541
"env SDKROOT=%s %r -toolchain-stdlib-rpath -Xlinker -rpath -Xlinker /usr/lib/swift %s %s %s"
552
542
% (shell_quote (config .host_sdkroot ), config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options ))
553
-
554
- if platform .system () == 'Darwin' :
555
- host_build_extra_rpath = ""
556
- elif config .host_triple :
543
+ config .host_build_swift = (
544
+ "%s -sdk %s -target %s -I %s -L %s"
545
+ % (config .swiftc_driver , config .host_sdkroot , config .host_triple , config .swift_host_lib_dir , config .swift_host_lib_dir ))
546
+ else :
547
+ config .swift_driver = (
548
+ "%r %s %s %s"
549
+ % (config .swift , mcp_opt , config .swift_test_options , config .swift_driver_test_options ))
550
+ if kIsWindows :
551
+ config .swift_driver += " -libc " + config .swift_stdlib_msvc_runtime
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 ))
557
555
# Parse the host triple.
558
556
(host_cpu , host_vendor , host_os , host_vers ) = re .match ('([^-]+)-([^-]+)-([^0-9-]+)(.*)' , config .host_triple ).groups ()
559
- host_build_extra_rpath = "-Xlinker -rpath -Xlinker %s" % (make_path (config .swift_lib_dir , 'swift' , host_os ))
560
- else :
561
- host_build_extra_rpath = ""
562
-
563
- config .host_build_swift = (
564
- "%s -sdk %s -target %s -I %s -L %s %s" % (config .swiftc_driver , config .host_sdkroot , config .host_triple , config .swift_host_lib_dir , config .swift_host_lib_dir , host_build_extra_rpath ))
557
+ toolchain_lib_dir = make_path (config .swift_lib_dir , 'swift' , host_os )
558
+ 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
561
566
562
config .substitutions .append ( ('%llvm_obj_root' , config .llvm_obj_root ) )
567
563
config .substitutions .append ( ('%swift-bin-dir' , config .swift_bin_dir ) )
0 commit comments