emscripten-core/emscripten

Add an option to support big-endian machines

Open

#12.387 aperta il 30 set 2020

Vedi su GitHub
 (34 commenti) (0 reazioni) (0 assegnatari)C++ (3519 fork)batch import
good first bughelp wanted

Metriche repository

Star
 (27.361 star)
Metriche merge PR
 (Merge medio 19g 10h) (147 PR mergiate in 30 g)

Descrizione

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?).

Guida contributor