emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Add an option to support big-endian machines

Open miladfarca opened this issue 5 years ago • 32 comments

Hello,

It seems like Big Endian machines are not able to use emscripten, as assertions are added in this commit: https://github.com/emscripten-core/emscripten/commit/f178541b91624d0f9d02da8fc9884b38684f3d39

Runtime error: expected the system to be little-endian!

I understand that there are problems when it comes to "Typed Arrays" in Javascript since they are endianness dependent, however, WebAssembly is little endian enforced. Runtime compilers such as Google V8 are compatible with running wasm (LE) binary code on BE machines.

Is the above assertion for endianness only done when generating regular js code (such as asm.js) or it also checks when compiling to WebAssembly? In the case of wasm, would it be possible to continue with LE compilation even on BE machines? (I'm assuming assertions are only done during compilation to JS or to WASM and emscripten isn't concerned with how the generated output gets executed?).

miladfarca avatar Sep 30 '20 22:09 miladfarca