Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

WIP: [Swift+WASM] patches to support compiling Swift to WebAssembly #316

Draft
wants to merge 4 commits into
base: stable
Choose a base branch
from

Conversation

zhuowei
Copy link

@zhuowei zhuowei commented May 10, 2019

These are the Clang changes required to cross-compile Swift programs to WebAssembly.

List of changes:

  • enable Swift calling convention for WebAssembly
  • disable exceptions by default on WebAssembly, as WASI doesn't support it
  • enable the requisite wasi define manually, since swift-llvm is too old to support the WASI triple

See apple/swift#24684 for more information.

We're planning to upstream the first patch to upstream LLVM; the other two patches won't be needed when Swift updates its llvm/clang.

This removes the warning when attempting to compile a swiftcall function.

I'm not sure why https://reviews.llvm.org/D19414 didn't add this...
Too lazy to backport the Emscripten target to this version of LLVM
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant