Skip to content

Commit

Permalink
Revert "Dynamic linking: export aliasee if not export all and if alia…
Browse files Browse the repository at this point in the history
…s is exported (emscripten-core#8295)"

This reverts commit dc90308.
  • Loading branch information
VirtualTim authored May 23, 2019
1 parent e41dfd8 commit f1526d4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 84 deletions.
8 changes: 0 additions & 8 deletions emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
37 changes: 0 additions & 37 deletions tests/other/alias/main.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions tests/other/alias/side.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit f1526d4

Please sign in to comment.