Skip to content

Commit a392cbb

Browse files
authored
Avoid adding HEAP_DATA_VIEW to EXPORTED_RUNTIME_METHODS. NFC (#24064)
This symbol only exists when SUPPORT_BIG_ENDIAN is set.
1 parent 86b0baf commit a392cbb

File tree

7 files changed

+9
-7
lines changed

7 files changed

+9
-7
lines changed

src/modules.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ function exportRuntimeSymbols() {
436436
'wasmExports',
437437
'HEAPF32',
438438
'HEAPF64',
439-
'HEAP_DATA_VIEW',
440439
'HEAP8',
441440
'HEAPU8',
442441
'HEAP16',
@@ -447,6 +446,10 @@ function exportRuntimeSymbols() {
447446
'HEAPU64',
448447
];
449448

449+
if (SUPPORT_BIG_ENDIAN) {
450+
runtimeElements.push('HEAP_DATA_VIEW');
451+
}
452+
450453
if (PTHREADS && ALLOW_MEMORY_GROWTH) {
451454
runtimeElements.push(
452455
'GROWABLE_HEAP_I8',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6135
1+
6123
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16164
1+
16149

test/other/test_emit_tsd.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ declare namespace RuntimeExports {
1313
let wasmTable: WebAssembly.Table;
1414
let HEAPF32: any;
1515
let HEAPF64: any;
16-
let HEAP_DATA_VIEW: any;
1716
let HEAP8: any;
1817
let HEAPU8: any;
1918
let HEAP16: any;

test/other/test_emit_tsd_sync.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
declare namespace RuntimeExports {
33
let HEAPF32: any;
44
let HEAPF64: any;
5-
let HEAP_DATA_VIEW: any;
65
let HEAP8: any;
76
let HEAPU8: any;
87
let HEAP16: any;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
49940
1+
49920

tools/link.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,12 +963,13 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
963963
settings.EXPORTED_RUNTIME_METHODS.extend([
964964
'HEAPF32',
965965
'HEAPF64',
966-
'HEAP_DATA_VIEW',
967966
'HEAP8', 'HEAPU8',
968967
'HEAP16', 'HEAPU16',
969968
'HEAP32', 'HEAPU32',
970969
'HEAP64', 'HEAPU64',
971970
])
971+
if settings.SUPPORT_BIG_ENDIAN:
972+
settings.EXPORTED_RUNTIME_METHODS.append('HEAP_DATA_VIEW')
972973

973974
# Default to TEXTDECODER=2 (always use TextDecoder to decode UTF-8 strings)
974975
# in -Oz builds, since custom decoder for UTF-8 takes up space.

0 commit comments

Comments
 (0)