Skip to content

Commit 2a8d1b0

Browse files
committed
Add MUTABLE_GLOBALS to feature_matrix
This is needed by dynamic linking since GOT entries are all imported as mutable globals. The net effect of this is that you cannot actually target the oldest version of safari that we support (12) and with dynamically linked programs. Specifying `-sLEGACY_VM_SUPPORT` will give you safari 13.1 instead of 12 if you also using `-sMAIN_MODULE`.
1 parent 7fb8817 commit 2a8d1b0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

test/test_other.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,9 @@ def test_exclude_file(self):
20152015
def test_dylink_strict(self):
20162016
self.do_run_in_out_file_test('hello_world.c', cflags=['-sSTRICT', '-sMAIN_MODULE=1'])
20172017

2018+
def test_dylink_legacy(self):
2019+
self.do_run_in_out_file_test('hello_world.c', cflags=['-sLEGACY_GL_EMULATION', '-sMAIN_MODULE=2'])
2020+
20182021
def test_dylink_exceptions_and_assertions(self):
20192022
# Linking side modules using the STL and exceptions should not abort with
20202023
# "function in Table but not functionsInTableMap" when using ASSERTIONS=2

tools/feature_matrix.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232

3333
class Feature(IntEnum):
34+
MUTABLE_GLOBALS = auto()
3435
NON_TRAPPING_FPTOINT = auto()
3536
SIGN_EXT = auto()
3637
BULK_MEMORY = auto()
@@ -48,6 +49,12 @@ class Feature(IntEnum):
4849
enable_override_features = set()
4950

5051
min_browser_versions = {
52+
Feature.MUTABLE_GLOBALS: {
53+
'chrome': 74,
54+
'firefox': 61,
55+
'safari': 130100,
56+
'node': 120000,
57+
},
5158
Feature.NON_TRAPPING_FPTOINT: {
5259
'chrome': 75,
5360
'firefox': 65,
@@ -213,6 +220,8 @@ def apply_min_browser_versions():
213220
enable_feature(Feature.BULK_MEMORY, 'pthreads')
214221
elif settings.WASM_WORKERS or settings.SHARED_MEMORY:
215222
enable_feature(Feature.BULK_MEMORY, 'shared-mem')
223+
if settings.RELOCATABLE:
224+
enable_feature(Feature.MUTABLE_GLOBALS, 'dynamic linking')
216225
if settings.MEMORY64 == 1:
217226
enable_feature(Feature.MEMORY64, 'MEMORY64')
218227
if settings.EXPORT_ES6 and settings.PTHREADS:

0 commit comments

Comments
 (0)