Skip to content

Enable compilation on BE host machines #17428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/emcc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ Environment variables

* "EMCC_SKIP_SANITY_CHECK" [general]

* "EMCC_SUPPORT_BIG_ENDIAN" [general]

* "EM_IGNORE_SANITY" [general]

* "EM_CONFIG" [general]
Expand Down
6 changes: 0 additions & 6 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,6 @@ var DECLARE_ASM_MODULE_EXPORTS = true;
// [compile]
var INLINING_LIMIT = false;

// If set to 1, perform acorn pass that converts each HEAP access into a
// function call that uses DataView to enforce LE byte order for HEAP buffer;
// This makes generated JavaScript run on BE as well as LE machines. (If 0, only
// LE systems are supported). Does not affect generated wasm.
var SUPPORT_BIG_ENDIAN = false;

// Check each write to the heap, for example, this will give a clear
// error on what would be segfaults in a native build (like dereferencing
// 0). See runtime_safe_heap.js for the actual checks performed.
Expand Down
9 changes: 9 additions & 0 deletions tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ def read_js_settings(filename, attrs):
if 'EMCC_STRICT' in os.environ:
self.attrs['STRICT'] = int(os.environ.get('EMCC_STRICT'))

# If set, perform acorn pass that converts each HEAP access into a function
# call that uses DataView to enforce LE byte order for HEAP buffer; This
# makes generated JavaScript run on BE as well as LE machines. (If 0, only
# LE systems are supported). Does not affect generated wasm.
if 'EMCC_SUPPORT_BIG_ENDIAN' in os.environ:
self.attrs['SUPPORT_BIG_ENDIAN'] = int(os.environ.get('EMCC_SUPPORT_BIG_ENDIAN'))
else:
self.attrs['SUPPORT_BIG_ENDIAN'] = 0

# Special handling for LEGACY_SETTINGS. See src/setting.js for more
# details
for legacy in self.attrs['LEGACY_SETTINGS']:
Expand Down