Skip to content
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

Rust+WebAssembly Working Group Meeting #5 #149

Closed
fitzgen opened this issue Apr 19, 2018 · 8 comments
Closed

Rust+WebAssembly Working Group Meeting #5 #149

fitzgen opened this issue Apr 19, 2018 · 8 comments
Labels

Comments

@fitzgen
Copy link
Member

fitzgen commented Apr 19, 2018

Our next meeting will be Thursday, May 3rd at 16:00 UTC.

Add agenda items here: https://paper.dropbox.com/doc/RustWebAssembly-WG-dcXi5F7Bqlvg10zd7dKve

I will post a hangouts link to this thread and on IRC ~15 minutes before we begin.

Anyone interested in Rust and WebAssembly is invited to join! Yes, that includes you!

@fitzgen
Copy link
Member Author

fitzgen commented May 3, 2018

Reminder that this meeting is happening tomorrow! Add your agenda items :)

@xtuc
Copy link
Member

xtuc commented May 3, 2018

The time is perfect, i'll join this meeting.

I can answer this question I found in the agenda:

Wepback fixes are almost here, anything we can do to help them along?

First any feedback on the approach used would be great. I described the transformation here webpack/webpack#6433 (comment).

Currently we have a blocking issue, i'm working on https://github.com/xtuc/webassemblyjs/tree/master/packages/wasm-edit to improve the robustness of the tool (some binary + transformation are still failling).

@alexcrichton
Copy link
Contributor

Oh awesome thanks for the info @xtuc! Looking forward to seeing you soon :)

FWIW I don't think any of LLD/Clang/Rust have the ability to import a global right now. For example this IR:

@FOO = external global i32

define i32 @foo() {
start:
  %0 = load i32, i32* @FOO, align 4
  ret i32 %0
}

generates this final binary:

  (type (;0;) (func))
  (type (;1;) (func (result i32)))
  (func $__wasm_call_ctors (type 0))
  (func $foo (type 1) (result i32)
    i32.const 0
    i32.load)
  (table (;0;) 1 1 anyfunc)
  (memory (;0;) 2)
  (global (;0;) (mut i32) (i32.const 66560))
  (global (;1;) i32 (i32.const 66560))
  (global (;2;) i32 (i32.const 1024))
  (export "memory" (memory 0))
  (export "__heap_base" (global 1))
  (export "__data_end" (global 2))
  (export "foo" (func $foo)))

In that sense we'd at least be totally workable landing support for the two bugs we have today (not working in chrome and webpack-dev-server caching too aggressively). Once the toolchain has support for importing/exporting globals though I'd love to help out with test cases/fixes where possible!

@xtuc
Copy link
Member

xtuc commented May 3, 2018

@alexcrichton something like that WebAssembly/binaryen#1500?

In my free time I'm working on the support in LLVM and Clang. Rust could probably take advantage of it.

@alexcrichton
Copy link
Contributor

@xtuc I think that binaryen PR is interpreting the "assembly" (is that even the right name for it?) output of LLVM, right? We don't currently use s2wasm from binaryen or the wasm-linker, but rather we use LLVM's native object file format (sort-of wasm binary files) and LLD to link them together. In that sense I think it's different from your PR in that it's primarily adding support for things in binaryen but isn't dealing with LLVM/LLD (which would affect this)

Now it'd be awesome to get this working in LLVM/Clang for sure, this is a definite missing piece of functionality in Rust's wasm support today!

@xtuc
Copy link
Member

xtuc commented May 3, 2018

Yes that's correct, my PR only uses the textual LLVM IR output (.s) mostly because it's easier to test. I'm planning to add it to o2wasm in the future as well.

I haven't looked into the object files for the wasm target yet but we can probably add it to the metadata in order to behave correctly during linking (lld).

@fitzgen
Copy link
Member Author

fitzgen commented May 3, 2018

Hangouts link for this meeting: https://hangouts.google.com/call/vG6rIQOR0lQcHRMgZx5SAAEE

@fitzgen
Copy link
Member Author

fitzgen commented May 3, 2018

Thanks for participating in the meeting, everyone!

@fitzgen fitzgen closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants