WASI icon indicating copy to clipboard operation
WASI copied to clipboard

Any resources on how to compile software with dependency?

Open zyongye opened this issue 5 years ago • 3 comments

Is there a recommended workflow for compile software with library dependencies, all written in C. I have a project, which can be compiled with autotools and a library, libevent, which can be compiled using autotools or cmake. I first use emscripten to compile the libevent using emconfigure and emmake to generate .wasm files. Since the software using socket so I want to link the library to the existing source code. I was stuck here so is there any solution for that?

zyongye avatar Aug 19 '20 20:08 zyongye

Sockets are not available in WASI yet, but there is a proposal in #312 that will likely be merged and available in runtimes in the near future.

I'm not aware of a WASI version of emconfigure/emmake, or if those will target WASI.

pchickey avatar Aug 20 '20 18:08 pchickey

@zyongye, I've written wasi-configure, wasi-make, and wasi-cmake scripts for some of my own projects: https://github.com/bcoin-org/libtorsion/tree/master/scripts . They mimic the emscripten scripts emconfigure, emmake, etc.

chjj avatar Aug 30 '20 22:08 chjj

@chjj Those scripts look useful! Would you be interested in having those scripts be hosted in the wasi-sdk repo?

In general we want to focus on getting the functionality we need in upstream clang (done), config (done) and cmake (not yet) directly rather than relying on scripts, but in the case of something like config.sub for example, we've already upstreamed the change, but not everyone has it yet, so the script which updates config.sub looks useful.

sunfishcode avatar Sep 21 '20 23:09 sunfishcode