Skip to content

Commit 4db5398

Browse files
authored
remove -nostdlib from libc.so link command (#440)
Per https://reviews.llvm.org/D156205 (which we're planning to backport to LLVM 17 and pull into `wasi-sdk`), we want to link crt1-reactor.o into libc.so so it exports `_initialize` instead of `__wasm_call_ctors`. * add `-nodefaultlibs` to libc.so link command This ensures that `-lc` is not passed to `wasm-ld`. --------- Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent 6248a00 commit 4db5398

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ PIC_OBJS = \
506506
# to CC. This is a workaround for a Windows command line size limitation. See
507507
# the `%.a` rule below for details.
508508
$(SYSROOT_LIB)/%.so: $(OBJDIR)/%.so.a $(BUILTINS_LIB)
509-
$(CC) -nostdlib -shared -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB)
509+
$(CC) -nodefaultlibs -shared -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB)
510510

511511
$(OBJDIR)/libc.so.a: $(LIBC_SO_OBJS) $(MUSL_PRINTSCAN_LONG_DOUBLE_SO_OBJS)
512512

0 commit comments

Comments
 (0)