binji / wasm-clang

Running Clang/LLD in WebAssembly Demo
https://binji.github.io/wasm-clang
Apache License 2.0
259 stars 27 forks source link

clang compilation #9

Open gabonator opened 3 years ago

gabonator commented 3 years ago

How did you compile the clang into wasm? I am looking for a way how to cross compile C++ code into Arm M3 binary in browser and your project seems like good starting point for that.

binji commented 3 years ago

All the changes are pushed to https://github.com/binji/llvm-project. Unfortunately, I didn't write any notes about how I built it. All the changes are in the top commits here, though: https://github.com/binji/llvm-project/commits/master

Avdpro commented 2 years ago

Hi, I'm trying to make a in-web toolchain that build wasm. How do you configed the CMake to generate the llvm-project make file? It can't detect thread feature when I set the tool chain to wasi-sdk

binji commented 2 years ago

Hi @Avdpro, I can't quite remember how it all works, but I did have to hack threading a bit. Here's the change I made: https://github.com/binji/wasi-sdk/commit/b6e735e9968ddfecfdc49bc72ba5aed7bb83c600.

Note that it pulls in llvm-project with this dummy threading implementation: https://github.com/binji/llvm-project/compare/e3dc222bd3ce1060e82ab2a8f2802a18abac834c...d0dcf97cd262aaabfc0ede41a28a6bc5b57bb927#diff-bfbf4cf0dfd0f4dbf0f6f82a943db2687ea1da605808286d26a6d51289c989a8

Avdpro commented 2 years ago

THX! Will try it now