diff --git a/emcc.py b/emcc.py index d98507d6be76c..b8cc0ff934f29 100755 --- a/emcc.py +++ b/emcc.py @@ -3510,11 +3510,6 @@ def process_libraries(libs, lib_dirs, temp_files): logger.debug('looking for library "%s"', lib) suffixes = STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS - if shared.Settings.WASM_BACKEND: - # under the wasm .a files are found using the normal -l/-L flags to - # the linker. - suffixes = DYNAMICLIB_ENDINGS - found = False for prefix in LIB_PREFIXES: for suff in suffixes: diff --git a/tests/test_other.py b/tests/test_other.py index c4a8071bc515b..a89fe8d40b385 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -9796,3 +9796,12 @@ def test_link_to_object(self): run_process([PYTHON, EMCC, 'hello1.o', '-o', 'hello3.o']) content3 = open('hello2.o', 'rb').read() self.assertEqual(content1, content3) + + def test_backwards_deps_in_archive(self): + # Test that JS dependencies from deps_info.json work for code linked via + # static archives using -l + run_process([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_gethostbyname.c'), '-o', 'a.o']) + run_process([LLVM_AR, 'cr', 'liba.a', 'a.o']) + create_test_file('empty.c', 'static int foo = 0;') + run_process([PYTHON, EMCC, 'empty.c', '-la', '-L.']) + self.assertContained('success', run_js('a.out.js'))