mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[build-script] Set the TOOLCHAINS variable in the environment.
On Darwin platforms, the Swift build scripts generally use "xcrun" to locate various tools, and the build-script's darwin-xcrun-toolchain option is specified to xcrun. However, with the change to use the just-built clang to build the runtime (PR #6112), there was an issue with the linker. Clang normally tries to run the linker from the same directory as the clang binary, but when there isn't one, it falls back on /usr/bin/ld, which is just an xcrun-like wrapper. Since there is no way to specify an explicit toolchain option in that case, set TOOLCHAINS in the environment to make it use the linker from the specified toolchain. rdar://problem/30709330
This commit is contained in:
@@ -2173,6 +2173,7 @@ iterations with -O",
|
||||
|
||||
# Prepare and validate toolchain
|
||||
toolchain = host_toolchain(xcrun_toolchain=args.darwin_xcrun_toolchain)
|
||||
os.environ['TOOLCHAINS'] = args.darwin_xcrun_toolchain
|
||||
|
||||
if args.host_cc is not None:
|
||||
toolchain.cc = args.host_cc
|
||||
|
||||
Reference in New Issue
Block a user