Skip to content
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
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------
Expand Down
4 changes: 4 additions & 0 deletions site/source/docs/tools_reference/settings_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ Assumes WASM_BIGINT.

.. note:: Applicable during both linking and compilation

.. note:: This setting is deprecated

Default value: 0

.. _initial_table:
Expand Down Expand Up @@ -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:

Expand Down
1 change: 1 addition & 0 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down Expand Up @@ -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)
3 changes: 3 additions & 0 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 2 additions & 0 deletions tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading