I'm new to c++ compiling, tooling, llvm and such. I'm exploring ways of compiling some c++ apps for the browser. I'm not looking for solutions that just run the c++ app. For those situation emscripten seems to be just right. I'm looking for ways to build a hybrid app that has a lot of touch-points between the javascript part and the c++ part.
I had success compiling and running some c/c++ apps using the wasi-sdk provided clang and llvm. But the llvm provided by wasi-sdk does not support threads.
The wasi-sdk offers a set of stdlib
that respect the wasi specification. This specification does not support multi-threading. Is there a way to add the pthreads from other stdlib
implementations and implement the javascript glue code by hand (maybe seeking inspiration from emscripten). If yes, what would be the steps? LLVM seems to be compiled without threads support in wasi-sdk, so simply adding additional headers that define pthreads might not work.