diff --git a/ChangeLog.md b/ChangeLog.md index 898d5adc85c19..aace51f98115a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -26,6 +26,12 @@ See docs/process.md for more on how version tagging works. using `-gsource-map=inline`. (#23741) - The python `__file__` builtin now works in the emscripten config file. (#23973) +- Three deprecated settings were removed. These settings were marked as + deprecated for more than year: + - SUPPORT_ERRNO: Instead, export `__errno_location` if needed. + - EXTRA_EXPORTED_RUNTIME_METHODS: Instead use EXPORTED_RUNTIME_METHODS. + - DEMANGLE_SUPPORT: Instead use the `$demangle` JS libary function. + (#23975) 4.0.5 - 03/12/25 ---------------- diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index 44b015ecfba11..3f50a599fefbc 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -482,17 +482,6 @@ Print out exceptions in emscriptened code. Default value: false -.. _demangle_support: - -DEMANGLE_SUPPORT -================ - -If 1, export `demangle` and `stackTrace` JS library functions. - -.. note:: This setting is deprecated - -Default value: false - .. _library_debug: LIBRARY_DEBUG @@ -1442,17 +1431,6 @@ having "FS" in this list. Default value: [] -.. _extra_exported_runtime_methods: - -EXTRA_EXPORTED_RUNTIME_METHODS -============================== - -Deprecated, use EXPORTED_RUNTIME_METHODS instead. - -.. note:: This setting is deprecated - -Default value: [] - .. _incoming_module_js_api: INCOMING_MODULE_JS_API @@ -2951,18 +2929,6 @@ feature_matrix.py). Default value: 160000 -.. _support_errno: - -SUPPORT_ERRNO -============= - -Whether we support setting errno from JS library code. -In MINIMAL_RUNTIME builds, this option defaults to 0. - -.. note:: This setting is deprecated - -Default value: true - .. _minimal_runtime: MINIMAL_RUNTIME diff --git a/src/lib/liblegacy.js b/src/lib/liblegacy.js index fda4b5afa7e89..3955edaa61aac 100644 --- a/src/lib/liblegacy.js +++ b/src/lib/liblegacy.js @@ -76,21 +76,6 @@ legacyFuncs = { $allocateUTF8: '$stringToNewUTF8', $allocateUTF8OnStack: '$stringToUTF8OnStack', -#if SUPPORT_ERRNO - $setErrNo__deps: ['__errno_location'], - $setErrNo: (value) => { - {{{makeSetValue("___errno_location()", 0, 'value', 'i32') }}}; - return value; - }, -#else - $setErrNo: (value) => { -#if ASSERTIONS - err('failed to set errno from JS'); -#endif - return 0; - }, -#endif - #if LINK_AS_CXX $demangle__deps: ['$withStackSave', '__cxa_demangle', 'free', '$stringToUTF8OnStack'], $demangle: (func) => { diff --git a/src/settings.js b/src/settings.js index ad09a1a3cb837..5f846c81f6c8f 100644 --- a/src/settings.js +++ b/src/settings.js @@ -351,11 +351,6 @@ var EMULATE_FUNCTION_POINTER_CASTS = false; // [link] var EXCEPTION_DEBUG = false; -// If 1, export `demangle` and `stackTrace` JS library functions. -// [link] -// [deprecated] -var DEMANGLE_SUPPORT = false; - // Print out when we enter a library call (library*.js). You can also unset // runtimeDebug at runtime for logging to cease, and can set it when you want // it back. A simple way to set it in C++ is:: @@ -970,10 +965,6 @@ var JSPI_IMPORTS = []; // [link] var EXPORTED_RUNTIME_METHODS = []; -// Deprecated, use EXPORTED_RUNTIME_METHODS instead. -// [deprecated] -var EXTRA_EXPORTED_RUNTIME_METHODS = []; - // A list of incoming values on the Module object in JS that we care about. If // a value is not in this list, then we don't emit code to check if you provide // it on the Module object. For example, if @@ -1928,12 +1919,6 @@ var MIN_CHROME_VERSION = 85; // feature_matrix.py). var MIN_NODE_VERSION = 160000; -// Whether we support setting errno from JS library code. -// In MINIMAL_RUNTIME builds, this option defaults to 0. -// [link] -// [deprecated] -var SUPPORT_ERRNO = true; - // If true, uses minimal sized runtime without POSIX features, Module, // preRun/preInit/etc., Emscripten built-in XHR loading or library_browser.js. // Enable this setting to target the smallest code size possible. Set @@ -2285,4 +2270,7 @@ var LEGACY_SETTINGS = [ ['WORKAROUND_OLD_WEBGL_UNIFORM_UPLOAD_IGNORED_OFFSET_BUG', [0], 'No longer supported'], ['AUTO_ARCHIVE_INDEXES', [0, 1], 'No longer needed'], ['USE_ES6_IMPORT_META', [1], 'Disabling is no longer supported'], + ['EXTRA_EXPORTED_RUNTIME_METHODS', [[]], 'No longer supported, use EXPORTED_RUNTIME_METHODS'], + ['SUPPORT_ERRNO', [0], 'No longer supported'], + ['DEMANGLE_SUPPORT', [0], 'No longer supported'], ]; diff --git a/test/other/codesize/test_codesize_cxx_mangle.gzsize b/test/other/codesize/test_codesize_cxx_mangle.gzsize index c7777890d386d..e7c1245506428 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.gzsize +++ b/test/other/codesize/test_codesize_cxx_mangle.gzsize @@ -1 +1 @@ -9244 +9277 diff --git a/test/other/codesize/test_codesize_cxx_mangle.jssize b/test/other/codesize/test_codesize_cxx_mangle.jssize index 5960086d9db02..6f9dad955f750 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.jssize +++ b/test/other/codesize/test_codesize_cxx_mangle.jssize @@ -1 +1 @@ -23720 +23834 diff --git a/test/other/codesize/test_codesize_hello_O0.gzsize b/test/other/codesize/test_codesize_hello_O0.gzsize index 2d831067ed5e3..f4123b438c62b 100644 --- a/test/other/codesize/test_codesize_hello_O0.gzsize +++ b/test/other/codesize/test_codesize_hello_O0.gzsize @@ -1 +1 @@ -7984 +7977 diff --git a/test/other/codesize/test_codesize_hello_O0.jssize b/test/other/codesize/test_codesize_hello_O0.jssize index 93301a1e5cb73..4079dfd38754e 100644 --- a/test/other/codesize/test_codesize_hello_O0.jssize +++ b/test/other/codesize/test_codesize_hello_O0.jssize @@ -1 +1 @@ -21327 +21318 diff --git a/test/other/test_support_errno.c b/test/other/test_support_errno.c deleted file mode 100644 index 0bff8ac9c6770..0000000000000 --- a/test/other/test_support_errno.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2016 The Emscripten Authors. All rights reserved. - * Emscripten is available under two separate licenses, the MIT license and the - * University of Illinois/NCSA Open Source License. Both these licenses can be - * found in the LICENSE file. - */ - -#include -#include -#include -#include -#include - -EM_JS_DEPS(test, "$setErrNo"); - -int main() { - EM_ASM(setErrNo(5)); - printf("errno : %d\n", errno); - printf("strerror: %s\n", strerror(errno)); - return 0; -} diff --git a/test/other/test_support_errno.out b/test/other/test_support_errno.out deleted file mode 100644 index 4410aa1bbcfe6..0000000000000 --- a/test/other/test_support_errno.out +++ /dev/null @@ -1,2 +0,0 @@ -errno : 5 -strerror: Address family not supported by protocol diff --git a/test/other/test_support_errno_disabled.out b/test/other/test_support_errno_disabled.out deleted file mode 100644 index 6e829679e05d9..0000000000000 --- a/test/other/test_support_errno_disabled.out +++ /dev/null @@ -1,3 +0,0 @@ -failed to set errno from JS -errno : 0 -strerror: No error information diff --git a/test/other/test_unoptimized_code_size.js.size b/test/other/test_unoptimized_code_size.js.size index aab3bb31197a6..26dc9449261ed 100644 --- a/test/other/test_unoptimized_code_size.js.size +++ b/test/other/test_unoptimized_code_size.js.size @@ -1 +1 @@ -52673 +52659 diff --git a/test/test_other.py b/test/test_other.py index f8335cd2d9f58..03c6a10c761be 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -3958,6 +3958,8 @@ def test_demangle(self): #include #include + EM_JS_DEPS(deps, "$demangle,$stackTrace"); + void two(char c) { EM_ASM(out(stackTrace())); } @@ -3989,7 +3991,7 @@ def test_demangle(self): # full demangle support - self.run_process([EMXX, 'src.cpp', '-sDEMANGLE_SUPPORT']) + self.run_process([EMXX, 'src.cpp', '-sEXPORTED_FUNCTIONS=_main,_free,___cxa_demangle']) output = self.run_js('a.out.js') self.assertContained('''operator new(unsigned long) _main @@ -4010,7 +4012,7 @@ def test_demangle(self): void wakaw::Cm::RasterBase::merbine1::OR>(unsigned int const*, unsigned int) ''', output) # test for multiple functions in one stack trace - self.run_process([EMXX, 'src.cpp', '-sDEMANGLE_SUPPORT', '-g']) + self.run_process([EMXX, 'src.cpp', '-sEXPORTED_FUNCTIONS=_main,_free,___cxa_demangle', '-g']) output = self.run_js('a.out.js') self.assertIn('one(int)', output) self.assertIn('two(char)', output) @@ -9184,7 +9186,7 @@ def test_codesize_minimal_pthreads(self): 'except': (['-O2', '-fexceptions'], [], ['waka']), # noqa # exceptions does not pull in demangling by default, which increases code size 'mangle': (['-O2', '-fexceptions', - '-sDEMANGLE_SUPPORT', '-Wno-deprecated'], [], ['waka']), # noqa + '-sEXPORTED_FUNCTIONS=_main,_free,___cxa_demangle', '-Wno-deprecated'], [], ['waka']), # noqa # Wasm EH's code size increase is smaller than that of Emscripten EH 'except_wasm': (['-O2', '-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS=0'], [], ['waka']), 'except_wasm_legacy': (['-O2', '-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS'], [], ['waka']), @@ -9262,19 +9264,9 @@ def test_codesize_libcxxabi_message(self, *args): def test_codesize_files(self, *args): self.run_codesize_test('files.cpp', *args) - # ensures runtime exports work, even with metadce - @parameterized({ - '': (False,), - 'legacy': (True,) - }) - def test_exported_runtime_methods_metadce(self, use_legacy_name): + def test_exported_runtime_methods_metadce(self): exports = ['stackSave', 'stackRestore', 'stackAlloc', 'FS'] - setting_name = 'EXPORTED_RUNTIME_METHODS' - if use_legacy_name: - setting_name = 'EXTRA_EXPORTED_RUNTIME_METHODS' - err = self.run_process([EMCC, test_file('hello_world.c'), '-Os', '-s%s=%s' % (setting_name, ','.join(exports))], stderr=PIPE).stderr - if use_legacy_name: - 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) + self.run_process([EMCC, test_file('hello_world.c'), '-Os', '-sEXPORTED_RUNTIME_METHODS=%s' % ','.join(exports)]) js = read_file('a.out.js') for export in exports: self.assertContained(f'Module["{export}"]', js) @@ -12956,24 +12948,6 @@ def test_default_to_cxx(self): self.run_process([EMCC, '-x', 'c++-header', '-c', 'cxxfoo.h']) self.run_process([EMCC, '-x', 'c++', '-c', 'cxxfoo.h']) - @parameterized({ - '': ([],), - 'minimal': (['-sMINIMAL_RUNTIME', '-sSUPPORT_ERRNO'],), - }) - def test_support_errno(self, args): - self.emcc_args += args + ['-sEXPORTED_FUNCTIONS=_main,___errno_location', '-Wno-deprecated'] - - self.do_other_test('test_support_errno.c') - size_default = os.path.getsize('test_support_errno.js') - - # Run the same test again but with SUPPORT_ERRNO disabled. This time we don't expect errno - # to be set after the failing syscall. - self.emcc_args += ['-sSUPPORT_ERRNO=0'] - self.do_other_test('test_support_errno.c', out_suffix='_disabled') - - # Verify the JS output was smaller - self.assertLess(os.path.getsize('test_support_errno.js'), size_default) - def test_assembly(self): self.run_process([EMCC, '-c', test_file('other/test_asm.s'), '-o', 'foo.o']) self.do_other_test('test_asm.c', libraries=['foo.o']) diff --git a/tools/link.py b/tools/link.py index d0c52acf6a11e..ea7938f11c9b1 100644 --- a/tools/link.py +++ b/tools/link.py @@ -734,9 +734,6 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915 if s in user_settings: diagnostics.warning('deprecated', f'{s} is deprecated ({reason}). Please open a bug if you have a continuing need for this setting') - if settings.EXTRA_EXPORTED_RUNTIME_METHODS: - settings.EXPORTED_RUNTIME_METHODS += settings.EXTRA_EXPORTED_RUNTIME_METHODS - # If no output format was specified we try to deduce the format based on # the output filename extension 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 '_wasmfs_get_cwd', ] - if settings.DEMANGLE_SUPPORT: - settings.REQUIRED_EXPORTS += ['__cxa_demangle', 'free'] - settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += ['$demangle', '$stackTrace'] - if settings.FULL_ES3: settings.FULL_ES2 = 1 settings.MAX_WEBGL_VERSION = max(2, settings.MAX_WEBGL_VERSION) @@ -1799,7 +1792,6 @@ def get_full_import_name(name): # Some settings make no sense when not linking as C++ if not settings.LINK_AS_CXX: cxx_only_settings = [ - 'DEMANGLE_SUPPORT', 'EXCEPTION_DEBUG', 'DISABLE_EXCEPTION_CATCHING', 'EXCEPTION_CATCHING_ALLOWED', diff --git a/tools/settings.py b/tools/settings.py index c10192d4b58d8..8970cff20e7b4 100644 --- a/tools/settings.py +++ b/tools/settings.py @@ -120,9 +120,6 @@ # # All settings here should be tagged as `[deprecated]` in settings.js DEPRECATED_SETTINGS = { - 'SUPPORT_ERRNO': 'emscripten no longer uses the setErrNo library function', - 'EXTRA_EXPORTED_RUNTIME_METHODS': 'please use EXPORTED_RUNTIME_METHODS instead', - 'DEMANGLE_SUPPORT': 'mangled names no longer appear in stack traces', 'RUNTIME_LINKED_LIBS': 'you can simply list the libraries directly on the commandline now', 'CLOSURE_WARNINGS': 'use -Wclosure instead', 'LEGALIZE_JS_FFI': 'to disable JS type legalization use `-sWASM_BIGINT` or `-sSTANDALONE_WASM`',