emscripten-core/emscripten

Add an option to support big-endian machines

开放

#12,387 创建于 2020年9月30日

 (34 条评论) (0 个反应) (0 位负责人)C++ (3,519 个派生)batch import
good first bughelp wanted

仓库指标

星标
 (27,361 个星标)
PR 合并指标
 (平均合并 19天 10小时) (30 天内合并 147 个 PR)

描述

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

贡献者指南