Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate into WebAssembly.Studio #5

Open
mbebenita opened this issue Feb 8, 2018 · 4 comments
Open

Integrate into WebAssembly.Studio #5

mbebenita opened this issue Feb 8, 2018 · 4 comments

Comments

@mbebenita
Copy link

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?

@tbfleming
Copy link
Owner

It's worth exploring. How are you handling security issues server side? Executing user-defined gulp files seems dangerous.

@mbebenita
Copy link
Author

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.

@tbfleming
Copy link
Owner

Nice.

@shi-yan
Copy link

shi-yan commented Dec 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants