Commit Graph

22 Commits

Author SHA1 Message Date
Ximin Luo
f497c1d131 New upstream version 0.0~git20210922.ad51334 2022-03-06 21:16:47 +00:00
Alex Crichton
2b7e73ae7a
Update to the next version of the witx crate (#234)
* Update to the next version of the `witx` crate

* Generate adapter functions instead of simply a header file to have a
  place where adapter code can go.
* Implement adapters in terms of the instructions that the `witx` crate
  tells us about.
* Update the interface of functions to what `witx` expects, notably
  string arguments are now only taken as `char*` and `strlen` happens in
  the adapter function.
* Update defined/predefined/undefined symbol lists for types that have
  been updated.

Some precise generated code has changed but the actual APIs should all
be the same except for the change to not take the length of the string
in the raw WASI call, since idiomatically C doesn't pass the length of
strings around.

Eventually it's expected that the shim functions, while sometimes not
necessary today, will implement more checks and more conversions as
necessary for new APIs.

* Actually update witx submodule

* Comment how to regenerate files

* Tweak name of actual function imports

Make it a bit clearer that they're the ones that we're importing and
calling.

* Update submodule to point to WebAssembly
2021-02-23 12:18:56 -06:00
Ximin Luo
130d22db7b New upstream version 0.0~git20200731.215adc8 2020-09-04 17:27:57 +01:00
Ximin Luo
e176eadaa1 New upstream version 0.0~git20200319.9efc2f4 2020-07-04 17:24:08 +01:00
Ximin Luo
65248e3c40 New upstream version 0.0~git20200114.1fad338 2020-04-04 02:51:31 +01:00
Pat Hickey
e2bdce89ea gen-headers: make handle output consistient with prior 2020-04-02 15:54:40 -07:00
Pat Hickey
fcbf8f40ea wasi submodule: point to latest (witx 0.8.5 release) 2020-04-02 15:54:40 -07:00
Dan Gohman
0cc57ac7b4
Multi-license wasi-libc under Apache and MIT licenses. (#174)
Multi-license wasi-libc under the Apache-2.0 WITH LLVM-exception,
Apache-2.0, and MIT licenses.
2020-02-29 10:52:28 +01:00
Pat Hickey
e1149ab067 point at WASI with tagged unions merged into master 2020-02-24 11:36:05 -08:00
Pat Hickey
ec63fd5e9c rebased wasi repo branch 2020-02-24 11:36:05 -08:00
Pat Hickey
b3c57f19a3 main: get more useful help by requiring subcommand
fake required arguments are no good
2020-02-24 11:36:05 -08:00
Pat Hickey
d415ae65e1 minor change in union AST in wasi- tag is namedtype 2020-02-24 11:36:05 -08:00
Pat Hickey
7f8930168f update to WASI where snashot event_u flattened to struct 2020-02-24 11:36:05 -08:00
Pat Hickey
4f03c9bbe7 WASI: tagged unions PR wip 2020-02-24 11:36:05 -08:00
Pat Hickey
71d279a4b0 wasi-headers: unions are tagged now 2020-02-24 11:36:05 -08:00
Pat Hickey
c6f2c0517f
gen-headers: Generate assertions of layout from witx (#149)
* use pch/layout branch for witx; generate assertions of layout

* address review comments, add asserts for handle

* change wasm32 support comment to a preprocessor error

* expose `to_c_header` in wasi-headers crate for use in external test harness

* main.rs: inputs and output arguments are optional

so that generate-libc command works

* regen header
2020-02-07 13:21:18 -08:00
Daniel Bevenius
37c663f2f0
Correct minor typo in c_headers.rs (#166)
The header api.h was update using the following command:
$ cd tools/wasi-headers
$ cargo run -- WASI/phases/snapshot/witx/typenames.witx \
  WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx \
  --output ../../libc-bottom-half/headers/public/wasi/api.h
2020-02-07 05:18:10 -08:00
Pat Hickey
ec86d4dec4
Improvements to wasi-headers tool (#160)
* wasi-headers: update WASI submodule, handle changes to witx ast

* wasi-headers: restructure lib and exe to be more flexible

just factor out some of the hard-coded stuff
2020-01-14 14:24:12 -08:00
Dan Gohman
dd010beea5
Avoid using cast expressions in WASI API constants. (#148)
Cast expressions aren't valid to use in some preprocessor constants, so
change the constants to use `UINT32_C` etc. instead of casts.

Fixes #146.
2019-12-16 13:29:06 -08:00
Pat Hickey
fe130532ae
c header generation updated for reorganized witx ast (#139) 2019-11-22 13:06:12 -05:00
Dan Gohman
cd74e1d988
Correct the version of #136 on master (#141)
* Add the WASI repo as a submodule.

Also, add the witx filenames to the generated output, and just have
`cargo run` auto-generate the api.h header, rather than using clap.

* Switch witx to a path dependency.

* Add a test.

* Add a test that the generated file is in sync with the generator.

* Enable CI testing with Github Actions.

* Fix the name of the wasi-headers directory.

* Enable submodules.

* Add a diff mechanism to help explain failures.

* Sort the inputs for display.

* More debugging.

* More debugging.

* Add a .gitattributes file forcing text files to be eol=lf.

Most editors these days can deal with eof=lf files, even on Windows, and
this avoids trouble with headers and other generated files differing in
line endings.
2019-11-21 20:55:26 -08:00
Dan Gohman
446cb3f1aa
Wasi snapshot preview1 (#140)
* Make __wasi_linkcount_t a uint64_t (#134)

Refs: https://github.com/WebAssembly/WASI/pull/127

* Generate the WASI interface from witx.

This replaces the hand-maintained <wasi/core.h> header with a
<wasi/api.h> generated from witx.

Most of the churn here is caused by upstream WASI renamings; hopefully
in the future ABI updates will be less noisy.
2019-11-21 20:06:00 -08:00