Fix the handling of shared library dependencies in subfolders. (#14193)
This commit is contained in:
Родитель
fea2ac8f42
Коммит
ad135eb08d
5
emcc.py
5
emcc.py
|
@ -671,9 +671,10 @@ def process_dynamic_libs(dylibs, lib_dirs):
|
|||
path = find_library(needed, lib_dirs)
|
||||
if path:
|
||||
extras.append(path)
|
||||
seen.add(needed)
|
||||
else:
|
||||
exit_with_error(f'{dylib}: shared library dependency not found: `{needed}`')
|
||||
to_process.append(needed)
|
||||
exit_with_error(f'{os.path.normpath(dylib)}: shared library dependency not found: `{needed}`')
|
||||
to_process.append(path)
|
||||
|
||||
dylibs += extras
|
||||
for dylib in dylibs:
|
||||
|
|
|
@ -7387,6 +7387,13 @@ int main() {
|
|||
err = self.expect_fail(final_link)
|
||||
self.assertContained('error: libside2.wasm: shared library dependency not found: `libside1.wasm`', err)
|
||||
|
||||
def test_side_module_folder_deps(self):
|
||||
# Build side modules in a subfolder
|
||||
os.mkdir('subdir')
|
||||
self.run_process([EMCC, test_file('hello_world.c'), '-s', 'SIDE_MODULE', '-o', 'subdir/libside1.so'])
|
||||
self.run_process([EMCC, test_file('hello_world.c'), '-s', 'SIDE_MODULE', '-o', 'subdir/libside2.so', '-L', 'subdir', '-lside1'])
|
||||
self.run_process([EMCC, test_file('hello_world.c'), '-s', 'MAIN_MODULE', '-o', 'main.js', '-L', 'subdir', '-lside2'])
|
||||
|
||||
@is_slow_test
|
||||
def test_lto(self):
|
||||
# test building of non-wasm-object-files libraries, building with them, and running them
|
||||
|
|
Загрузка…
Ссылка в новой задаче