Skip to content

[WebAssembly] enable shims and stubs for WASI#29505

Merged
compnerd merged 3 commits into
swiftlang:masterfrom
swiftwasm:swiftwasm-shims
Jan 29, 2020
Merged

[WebAssembly] enable shims and stubs for WASI#29505
compnerd merged 3 commits into
swiftlang:masterfrom
swiftwasm:swiftwasm-shims

Conversation

@MaxDesiatov
Copy link
Copy Markdown
Contributor

Adds #if defined(__wasi__) in stdlib/public/stubs and implements _swift_stdlib_getUnsafeArgvArgc to fix corresponding code when compiling for WASI.

This is a part of SR-9307 and #24684.

(cc @kateinoigakukun)

@MaxDesiatov MaxDesiatov requested a review from gribozavr January 28, 2020 14:41
Comment thread stdlib/public/stubs/Random.cpp Outdated

#if defined(__wasi__)
#include <algorithm> // required for std::min
#endif
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just make this unconditional. This is inside the implementation, so it is fine.

Comment thread stdlib/public/stubs/Stubs.cpp Outdated
#if defined(_WIN32)
_unlock_file(stdout);
#elif defined(__wasi__)
// WebAssembly/WASI doesn't support file locking yet
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a JIRA issue for supporting threading/locking on WASI and reference it here.

@MaxDesiatov MaxDesiatov requested a review from compnerd January 28, 2020 18:30
@compnerd
Copy link
Copy Markdown
Member

@swift-ci please smoke test

@compnerd compnerd merged commit 44a6475 into swiftlang:master Jan 29, 2020
@MaxDesiatov MaxDesiatov deleted the swiftwasm-shims branch January 29, 2020 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants