Browse Source

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>
pull/441/head
Joel Dice 1 year ago
committed by GitHub
parent
commit
4db5398e65
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Makefile

2
Makefile

@ -506,7 +506,7 @@ PIC_OBJS = \
# to CC. This is a workaround for a Windows command line size limitation. See
# the `%.a` rule below for details.
$(SYSROOT_LIB)/%.so: $(OBJDIR)/%.so.a $(BUILTINS_LIB)
$(CC) -nostdlib -shared -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB)
$(CC) -nodefaultlibs -shared -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB)
$(OBJDIR)/libc.so.a: $(LIBC_SO_OBJS) $(MUSL_PRINTSCAN_LONG_DOUBLE_SO_OBJS)

Loading…
Cancel
Save