diff --git a/ChangeLog.md b/ChangeLog.md index 6c0b8e632788e..2c0c4ca1027ba 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -63,6 +63,8 @@ See docs/process.md for more on how version tagging works. - The `PThread.runningWorkers` field was removed from the `PThread` object. If you have JS code that was depending on this you can transition to using the `PThread.pthreads` object. (#26998) +- The `-sPTHREADS` and `-sMEMORY64` flags have been deprecated in favor of the + more standard `-pthread` and `-m64` (or `--target=wasm64`) flags. () 5.0.7 - 04/30/26 ---------------- diff --git a/test/test_other.py b/test/test_other.py index 0d924f90e18a6..f62b5a459eee0 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15330,3 +15330,10 @@ def test_logReadFiles(self): create_file('pre.js', 'Module.logReadFiles = 1;') output = self.do_runf('checksummer.c', args=['test.txt'], cflags=['--pre-js=pre.js']) self.assertContained('read file: /test.txt', output) + + def test_deprecated_settings(self): + err = self.run_process([EMCC, '-sMEMORY64', test_file('hello_world.c')], stderr=PIPE).stderr + self.assertContained('emcc: warning: MEMORY64 is deprecated (prefer the standard -m64 or --target=wasm64 flags). Please open a bug if you have a continuing need for this setting [-Wdeprecated]') + + err = self.run_process([EMCC, '-sUSE_PTHREADS', test_file('hello_world.c')], stderr=PIPE).stderr + self.assertContained('emcc: warning: USE_PTHREADS is deprecated (prefer the standard -pthread flag). Please open a bug if you have a continuing need for this setting [-Wdeprecated]', err) diff --git a/tools/link.py b/tools/link.py index 3d3d838da3733..638f6e7b8ac0e 100644 --- a/tools/link.py +++ b/tools/link.py @@ -634,6 +634,9 @@ def add_system_js_lib(lib): def check_settings(): for s, reason in DEPRECATED_SETTINGS.items(): if s in user_settings: + if s == 'MEMORY64' and user_settings[s] == '2': + # Don't warn about -sMEMORY64=2 (since its the only way to enable the lowering pass) + continue diagnostics.warning('deprecated', f'{s} is deprecated ({reason}). Please open a bug if you have a continuing need for this setting') for name, msg in EXPERIMENTAL_SETTINGS.items(): diff --git a/tools/settings.py b/tools/settings.py index 8a682e85e9a48..87e1e65581d65 100644 --- a/tools/settings.py +++ b/tools/settings.py @@ -115,6 +115,8 @@ 'LINKABLE': 'under consideration for removal (https://github.com/emscripten-core/emscripten/issues/25262)', 'EXPORT_EXCEPTION_HANDLING_HELPERS': 'getExceptionMessage is exported anyway when ASSERTIONS or EXCEPTION_STACK_TRACES is set, which are set by default at -O0. At -O1 or above, you can export it separately by -sEXPORTED_RUNTIME_METHODS=getExceptionMessage,decrementExceptionRefcount.', 'DETERMINISTIC': 'under consideration for removal (https://github.com/emscripten-core/emscripten/issues/26647)', + 'USE_PTHREADS': 'prefer the standard -pthread flag', + 'MEMORY64': 'prefer the standard -m64 or --target=wasm64 flags', } # Settings that don't need to be externalized when serializing to json because they