Skip to content

Commit 09a662a

Browse files
authored
Remove POLYFILL_OLD_MATH_FUNCTIONS setting (#23262)
These polyfills are only needed on ancient browser versions that there should be no need to support.
1 parent a2a13bd commit 09a662a

13 files changed

+10
-84
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ See docs/process.md for more on how version tagging works.
4848
`--post-js` files will now be delayed until after module creation and after
4949
`main` runs. This matches the existing behaviour when using sync instantation
5050
(`-sWASM_ASYNC_COMPILATION=0`) but is an observable difference. (#23157)
51+
- The `POLYFILL_OLD_MATH_FUNCTIONS` setting was removed. The browser versions
52+
that require these polyfills are no longer supported by emscripten so the
53+
polyfills should never be needed. (#23262)
5154

5255
3.1.74 - 12/14/24
5356
-----------------

src/preamble.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,6 @@ function addOnPostRun(cb) {
328328
__ATPOSTRUN__.unshift(cb);
329329
}
330330

331-
#include "runtime_math.js"
332-
333331
// A counter of dependencies for calling run(). If we need to
334332
// do asynchronous work before running, increment this and
335333
// decrement it. Incrementing must happen in a place like

src/preamble_minimal.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ var runtimeExited = false;
8989
var runtimeInitialized = false;
9090
#endif
9191

92-
#include "runtime_math.js"
9392
#include "memoryprofiler.js"
9493
#include "runtime_exceptions.js"
9594
#include "runtime_debug.js"

src/runtime_math.js

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8012
1+
7891
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21588
1+
21016
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6554
1+
6435
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
17637
1+
17061
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
53887
1+
52851
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
29086
1+
28642
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
52670
1+
51634

test/test_other.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4908,20 +4908,6 @@ def test_precompiled_headers(self, suffix):
49084908
output = self.run_js('a.out.js')
49094909
self.assertContained('|5|', output)
49104910

4911-
def test_LEGACY_VM_SUPPORT(self):
4912-
# when modern features are lacking, we can polyfill them or at least warn
4913-
create_file('pre.js', 'Math.imul = undefined;')
4914-
4915-
def test(expected, opts):
4916-
print(opts)
4917-
self.run_process([EMCC, test_file('hello_world.c'), '--pre-js', 'pre.js'] + opts)
4918-
self.assertContained(expected, self.run_js('a.out.js', assert_returncode=0 if opts else NON_ZERO))
4919-
4920-
# when legacy is needed, we show an error indicating so
4921-
test('build with LEGACY_VM_SUPPORT', [])
4922-
# legacy + disabling wasm works
4923-
test('hello, world!', ['-sLEGACY_VM_SUPPORT', '-sWASM=0'])
4924-
49254911
@crossplatform
49264912
def test_on_abort(self):
49274913
expected_output = 'Module.onAbort was called'

tools/link.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,9 +1154,6 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
11541154
if settings.MINIMAL_RUNTIME and options.oformat == OFormat.HTML and not settings.PTHREADS:
11551155
settings.USE_READY_PROMISE = 0
11561156

1157-
if settings.WASM2JS and settings.LEGACY_VM_SUPPORT:
1158-
settings.POLYFILL_OLD_MATH_FUNCTIONS = 1
1159-
11601157
check_browser_versions()
11611158

11621159
if settings.MIN_NODE_VERSION >= 150000:
@@ -1199,10 +1196,6 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
11991196
diagnostics.warning('transpile', '-sEXCEPTION_STACK_TRACES requires an engine that support ES6 classes.')
12001197
settings.EXCEPTION_STACK_TRACES = 0
12011198

1202-
# Silently drop any individual backwards compatibility emulation flags that are known never to occur on browsers that support WebAssembly.
1203-
if not settings.WASM2JS:
1204-
settings.POLYFILL_OLD_MATH_FUNCTIONS = 0
1205-
12061199
if settings.STB_IMAGE:
12071200
state.append_link_flag('-lstb_image')
12081201
settings.EXPORTED_FUNCTIONS += ['_stbi_load', '_stbi_load_from_memory', '_stbi_image_free']

0 commit comments

Comments
 (0)