diff --git a/Makefile b/Makefile index f910d5e3..bb20e46a 100644 --- a/Makefile +++ b/Makefile @@ -380,6 +380,9 @@ DLMALLOC_OBJS = $(call objs,$(DLMALLOC_SOURCES)) EMMALLOC_OBJS = $(call objs,$(EMMALLOC_SOURCES)) LIBC_BOTTOM_HALF_ALL_OBJS = $(call objs,$(LIBC_BOTTOM_HALF_ALL_SOURCES)) LIBC_TOP_HALF_ALL_OBJS = $(call asmobjs,$(call objs,$(LIBC_TOP_HALF_ALL_SOURCES))) +ifeq ($(WASI_SNAPSHOT), preview2) +LIBC_OBJS += $(OBJDIR)/preview2_component_type.o +endif ifeq ($(MALLOC_IMPL),dlmalloc) LIBC_OBJS += $(DLMALLOC_OBJS) else ifeq ($(MALLOC_IMPL),emmalloc) @@ -601,6 +604,10 @@ $(OBJDIR)/%.long-double.pic.o: %.c include_dirs @mkdir -p "$(@D)" $(CC) $(CFLAGS) -MD -MP -o $@ -c $< +$(OBJDIR)/preview2_component_type.pic.o $(OBJDIR)/preview2_component_type.o: $(LIBC_BOTTOM_HALF_SOURCES)/preview2_component_type.o + @mkdir -p "$(@D)" + cp $< $@ + $(OBJDIR)/%.pic.o: %.c include_dirs @mkdir -p "$(@D)" $(CC) $(CFLAGS) -MD -MP -o $@ -c $< diff --git a/expected/wasm32-wasi-preview2/defined-symbols.txt b/expected/wasm32-wasi-preview2/defined-symbols.txt index 0fd9aa7a..da4d3910 100644 --- a/expected/wasm32-wasi-preview2/defined-symbols.txt +++ b/expected/wasm32-wasi-preview2/defined-symbols.txt @@ -19,6 +19,7 @@ __c_locale __clock __clock_gettime __clock_nanosleep +__component_type_object_force_link_preview2 __component_type_object_force_link_preview2_public_use_in_this_compilation_unit __cos __cosdf diff --git a/expected/wasm32-wasi-preview2/undefined-symbols.txt b/expected/wasm32-wasi-preview2/undefined-symbols.txt index 710e8116..4a72951d 100644 --- a/expected/wasm32-wasi-preview2/undefined-symbols.txt +++ b/expected/wasm32-wasi-preview2/undefined-symbols.txt @@ -1,5 +1,4 @@ __addtf3 -__component_type_object_force_link_preview2 __divtf3 __eqtf2 __extenddftf2