Stream: general

Topic: exporting fns with imported globals


view this post on Zulip Jakub Konka (Jun 04 2020 at 15:19):

Here's a trick question that maybe someone could help me out with: does anyone know if it is possible to generate a lib-style Wasm from C/Rust (with LLVM as backend) where we export a function which makes use of an imported global variable? For some context, here are some gists with C, Rust and desired WAT sources: https://gist.github.com/kubkon/56ee4359fceeef469c9c0e58bf648292. Both Rust and C which AFAIK utilise wasm-ld behind the scenes don't seem to play ball here with me. I wanted to double check here before asking/submitting a potential bug in upstream LLVM. Oh, cc @Alex Crichton @Dan Gohman @fitzgen (he/him) perhaps you'll know more on this.

Import globals and export func that uses them. GitHub Gist: instantly share code, notes, and snippets.

view this post on Zulip Alex Crichton (Jun 04 2020 at 16:08):

@Jakub Konka currently, no

view this post on Zulip Alex Crichton (Jun 04 2020 at 16:08):

I don't think LLVM has any ability to import a custom global

view this post on Zulip Jakub Konka (Jun 04 2020 at 16:31):

That’s what I thought, thanks @Alex Crichton!


Last updated: Oct 23 2024 at 20:03 UTC