emscripten-core / emscripten-core/emscripten

Add an option to support big-endian machines

Open
#12,387 34 comments 0 reactions 0 assignees View on GitHub
good first bug help wanted
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.