Skip to content

Commit 325b7d2

Browse files
authored
Remove support for 3 deprecated settings (#23975)
This change marks these settings and legacy and removes the associated code: - SUPPORT_ERRNO - EXTRA_EXPORTED_RUNTIME_METHODS - DEMANGLE_SUPPORT These settings have been marked as deprecated for over a year now since the system for settings deprecation was added in #21355.
1 parent 1296638 commit 325b7d2

15 files changed

+21
-139
lines changed

ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ See docs/process.md for more on how version tagging works.
2626
using `-gsource-map=inline`. (#23741)
2727
- The python `__file__` builtin now works in the emscripten config file.
2828
(#23973)
29+
- Three deprecated settings were removed. These settings were marked as
30+
deprecated for more than year:
31+
- SUPPORT_ERRNO: Instead, export `__errno_location` if needed.
32+
- EXTRA_EXPORTED_RUNTIME_METHODS: Instead use EXPORTED_RUNTIME_METHODS.
33+
- DEMANGLE_SUPPORT: Instead use the `$demangle` JS libary function.
34+
(#23975)
2935

3036
4.0.5 - 03/12/25
3137
----------------

site/source/docs/tools_reference/settings_reference.rst

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -482,17 +482,6 @@ Print out exceptions in emscriptened code.
482482

483483
Default value: false
484484

485-
.. _demangle_support:
486-
487-
DEMANGLE_SUPPORT
488-
================
489-
490-
If 1, export `demangle` and `stackTrace` JS library functions.
491-
492-
.. note:: This setting is deprecated
493-
494-
Default value: false
495-
496485
.. _library_debug:
497486

498487
LIBRARY_DEBUG
@@ -1442,17 +1431,6 @@ having "FS" in this list.
14421431

14431432
Default value: []
14441433

1445-
.. _extra_exported_runtime_methods:
1446-
1447-
EXTRA_EXPORTED_RUNTIME_METHODS
1448-
==============================
1449-
1450-
Deprecated, use EXPORTED_RUNTIME_METHODS instead.
1451-
1452-
.. note:: This setting is deprecated
1453-
1454-
Default value: []
1455-
14561434
.. _incoming_module_js_api:
14571435

14581436
INCOMING_MODULE_JS_API
@@ -2951,18 +2929,6 @@ feature_matrix.py).
29512929

29522930
Default value: 160000
29532931

2954-
.. _support_errno:
2955-
2956-
SUPPORT_ERRNO
2957-
=============
2958-
2959-
Whether we support setting errno from JS library code.
2960-
In MINIMAL_RUNTIME builds, this option defaults to 0.
2961-
2962-
.. note:: This setting is deprecated
2963-
2964-
Default value: true
2965-
29662932
.. _minimal_runtime:
29672933

29682934
MINIMAL_RUNTIME

src/lib/liblegacy.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,6 @@ legacyFuncs = {
7676
$allocateUTF8: '$stringToNewUTF8',
7777
$allocateUTF8OnStack: '$stringToUTF8OnStack',
7878

79-
#if SUPPORT_ERRNO
80-
$setErrNo__deps: ['__errno_location'],
81-
$setErrNo: (value) => {
82-
{{{makeSetValue("___errno_location()", 0, 'value', 'i32') }}};
83-
return value;
84-
},
85-
#else
86-
$setErrNo: (value) => {
87-
#if ASSERTIONS
88-
err('failed to set errno from JS');
89-
#endif
90-
return 0;
91-
},
92-
#endif
93-
9479
#if LINK_AS_CXX
9580
$demangle__deps: ['$withStackSave', '__cxa_demangle', 'free', '$stringToUTF8OnStack'],
9681
$demangle: (func) => {

src/settings.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,6 @@ var EMULATE_FUNCTION_POINTER_CASTS = false;
351351
// [link]
352352
var EXCEPTION_DEBUG = false;
353353

354-
// If 1, export `demangle` and `stackTrace` JS library functions.
355-
// [link]
356-
// [deprecated]
357-
var DEMANGLE_SUPPORT = false;
358-
359354
// Print out when we enter a library call (library*.js). You can also unset
360355
// runtimeDebug at runtime for logging to cease, and can set it when you want
361356
// it back. A simple way to set it in C++ is::
@@ -970,10 +965,6 @@ var JSPI_IMPORTS = [];
970965
// [link]
971966
var EXPORTED_RUNTIME_METHODS = [];
972967

973-
// Deprecated, use EXPORTED_RUNTIME_METHODS instead.
974-
// [deprecated]
975-
var EXTRA_EXPORTED_RUNTIME_METHODS = [];
976-
977968
// A list of incoming values on the Module object in JS that we care about. If
978969
// a value is not in this list, then we don't emit code to check if you provide
979970
// it on the Module object. For example, if
@@ -1928,12 +1919,6 @@ var MIN_CHROME_VERSION = 85;
19281919
// feature_matrix.py).
19291920
var MIN_NODE_VERSION = 160000;
19301921

1931-
// Whether we support setting errno from JS library code.
1932-
// In MINIMAL_RUNTIME builds, this option defaults to 0.
1933-
// [link]
1934-
// [deprecated]
1935-
var SUPPORT_ERRNO = true;
1936-
19371922
// If true, uses minimal sized runtime without POSIX features, Module,
19381923
// preRun/preInit/etc., Emscripten built-in XHR loading or library_browser.js.
19391924
// Enable this setting to target the smallest code size possible. Set
@@ -2285,4 +2270,7 @@ var LEGACY_SETTINGS = [
22852270
['WORKAROUND_OLD_WEBGL_UNIFORM_UPLOAD_IGNORED_OFFSET_BUG', [0], 'No longer supported'],
22862271
['AUTO_ARCHIVE_INDEXES', [0, 1], 'No longer needed'],
22872272
['USE_ES6_IMPORT_META', [1], 'Disabling is no longer supported'],
2273+
['EXTRA_EXPORTED_RUNTIME_METHODS', [[]], 'No longer supported, use EXPORTED_RUNTIME_METHODS'],
2274+
['SUPPORT_ERRNO', [0], 'No longer supported'],
2275+
['DEMANGLE_SUPPORT', [0], 'No longer supported'],
22882276
];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9244
1+
9277
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
23720
1+
23834
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7984
1+
7977
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21327
1+
21318

test/other/test_support_errno.c

Lines changed: 0 additions & 21 deletions
This file was deleted.

test/other/test_support_errno.out

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/other/test_support_errno_disabled.out

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
52673
1+
52659

test/test_other.py

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3958,6 +3958,8 @@ def test_demangle(self):
39583958
#include <stdio.h>
39593959
#include <emscripten.h>
39603960

3961+
EM_JS_DEPS(deps, "$demangle,$stackTrace");
3962+
39613963
void two(char c) {
39623964
EM_ASM(out(stackTrace()));
39633965
}
@@ -3989,7 +3991,7 @@ def test_demangle(self):
39893991

39903992
# full demangle support
39913993

3992-
self.run_process([EMXX, 'src.cpp', '-sDEMANGLE_SUPPORT'])
3994+
self.run_process([EMXX, 'src.cpp', '-sEXPORTED_FUNCTIONS=_main,_free,___cxa_demangle'])
39933995
output = self.run_js('a.out.js')
39943996
self.assertContained('''operator new(unsigned long)
39953997
_main
@@ -4010,7 +4012,7 @@ def test_demangle(self):
40104012
void wakaw::Cm::RasterBase<wakaw::watwat::Polocator>::merbine1<wakaw::Cm::RasterBase<wakaw::watwat::Polocator>::OR>(unsigned int const*, unsigned int)
40114013
''', output)
40124014
# test for multiple functions in one stack trace
4013-
self.run_process([EMXX, 'src.cpp', '-sDEMANGLE_SUPPORT', '-g'])
4015+
self.run_process([EMXX, 'src.cpp', '-sEXPORTED_FUNCTIONS=_main,_free,___cxa_demangle', '-g'])
40144016
output = self.run_js('a.out.js')
40154017
self.assertIn('one(int)', output)
40164018
self.assertIn('two(char)', output)
@@ -9184,7 +9186,7 @@ def test_codesize_minimal_pthreads(self):
91849186
'except': (['-O2', '-fexceptions'], [], ['waka']), # noqa
91859187
# exceptions does not pull in demangling by default, which increases code size
91869188
'mangle': (['-O2', '-fexceptions',
9187-
'-sDEMANGLE_SUPPORT', '-Wno-deprecated'], [], ['waka']), # noqa
9189+
'-sEXPORTED_FUNCTIONS=_main,_free,___cxa_demangle', '-Wno-deprecated'], [], ['waka']), # noqa
91889190
# Wasm EH's code size increase is smaller than that of Emscripten EH
91899191
'except_wasm': (['-O2', '-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS=0'], [], ['waka']),
91909192
'except_wasm_legacy': (['-O2', '-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS'], [], ['waka']),
@@ -9262,19 +9264,9 @@ def test_codesize_libcxxabi_message(self, *args):
92629264
def test_codesize_files(self, *args):
92639265
self.run_codesize_test('files.cpp', *args)
92649266

9265-
# ensures runtime exports work, even with metadce
9266-
@parameterized({
9267-
'': (False,),
9268-
'legacy': (True,)
9269-
})
9270-
def test_exported_runtime_methods_metadce(self, use_legacy_name):
9267+
def test_exported_runtime_methods_metadce(self):
92719268
exports = ['stackSave', 'stackRestore', 'stackAlloc', 'FS']
9272-
setting_name = 'EXPORTED_RUNTIME_METHODS'
9273-
if use_legacy_name:
9274-
setting_name = 'EXTRA_EXPORTED_RUNTIME_METHODS'
9275-
err = self.run_process([EMCC, test_file('hello_world.c'), '-Os', '-s%s=%s' % (setting_name, ','.join(exports))], stderr=PIPE).stderr
9276-
if use_legacy_name:
9277-
self.assertContained('warning: EXTRA_EXPORTED_RUNTIME_METHODS is deprecated (please use EXPORTED_RUNTIME_METHODS instead). Please open a bug if you have a continuing need for this setting [-Wdeprecated]', err)
9269+
self.run_process([EMCC, test_file('hello_world.c'), '-Os', '-sEXPORTED_RUNTIME_METHODS=%s' % ','.join(exports)])
92789270
js = read_file('a.out.js')
92799271
for export in exports:
92809272
self.assertContained(f'Module["{export}"]', js)
@@ -12956,24 +12948,6 @@ def test_default_to_cxx(self):
1295612948
self.run_process([EMCC, '-x', 'c++-header', '-c', 'cxxfoo.h'])
1295712949
self.run_process([EMCC, '-x', 'c++', '-c', 'cxxfoo.h'])
1295812950

12959-
@parameterized({
12960-
'': ([],),
12961-
'minimal': (['-sMINIMAL_RUNTIME', '-sSUPPORT_ERRNO'],),
12962-
})
12963-
def test_support_errno(self, args):
12964-
self.emcc_args += args + ['-sEXPORTED_FUNCTIONS=_main,___errno_location', '-Wno-deprecated']
12965-
12966-
self.do_other_test('test_support_errno.c')
12967-
size_default = os.path.getsize('test_support_errno.js')
12968-
12969-
# Run the same test again but with SUPPORT_ERRNO disabled. This time we don't expect errno
12970-
# to be set after the failing syscall.
12971-
self.emcc_args += ['-sSUPPORT_ERRNO=0']
12972-
self.do_other_test('test_support_errno.c', out_suffix='_disabled')
12973-
12974-
# Verify the JS output was smaller
12975-
self.assertLess(os.path.getsize('test_support_errno.js'), size_default)
12976-
1297712951
def test_assembly(self):
1297812952
self.run_process([EMCC, '-c', test_file('other/test_asm.s'), '-o', 'foo.o'])
1297912953
self.do_other_test('test_asm.c', libraries=['foo.o'])

tools/link.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,6 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
734734
if s in user_settings:
735735
diagnostics.warning('deprecated', f'{s} is deprecated ({reason}). Please open a bug if you have a continuing need for this setting')
736736

737-
if settings.EXTRA_EXPORTED_RUNTIME_METHODS:
738-
settings.EXPORTED_RUNTIME_METHODS += settings.EXTRA_EXPORTED_RUNTIME_METHODS
739-
740737
# If no output format was specified we try to deduce the format based on
741738
# the output filename extension
742739
if not options.oformat and (options.relocatable or (options.shared and not settings.SIDE_MODULE)):
@@ -1303,10 +1300,6 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
13031300
'_wasmfs_get_cwd',
13041301
]
13051302

1306-
if settings.DEMANGLE_SUPPORT:
1307-
settings.REQUIRED_EXPORTS += ['__cxa_demangle', 'free']
1308-
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += ['$demangle', '$stackTrace']
1309-
13101303
if settings.FULL_ES3:
13111304
settings.FULL_ES2 = 1
13121305
settings.MAX_WEBGL_VERSION = max(2, settings.MAX_WEBGL_VERSION)
@@ -1799,7 +1792,6 @@ def get_full_import_name(name):
17991792
# Some settings make no sense when not linking as C++
18001793
if not settings.LINK_AS_CXX:
18011794
cxx_only_settings = [
1802-
'DEMANGLE_SUPPORT',
18031795
'EXCEPTION_DEBUG',
18041796
'DISABLE_EXCEPTION_CATCHING',
18051797
'EXCEPTION_CATCHING_ALLOWED',

tools/settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@
120120
#
121121
# All settings here should be tagged as `[deprecated]` in settings.js
122122
DEPRECATED_SETTINGS = {
123-
'SUPPORT_ERRNO': 'emscripten no longer uses the setErrNo library function',
124-
'EXTRA_EXPORTED_RUNTIME_METHODS': 'please use EXPORTED_RUNTIME_METHODS instead',
125-
'DEMANGLE_SUPPORT': 'mangled names no longer appear in stack traces',
126123
'RUNTIME_LINKED_LIBS': 'you can simply list the libraries directly on the commandline now',
127124
'CLOSURE_WARNINGS': 'use -Wclosure instead',
128125
'LEGALIZE_JS_FFI': 'to disable JS type legalization use `-sWASM_BIGINT` or `-sSTANDALONE_WASM`',

0 commit comments

Comments
 (0)