[PATCH] D158140: WIP: [clang-repl] Basic WebAssembly support for running inside a JS engine
Sam Clegg via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 23 08:36:32 PDT 2023
sbc100 added a comment.
Very nice idea!
================
Comment at: clang/lib/Interpreter/CMakeLists.txt:21
Value.cpp
+ WASM.cpp
----------------
Elsewhere in LLVM either use WebAssembly (spelled out). If you really prefer to keep it short you should use `Wasm` (not all caps).
Also, I wonder if we should call this `Emscripten` given that it seems emscripten specific.. then you could have another one called WASI or WebAssembly for the less specific one?
================
Comment at: clang/lib/Interpreter/WASM.cpp:79
+ int Result =
+ lld::wasm::link(LinkerArgs, llvm::outs(), llvm::errs(), false, false);
+ if (!Result)
----------------
argentite wrote:
> v.g.vassilev wrote:
> > I am not sure how we can solve that dependency here. Worst case scenario, could we check if `lld` is installed and make a system call?
> AFAIK we can't really `exec()` within Emscripten.
This looks its using the in-process call to the linker library, rather then an exec of the linker process.. which could work. But is it OK to have the compiler depend on the linker like this?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158140/new/
https://reviews.llvm.org/D158140
More information about the cfe-commits
mailing list