Skip to content
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

Remove POLYFILL_OLD_MATH_FUNCTIONS setting #23262

Merged
merged 1 commit into from
Dec 31, 2024
Merged
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
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ See docs/process.md for more on how version tagging works.
`--post-js` files will now be delayed until after module creation and after
`main` runs. This matches the existing behaviour when using sync instantation
(`-sWASM_ASYNC_COMPILATION=0`) but is an observable difference. (#23157)
- The `POLYFILL_OLD_MATH_FUNCTIONS` setting was removed. The browser versions
that require these polyfills are no longer supported by emscripten so the
polyfills should never be needed. (#23262)

3.1.74 - 12/14/24
-----------------
Expand Down
2 changes: 0 additions & 2 deletions src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,6 @@ function addOnPostRun(cb) {
__ATPOSTRUN__.unshift(cb);
}

#include "runtime_math.js"

// A counter of dependencies for calling run(). If we need to
// do asynchronous work before running, increment this and
// decrement it. Incrementing must happen in a place like
Expand Down
1 change: 0 additions & 1 deletion src/preamble_minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ var runtimeExited = false;
var runtimeInitialized = false;
#endif

#include "runtime_math.js"
#include "memoryprofiler.js"
#include "runtime_exceptions.js"
#include "runtime_debug.js"
Expand Down
53 changes: 0 additions & 53 deletions src/runtime_math.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_hello_O0.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8012
7891
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_hello_O0.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21588
21016
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_minimal_O0.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6554
6435
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_minimal_O0.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17637
17061
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
53887
52851
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size_no_asserts.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
29086
28642
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size_strict.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
52670
51634
14 changes: 0 additions & 14 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -4908,20 +4908,6 @@ def test_precompiled_headers(self, suffix):
output = self.run_js('a.out.js')
self.assertContained('|5|', output)

def test_LEGACY_VM_SUPPORT(self):
# when modern features are lacking, we can polyfill them or at least warn
create_file('pre.js', 'Math.imul = undefined;')

def test(expected, opts):
print(opts)
self.run_process([EMCC, test_file('hello_world.c'), '--pre-js', 'pre.js'] + opts)
self.assertContained(expected, self.run_js('a.out.js', assert_returncode=0 if opts else NON_ZERO))

# when legacy is needed, we show an error indicating so
test('build with LEGACY_VM_SUPPORT', [])
# legacy + disabling wasm works
test('hello, world!', ['-sLEGACY_VM_SUPPORT', '-sWASM=0'])

@crossplatform
def test_on_abort(self):
expected_output = 'Module.onAbort was called'
Expand Down
7 changes: 0 additions & 7 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,6 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
if settings.MINIMAL_RUNTIME and options.oformat == OFormat.HTML and not settings.PTHREADS:
settings.USE_READY_PROMISE = 0

if settings.WASM2JS and settings.LEGACY_VM_SUPPORT:
settings.POLYFILL_OLD_MATH_FUNCTIONS = 1

check_browser_versions()

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

# Silently drop any individual backwards compatibility emulation flags that are known never to occur on browsers that support WebAssembly.
if not settings.WASM2JS:
settings.POLYFILL_OLD_MATH_FUNCTIONS = 0

if settings.STB_IMAGE:
state.append_link_flag('-lstb_image')
settings.EXPORTED_FUNCTIONS += ['_stbi_load', '_stbi_load_from_memory', '_stbi_image_free']
Expand Down
Loading