-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wasm] Add WASILibc module and its build support #66539
[wasm] Add WASILibc module and its build support #66539
Conversation
@swift-ci Please smoke test |
@swift-ci build toolchain |
@kateinoigakukun, do you mind updating this to remove the |
I just tried switching glibc.modulemap to listing the Bionic headers directly and most everything from the compiler validation suite kept working on my Android phone. However, it broke around 70 C++ Interop tests that worked before with the
This has to do with the two different @egorzhdan, how do you work around this: don't have any libc++ headers that forward to libc headers in the C++ modulemap? The other failure is some oddity related to
@kateinoigakukun, I don't know if you run these C/C++ interop tests on wasm, but everything else in the validation suite worked for me. I can slap up my libc modulemap changes if you guys are interested in trying it with your libc's, particularly @3405691582 and @mhjacobson with the BSDs and maybe @stevapple with Windows. |
I've submitted my glibc modulemap changes in #66665, you may want to try something similar with wasi-libc and see if it works. |
[wasi-libc](https://github.com/WebAssembly/wasi-libc) is a libc implementation widely used in WASI toolchains. This patch adds a new module named WASILibc. Some extra emulation libraries are also added as wasi_emulated_xxx.
aa845fb
to
643c7c8
Compare
Nice, working well with the headers listed in the module map, @kateinoigakukun? @egorzhdan, please review. |
@swift-ci Please smoke test |
@swift-ci build toolchain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
wasi-libc is a libc implementation widely used in WASI toolchains. This patch adds a new Swift and C module for it to import and use it in Swift code. This module is intentionally separate from the existing
Glibc
module because wasi-libc is actually based on musl libc.This PR changed ClangImporter also to inject the modulemap and auxiliary header for wasi-libc into VFS to recognize it as well as Glibc.