3 ms·
So if I'm understanding this correctly, Firefox compiles its dependencies as WASM, effectively blocking function calls to things it shouldn't and illegal memory
by Deukhoofd 5y ago
So if I'm understanding this correctly, Firefox compiles its dependencies as WASM, effectively blocking function calls to things it shouldn't and illegal memory access, and then translates it back to C so it can compile it normally? Sounds neat!
- fyrn- 5y agoNot back into C, from WASM to native executable / asm / object code
- bholley 5y agoDeukhoofd is correct — we compile the WASM code back into C in order to reuse and reduce friction with our existing compilation pipeline.
- wfh 5y agoHow does this compare with https://chromium-review.googlesource.com/c/chromium/src/+/2775240 https://chromium-review.googlesource.com/c/chromium/src/+/27... ?
- Hendrikto 5y agoThat was only for the prototype, the current implementation is: source code -> WASM -> C -> native code
- flohofwoe 5y agoThe solution described in the post actually translates C/C++ to WASM, and then translates the WASM bytecode back to C (via a tool called wasm2c), which is then fed back into the C compiler again to compile to native code, all 'offline' in the Firefox build process.