WebAssembly / tool-conventions

Conventions supporting interoperatibility between tools working with WebAssembly.
Artistic License 2.0
297 stars 65 forks source link

Is the LLVM Dynamic Linking Implementation Status Inaccurate? #192

Closed zicklag closed 1 year ago

zicklag commented 1 year ago

This section seems to indicate that you can create shared libraries with LLVM:

https://github.com/WebAssembly/tool-conventions/blob/79d4b069951edf50546ba8d2f2ecdef24301b7a1/DynamicLinking.md?plain=1#L215-L220

But in the LLD Docs it says:

No support for creating shared libraries. The spec for shared libraries in WebAssembly is still in flux: https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md

sunfishcode commented 1 year ago

The top of DynamicLinking.md says:

This document describes the current WebAssembly dynamic linking ABI used by emscripten and by the llvm backend when targeting emscripten.

Note: This ABI is still a work in progress. There is no stable ABI yet.

This is accurate at this time.

zicklag commented 1 year ago

Thanks, I think I just misunderstood the note in the docs: when it said there's "no support" that doesn't mean it can't do it, it just mean's it's unstable ( not supported ).

kripken commented 1 year ago

Side note, I recently learned of another toolchain that uses the wip dynamic linking in the emscripten triple,

https://github.com/sagemathinc/cowasm/discussions/44#discussioncomment-4182501

Maybe a motivation for thinking about standardization sooner than later?

sunfishcode commented 1 year ago

A lot of it comes down to maintenance cost.

I believe the future we want to be working toward is a dynamic linking scheme as outlined here.

If we "standardize" something before we're ready to go there, it will take more work to get there because it'll have maintenance costs even for those of us who aren't using it, and we'll need some kind of transition plan when we are ready. If we had a large community of people stepping up to help maintain things and plan out the future migration, it might look different, but as things are right now, I don't think it makes sense.