cib
cib copied to clipboard
Integrate into WebAssembly.Studio
First of all, thanks for your efforts in bringing LLVM to the browser, great work.
The Clang format library from this project is being used in http://WebAssembly.studio. For now, compilation is done server side (in order to reduce code size) but we'd like to eventually do everything on the client.
Would you be interested in integrating these two projects more tightly?
It's worth exploring. How are you handling security issues server side? Executing user-defined gulp files seems dangerous.
Gulp (really a simple/basic re-implementation of the Gulp API in the browser) files are running client side. The server just invokes clang with sanitized input.
Nice.
the cib project doesn't work anymore with some recent browser update.
I'm trying to update it with llvm 10. So far I've got clang built into wasm. I was able to compile an empty main function.
But as soon as I include <iostream>, I will see lots of issues. The reason seems to be that llvm expects a file buffer being null terminated, but that's not true. Internally, llvm uses mmap to read in the files.
According to https://stackoverflow.com/questions/27096816/how-to-work-around-lack-of-nul-terminator-in-strings-returned-from-mmap
on x86, mmap is usually null terminated. But I suspect this is not true for the wasm case.
I wonder if you have seen something similar too? and have a solution already. Thanks.