diff --git a/ChangeLog.md b/ChangeLog.md index ed8db891bb5d6..ebac03e5417cf 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,6 +20,8 @@ See docs/process.md for more on how version tagging works. 6.0.1 (in development) ---------------------- +- The `-sUSE_PTHREADS` and `-sMEMORY64` flags have been deprecated in favor of the + more standard `-pthread` and `-m64` (or `--target=wasm64`) flags. (#27025) 6.0.0 - 06/04/26 ---------------- diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index c61cd19e1dc15..ae6a2ab04b7d5 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -317,6 +317,8 @@ Assumes WASM_BIGINT. .. note:: Applicable during both linking and compilation +.. note:: This setting is deprecated + Default value: 0 .. _initial_table: @@ -3393,6 +3395,8 @@ these settings please open a bug (or reply to one of the existing bugs). - ``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 .. _legacy-settings: diff --git a/src/settings.js b/src/settings.js index c9e8ad2f6eed5..fa106e281fa76 100644 --- a/src/settings.js +++ b/src/settings.js @@ -260,6 +260,7 @@ var MEMORY_GROWTH_LINEAR_STEP = -1; // flags, which do the same thing. // Assumes WASM_BIGINT. // [compile+link] +// [deprecated] var MEMORY64 = 0; // Sets the initial size of the table when MAIN_MODULE or SIDE_MODULE is used diff --git a/test/test_other.py b/test/test_other.py index 029dfd7857d2b..ea4d59c7a4979 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -14005,7 +14005,7 @@ def test_USE_PTHREADS(self): self.set_setting('USE_PTHREADS') self.set_setting('PROXY_TO_PTHREAD') self.set_setting('EXIT_RUNTIME') - self.do_runf('pthread/test_pthread_create.c') + self.do_runf('pthread/test_pthread_create.c', cflags=['-Wno-deprecated']) def test_cpp_module(self): self.run_process([EMXX, '-std=c++20', test_file('other/hello_world.cppm'), '--precompile', '-o', 'hello_world.pcm']) @@ -15356,3 +15356,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) + + 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 b4a575fe1ec30..f2f7b97850685 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