Skip to content
Closed
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: 2 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4167,6 +4167,8 @@ def process_libraries(state, linker_inputs):
new_flags.append((i, flag))
continue
lib = strip_prefix(flag, '-l')
if lib == "c":
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should instead avoid adding native_lib to forced_stdlibs on line 4180, and if we should do it for all native system libs.. do we ever want to allow the side module to include a system library? Shouldn't they always get linking into the main module?

Perhaps we should at least do this for all default libraries (e.g. libc++, libcompiler_rt, etc)


logger.debug('looking for library "%s"', lib)
js_libs, native_lib = building.map_to_js_libs(lib)
Expand Down
4 changes: 4 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -13493,3 +13493,7 @@ def test_preload_module(self, args):
def test_standalone_whole_archive(self):
self.emcc_args += ['-sSTANDALONE_WASM', '-pthread', '-Wl,--whole-archive', '-lbulkmemory', '-lstandalonewasm', '-Wl,--no-whole-archive']
self.do_runf(test_file('hello_world.c'))

def test_lc_side_module(self):
create_file('side.c', 'int sidey() { return 42; }')
self.run_process([EMCC, '-sSIDE_MODULE', 'side.c', '-o', 'libside.so', '-lc'])