Skip to content

Commit a75e790

Browse files
committed
Explicitly set bulk memory clang flag
1 parent ebcb003 commit a75e790

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

emcc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from subprocess import PIPE
3636

3737

38-
from tools import shared, system_libs, utils, ports
38+
from tools import shared, system_libs, utils, ports, feature_matrix
3939
from tools import colored_logger, diagnostics, building
4040
from tools.shared import unsuffixed, unsuffixed_basename, get_file_suffix
4141
from tools.shared import run_process, exit_with_error, DEBUG
@@ -853,6 +853,14 @@ def phase_setup(options, state, newargs):
853853
if settings.SHARED_MEMORY:
854854
settings.BULK_MEMORY = 1
855855

856+
if '-mbulk-memory' not in newargs and '-mno-bulk-memory' not in newargs:
857+
print('newargs bulk')
858+
if feature_matrix.caniuse(feature_matrix.Feature.BULK_MEMORY):
859+
newargs += ['-mbulk-memory']
860+
settings.BULK_MEMORY = 1
861+
else:
862+
newargs += ['-mno-bulk-memory']
863+
856864
if 'DISABLE_EXCEPTION_CATCHING' in user_settings and 'EXCEPTION_CATCHING_ALLOWED' in user_settings:
857865
# If we get here then the user specified both DISABLE_EXCEPTION_CATCHING and EXCEPTION_CATCHING_ALLOWED
858866
# on the command line. This is no longer valid so report either an error or a warning (for

tools/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@
9696
'WASM_OBJECT_FILES',
9797
'WASM_WORKERS',
9898
'BULK_MEMORY',
99+
'MIN_SAFARI_VERSION',
100+
'MIN_CHROME_VERSION',
101+
'MIN_FIREFOX_VERSION',
102+
'MIN_NODE_VERSION',
99103

100104
# Internal settings used during compilation
101105
'EXCEPTION_CATCHING_ALLOWED',

0 commit comments

Comments
 (0)