Add WebAssembly to core.stdc.config#22844
Conversation
|
Thanks for your pull request and interest in making D better, @IDONTUSEGH! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#22844" |
|
When I added stdc definitions for WebAssembly, I was told that it's the C runtime (e.g. WASI) instead of the architecture (WASM) dictating C types: dlang/druntime#3848
What source do you have for these definitions being correct for WebAssembly in general? |
|
This is needed because LDC imports that module for ImportC. WASI adopts the data model of the underlying WebAssembly architecture it is compiled for, hence why I copied the version block, and I confirmed with: https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md The feedback on that PR refers to runtime specific libc definitions. My PR is the exception because it just defines the fundamental C types. I think yours would have been accepted if it'd have just been that. |
|
That document says:
|
|
I also think it's fine to just assume LLVM backend conventions since there are no other D compilers targeting WebAssembly currently, but then we could also just replace the |
|
If unsure, ask feedable in #gcc on OFTC, who's doing the gcc port. But otherwise likely nothing worth blocking. |
|
Also note that |
|
For clarity, here for this PR, I suggest simply renaming the existing WASI block to WebAssembly, ideally including a link to https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md#data-representation. It's a copy of the earlier Posix block anyway, and GCC has its own leading |
Added a version(WebAssembly) block to provide the correct C compatible
type aliases.
This is a copy of the WASI block.