Commit Graph

5084 Commits

Author SHA1 Message Date
Syrus Akbary
e207c7f17d
Update LICENSE 2020-03-02 11:08:21 -08:00
Syrus Akbary
51084ec8fb
Update README.md 2020-02-29 09:47:00 -08:00
Syrus Akbary
5d55c69441
Update README.md 2020-02-29 09:41:31 -08:00
Syrus Akbary
2fe2bb9070
Update README.md 2020-02-29 09:39:53 -08:00
Syrus Akbary
b7231775bc
Update README.md 2020-02-29 09:36:41 -08:00
Syrus Akbary
527ac41415
Small improvements to README 2020-02-29 09:35:45 -08:00
Syrus Akbary
d647ac3023
Merge pull request #1252 from wasmerio/wasi-mapdir
Allow / in mapdir wasm path
2020-02-29 09:17:00 -08:00
Syrus
f8b206d438 Added changes into changelog 2020-02-29 08:49:38 -08:00
Syrus
7a88a320c7 Allow / in mapdir wasm path 2020-02-29 08:47:25 -08:00
Syrus
3f456db4ad Updated headers 2020-02-29 08:45:48 -08:00
Syrus
4c19cd65e8 Add capi in ARM 2020-02-29 08:45:24 -08:00
Syrus
80f7e98651 Moved build wapm into Makefile 2020-02-28 11:11:31 -08:00
bors[bot]
85a3bb7148
Merge #1244
1244: feat(interface-types) Update to last standard version r=MarkMcCaskey a=Hywan

WIP

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-02-28 18:35:28 +00:00
bors[bot]
a13a897495
Merge #1212
1212: Add support for GDB JIT debugging r=MarkMcCaskey a=MarkMcCaskey

This PR adds support for JIT debugging to Wasmer with the Cranelift backend using a fork of `wasmtime-debug`.

The motivation for this change is partially inspired by the feature in Wasmtime and the implementation is largely derived from Wasmtime's `wasmtime-debug` crate and not included in this PR.  This implementation is currently Cranelift-only (if LLVM has value tracking we can add this there too without too much effort; we'd have to do the value tracking ourselves in Singlepass and I don't have enough context to know how hard that would be) and is based on a generic fork of the `wasmtime-debug` -- which will be published and uploaded in another repo.

