Skip to content

Commit d23be6e

Browse files
committed
[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
1 parent d2efb5e commit d23be6e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

utils/build-script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,6 +2173,7 @@ iterations with -O",
21732173

21742174
# Prepare and validate toolchain
21752175
toolchain = host_toolchain(xcrun_toolchain=args.darwin_xcrun_toolchain)
2176+
os.environ['TOOLCHAINS'] = args.darwin_xcrun_toolchain
21762177

21772178
if args.host_cc is not None:
21782179
toolchain.cc = args.host_cc

0 commit comments

Comments
 (0)