diff --git a/emscripten.py b/emscripten.py index 488fbd3e1dfb..77d649fc2bf8 100644 --- a/emscripten.py +++ b/emscripten.py @@ -878,14 +878,6 @@ def get_exported_implemented_functions(all_exported_functions, all_implemented, if key in all_exported_functions or export_all or (export_bindings and key.startswith('_emscripten_bind')): funcs.add(key) - if not export_all: - for name, alias in metadata['aliases'].items(): - # here we export the aliases, - # if not the side module (which imports the alias) - # will not be able to get to the actual implementation - if alias in all_implemented and name in all_exported_functions: - funcs.add(alias) - funcs = list(funcs) + global_initializer_funcs(metadata['initializers']) if not shared.Settings.ONLY_MY_CODE: diff --git a/tests/other/alias/main.cpp b/tests/other/alias/main.cpp deleted file mode 100644 index 92a391b3030b..000000000000 --- a/tests/other/alias/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 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 - -using namespace std; - -int main() -{ - EM_ASM({ - FS.mkdir('/working'); - FS.mount(NODEFS, { root: '.' }, '/working'); - }); - void *handle = dlopen("/working/side.wasm", RTLD_NOW); - if (!handle) { - printf("dlopen failed:"); - } - - typedef void (*sideModule_fn)(void); - sideModule_fn exportedfn = (sideModule_fn)dlsym(handle, "_Z19destructorWithAliasv"); - const char *err = dlerror(); - if (err) { - printf("ERROR: dlsym failed: for sideModule_fn"); - abort(); - } - exportedfn(); - dlclose(handle); - return 0; -} \ No newline at end of file diff --git a/tests/other/alias/side.cpp b/tests/other/alias/side.cpp deleted file mode 100644 index 7eb88f324399..000000000000 --- a/tests/other/alias/side.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2019 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 - - -EMSCRIPTEN_KEEPALIVE void destructorWithAlias(){ - { - std::length_error err("random"); - wprintf(L"success\n"); - } -} \ No newline at end of file diff --git a/tests/test_other.py b/tests/test_other.py index 7b7779284a53..1bf2d6580f66 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -8069,28 +8069,6 @@ def test_no_legalize_js_ffi(self): assert i_legalimport_i64, 'legal import not generated for invoke call' assert e_legalstub_i32, 'legal stub not generated for dyncall' - def test_export_aliasee(self): - # test aliasee is exported when alias is exported - if self.is_wasm_backend(): - self.skipTest('not testing export aliasee and wasm backend') - - with env_modify({'EMCC_FORCE_STDLIBS': 'libc++'}): - # build side module - args = ['-s', 'EXPORT_ALL=0', '-s', 'SIDE_MODULE=1', '-O3', '-s', 'DISABLE_EXCEPTION_CATCHING=0'] - print(args) - cmd = [PYTHON, EMCC, path_from_root('tests', 'other', 'alias', 'side.cpp'), '-g', '-o', 'side.wasm'] + args - print(' '.join(cmd)) - run_process(cmd) - - # build main module - args = ['-s', 'EXPORT_ALL=0', '-s', 'EXPORTED_FUNCTIONS=["_main", "_wprintf","__ZTVSt12length_error","__ZNSt12length_errorD1Ev","__ZNSt11logic_errorC2EPKc"]', '-s', 'MAIN_MODULE=2', '-O3', '-s', 'DISABLE_EXCEPTION_CATCHING=0'] - cmd = [PYTHON, EMCC, path_from_root('tests', 'other', 'alias', 'main.cpp'), '-g', '-o', 'main.out.js'] + args - print(' '.join(cmd)) - run_process(cmd) - # run the program - ret = run_process(NODE_JS + ['main.out.js'], stdout=PIPE, stderr=PIPE).stdout - self.assertContained('success', ret) - def test_sysconf_phys_pages(self): for args, expected in [ ([], 1024),