Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ def emcc(self, filename, args=[], **kwargs): # noqa
filename = maybe_test_file(filename)
compile_only = '-c' in args or '-sSIDE_MODULE' in args
cmd = [compiler_for(filename), filename] + self.get_cflags(compile_only=compile_only) + args
self.run_process(cmd, **kwargs)
return self.run_process(cmd, **kwargs)

# Shared test code between main suite and others

Expand Down
12 changes: 9 additions & 3 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,13 +1353,19 @@ def test_multiply_defined_libsymbols(self):
}
''')

# Check linking libA.so multiple times (both directly and indirectly) does not result
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Check linking libA.so multiple times (both directly and indirectly) does not result
# Check linking libA.so multiple times (both directly and indirectly) does not result in

# any multiply defined symbols. This is especially important with `FAKE_DYLIBS` where
# we model shared libraries using regular object files. Without special handling
# fake `libA.so` could get linked multiple times.
self.cflags.remove('-Werror')
self.emcc('libA.c', ['-shared', '-o', 'libA.so'])

self.emcc('a2.c', ['-r', '-L.', '-lA', '-o', 'a2.o'])
self.emcc('b2.c', ['-r', '-L.', '-lA', '-o', 'b2.o'])
err = self.emcc('a2.c', ['-shared', '-L.', '-lA', '-o', 'liba2.so'], stderr=PIPE).stderr
self.assertContained('emcc: warning: ignoring dynamic library libA.so when generating an object file', err)
err = self.emcc('b2.c', ['-shared', '-L.', '-lA', '-o', 'libb2.so'], stderr=PIPE).stderr
self.assertContained('emcc: warning: ignoring dynamic library libA.so when generating an object file', err)

self.do_runf('main.c', 'result: 1', cflags=['-L.', '-lA', 'a2.o', 'b2.o'])
self.do_runf('main.c', 'result: 1', cflags=['-L.', '-lA', 'liba2.so', 'libb2.so'])

def test_multiply_defined_libsymbols_2(self):
create_file('a.c', "int x() { return 55; }")
Expand Down
Loading