This PR started out implementing the [Wasm-DWARF](https://yurydelendik.github.io/webassembly-dwarf/) reading and writing with gimli but after working on it for a few days, reading a chunk of the DWARF spec, seeing that Wasmtime had solved this well, and realizing how long this would likely take, I decided that it didn't make sense to spend the engineering effort there so I made a copy of `wasmtime-debug` and removed some of the less portable Cranelift pieces (very minor changes) and all code relying on data structures from wasmtime.  The resulting crate is completely generic and would work fine with Wasmtime or any other Wasm runtime at the cost of requiring some `transmute`s or a linear pass over the debug data to reconstruct it in terms of the new types exposed by the fork.  Perhaps there's a cleaner way to handle that that I haven't considered.

The integration with the GDB JIT interface is from the LLVM examples (I don't remember if I properly attributed everything in this PR/version of the code -- I still have the other branches locally though which I'll review before shipping this) and some of the code in this PR is from Wasmtime/Cranelift source code such as the sorting of the `ebb`s in `clif_backend::resolver`.  I spent a long time debugging some subtle bugs and ended up using a few things from Wasmtime's integration with `wasmtime-debug` and some bits from `cranelift-wasm` and `cranelift-codegen`.

If there's interest from other people in working on the generic `wasmtime-debug` fork, I'm happy to get other maintainers involved and/or move it to a shared organization.

Special thanks to [Yury Delendik](https://github.com/yurydelendik) and the other `wasmtime-debug` authors for their work on Wasm debugging.  Also shout out to Cranelift for the nice API for tracking variables/data.

### TODO:
- [x] Update attributions file for LLVM, [wasm-dwarf](https://github.com/yurydelendik/wasm-dwarf), and Wasmtime/Cranelift and do another pass over code to make sure we're in compliance with the licenses from the relevant projects and have properly attributed the code used from other projects.
- [x] Adjust API of wasm-debug based on feedback
- [x] Discuss with Nick integration with LLVM
- [x] Discuss with Heyang integration with Singlepass
- [x] Adjust implementation based on feedback from team (traits modified, etc.)
- [x] Clean up some pointer wrangling code
- [x] Add opt-in feature to wasmer-runtime-core to enale wasm-debug so library users who won't use debug info are not affected

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-02-27 22:23:22 +00:00
Mark McCaskey
91808b9df2 Update test-rest to explicitly test each crate 2020-02-27 14:22:26 -08:00
Mark McCaskey
0593965459 Make gdb jit symbol weak linking default in llvm-backend features 2020-02-26 19:41:53 -08:00
Mark McCaskey
b5cbb9df60 Fix test and build for musl 2020-02-26 19:07:30 -08:00
Mark McCaskey
dbb2ececf8 Work around unstable linkage attribute 2020-02-26 18:32:40 -08:00
Mark McCaskey
a089cf5a0c Link GDB JIT exposed global and fn as "linkonce"
This is required because LLVM exposes its own
2020-02-26 18:05:24 -08:00
Mark McCaskey
3691c80b7d Add generate_debug_info field to test 2020-02-26 17:29:18 -08:00
Mark McCaskey
0c8464e3bc Update changelog entry for gdb jit PR 2020-02-26 16:59:10 -08:00
Mark McCaskey
56e47c17b0 Revert Wasm parsing to improved old style, fixing singlepass 2020-02-26 16:35:25 -08:00
Mark McCaskey
cb20cd9b2d Merge branch 'master' into feature/debug-prototype2 2020-02-26 14:39:02 -08:00
Syrus Akbary
73370b9de9
Merge pull request #1250 from wasmerio/feature/update-wasmparser
Update wasmparser to 0.51.3 and clif forks to 0.59
2020-02-26 14:05:27 -08:00
Mark McCaskey
a8b4f2a1e4 Update clif option string, fix table parsing to match AnyFunc 2020-02-26 13:25:41 -08:00
Mark McCaskey
0a92d9c65e Update LLVM backend to wasmparser 0.51.3 2020-02-26 13:07:31 -08:00
Mark McCaskey
21fd95d760 Update wasmparser to 0.51.3 and clif forks to 0.59 2020-02-26 12:51:56 -08:00
Ivan Enderlin
c0933c52ca feat(interface-types) Fix clippy errors and warnings. 2020-02-26 17:02:52 +01:00
Ivan Enderlin
bff63e3fad Merge branch 'master' into feat-interface-types-update-to-last-standard-version 2020-02-26 16:22:56 +01:00
Ivan Enderlin
4e82d59ea1 feat(interface-types) Implement lifting and lowering instructions.
List from https://github.com/WebAssembly/interface-types/blob/master/proposals/interface-types/working-notes/instr.md.
2020-02-26 16:20:39 +01:00
Ivan Enderlin
f951b6aa53 feat(interface-types) Remove abandonned instructions. 2020-02-26 15:48:00 +01:00
Ivan Enderlin
350a30507f fix(interface-types) arg.get's index is of type u32. 2020-02-26 15:42:29 +01:00
Ivan Enderlin
3653c42e23 test(interface-types) Test adapter to binary. 2020-02-26 15:38:59 +01:00
Ivan Enderlin
4b7cd3a875 doc(interface-types) Fix a typo. 2020-02-26 15:34:04 +01:00
Ivan Enderlin
45283d4f52 test(interface-types) Fix all tests based on previous commits. 2020-02-26 15:32:14 +01:00
Mark McCaskey
52d4dac450 Rename feed_event's loc to source_loc 2020-02-25 17:15:17 -08:00
Mark McCaskey
6f5ebb564c Allow building clif-backend without wasm-debug 2020-02-25 17:08:09 -08:00
bors[bot]
6059c04630
Merge #1220
1220: chore(deps): bump smallvec from 0.6.13 to 1.2.0 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.2.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/servo/rust-smallvec/releases">smallvec's releases</a>.</em></p>
<blockquote>
<h2>v1.2.0</h2>
<ul>
<li><code>IntoIter</code> now implements <code>Debug</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/196">#196</a>).</li>
<li><code>smallvec!</code> macro is now easier to use in <code>no_std</code> contexts where the <code>vec!</code> macro isn't automatically imported (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/198">#198</a>).</li>
</ul>
<h2>v1.1.0</h2>
<ul>
<li>Added new method <code>SmallVec::into_boxed_slice</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/190">#190</a>).</li>
<li>Added new methods <code>IntoIter::as_slice</code> and <code>as_mut_slice</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/182">#182</a>).</li>
<li><code>IntoIter</code> now implements <code>Clone</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/192">#192</a>).</li>
<li>Improved documentation and testing (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/186">#186</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/189">#189</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/193">#193</a>).</li>
<li>Minor code cleanups (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/176">#176</a>).</li>
</ul>
<h2>v1.0.0</h2>
<ul>
<li>Requires Rust 1.36 or later.</li>
<li>[breaking change] Use <code>MaybeUninit</code> to avoid possible undefined behavior (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/162">#162</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/170">#170</a>).</li>
<li>[breaking change] The <code>drain</code> method now takes a range argument, just like the standard <code>Vec::drain</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/145">#145</a>).</li>
<li>[breaking change] Remove the <code>unreachable</code> function and replace it with the new standard <code>unreachable_unchecked</code> function (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/164">#164</a>).</li>
<li>[breaking change] Use <code>no_std</code> by default. This crate depends only on <code>core</code> and <code>alloc</code> by default. If the optional <code>write</code> feature is enabled then it depends on <code>std</code> so that <code>SmallVec&lt;[u8;_]&gt;</code> can implement the <code>std::io::Write</code> trait (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/173">#173</a>).</li>
<li>[breaking change] Remove the deprecated <code>VecLike</code> trait (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/165">#165</a>).</li>
<li>Add support for 96-element small vectors, <code>SmallVec&lt;[T; 96]&gt;</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/163">#163</a>).</li>
<li>Iterators now implement <code>FusedIterator</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/172">#172</a>).</li>
<li>Indexing now uses the standard <code>SliceIndex</code> trait (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/166">#166</a>).</li>
<li>Add automatic fuzz testing and MIRI testing (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/168">#168</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/162">#162</a>).</li>
<li>Update syntax and formatting to Rust 2018 standard (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/174">#174</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/167">#167</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="08b82495c0"><code>08b8249</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/199">#199</a> - mbrubeck:bump, r=emilio</li>
<li><a href="04d54bd9ca"><code>04d54bd</code></a> Version 1.2.0</li>
<li><a href="ea0dbc89c5"><code>ea0dbc8</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/198">#198</a> - mbrubeck:macro, r=jdm</li>
<li><a href="74e9319b47"><code>74e9319</code></a> Use full path to vec! in smallvec! macro</li>
<li><a href="6e61239a2a"><code>6e61239</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/196">#196</a> - Nemo157:intoiter-debug, r=mbrubeck</li>
<li><a href="a4ed1b854f"><code>a4ed1b8</code></a> impl Debug for IntoIter</li>
<li><a href="34d7b8d8e2"><code>34d7b8d</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/193">#193</a> - mbrubeck:bump, r=emilio</li>
<li><a href="436dedbd50"><code>436dedb</code></a> Version 1.1.0</li>
<li><a href="19048d5270"><code>19048d5</code></a> Add a simple example to the README</li>
<li><a href="941d6aae0f"><code>941d6aa</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/192">#192</a> - L0uisc:clone-into-iter, r=mbrubeck</li>
<li>Additional commits viewable in <a href="https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.2.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=smallvec&package-manager=cargo&previous-version=0.6.13&new-version=1.2.0)](https://dependabot.com/compatibility-score/?dependency-name=smallvec&package-manager=cargo&previous-version=0.6.13&new-version=1.2.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-02-24 21:53:50 +00:00
dependabot-preview[bot]
1bc6565935
chore(deps): bump smallvec from 0.6.13 to 1.2.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.2.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-24 21:45:50 +00:00
bors[bot]
c183a187ca
Merge #1246
1246: Prepare for 0.14.1 release r=MarkMcCaskey a=MarkMcCaskey

0.14.1 differs from 0.14.0 primarily in that the GNU/Linux build is
built on Ubuntu 16.04 instead of 18.04, meaning we'll use an earlier
version of GLIBC.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-24 21:21:21 +00:00
Mark McCaskey
ce21910077 Prepare for 0.14.1 release
0.14.1 differs from 0.14.0 primarily in that the GNU/Linux build is
built on Ubuntu 16.04 instead of 18.04, meaning we'll use an earlier
version of GLIBC.
2020-02-24 13:20:12 -08:00
bors[bot]
077d81f2bb
Merge #1245
1245: Revert change of Ubuntu 18.04 to 16.04 r=MarkMcCaskey a=MarkMcCaskey

I didn't document why I changed it to 18.04 in #1163 ; making this PR to run CI and find out why.

It looks like CI is passing!  I have no idea why I updated to 18.04.  Perhaps I misread [the support table](https://wiki.ubuntu.com/Releases) and thought 16.04 no longer had standard support.

Either way, this PR seems good to merge.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-24 19:37:47 +00:00
Mark McCaskey
f3d4b56746 Revert change of Ubuntu 18.04 to 16.04 2020-02-24 11:05:09 -08:00
Ivan Enderlin
0c5d46eec9 feat(interface-types) Re-implement interface kinds.
Adopt a flat structure: Flat resolved imports, flat resolved exports,
flat resolved types etc.

Also, use the latest textual format for adapters & co.
2020-02-24 18:12:01 +01:00
Ivan Enderlin
c64febdad6 feat(interface-types) Re-implement Type.
The semantics of “types” have changed since the previous draft. Now, a
type is like a regular WebAssembly type but with Interface Types.
2020-02-24 16:23:31 +01:00
Ivan Enderlin
d1ed647efc feat(interface-types) Forwarded adapters have been removed. 2020-02-24 15:56:11 +01:00
Ivan Enderlin
8538e3be33 feat(interface-types) The “helper adapter” has been removed. 2020-02-24 15:49:03 +01:00
Ivan Enderlin
ac68325cc9 feat(interface-types) Update interface types.
According to the last working notes, new interface types are s8, s16,
s32, s64, u8, u16, u32, u64, f32, f64, string, anyref, i32, and i64.

Their binary reprensentations are changing too, from 0x00 to 0x0d.
2020-02-24 15:37:03 +01:00
Syrus Akbary
ad04e07c67
Merge pull request #1243 from wasmerio/dependabot/cargo/hex-0.4.2
Bump hex from 0.4.1 to 0.4.2
2020-02-24 00:33:32 -08:00
Syrus Akbary
30dc9a18ba
Merge pull request #1242 from wasmerio/dependabot/cargo/libc-0.2.67
Bump libc from 0.2.66 to 0.2.67
2020-02-24 00:33:00 -08:00