Skip to content

Commit a06dc0e

Browse files
[wasm] Repair build for recent SwiftDriver linkage changes
- Before f34d388, the EarlySwiftDriver used Dispatch/Foundation from old host toolchain at the initial "build" step, and then re-linked the just built Dispatch/Foundation at "install" step. - WasmStdlib product incorrectly set `BOOTSTRAPPING_MODE` to `HOSTTOOLS` and it makes `SwiftSource.cmake` set `LD_LIBRARY_PATH` to load the Dispatch/Foundation from the just built toolchain (SWIFT_NATIVE_SWIFT_TOOLS_PATH). After f34d388, the EarlySwiftDriver always uses the corelibs of the old host toolchain, so setting `LD_LIBRARY_PATH` leads to loading incompatible corelibs of the old host toolchain, and the build fails. This change tells the CMake build system to use CROSSCOMPILE mode. We already built the toolchain for the current host from the revision being built for the target, so we don't need to inject the lib library of the old host toolchain.
1 parent c7c244e commit a06dc0e

File tree

1 file changed

+2
-0
lines changed
  • utils/swift_build_support/swift_build_support/products

1 file changed

+2
-0
lines changed

utils/swift_build_support/swift_build_support/products/wasmstdlib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def _build(self, host_target, target_triple):
6161
'SWIFT_NATIVE_SWIFT_TOOLS_PATH:STRING', os.path.join(toolchain_path, 'bin'))
6262
self.cmake_options.define(
6363
'SWIFT_NATIVE_LLVM_TOOLS_PATH:STRING', os.path.join(toolchain_path, 'bin'))
64+
self.cmake_options.define(
65+
'BOOTSTRAPPING_MODE:STRING', 'CROSSCOMPILE')
6466
self.cmake_options.define(
6567
'SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER:BOOL', 'FALSE')
6668
self.cmake_options.define('SWIFT_WASI_SYSROOT_PATH:STRING',

0 commit comments

Comments
 (0)