mirror of
https://git.proxmox.com/git/wasi-libc
synced 2025-08-14 09:32:19 +00:00
add preview2_component_type.o to libc.a and libc.so (#472)
This file adds a custom section to each core module linked with wasi-libc. That custom section contains component type information needed by e.g. `wasm-tools component new` to generate a component from the module. It will be required once we start using any part of WASI 0.2.0 directly (vs. via a Preview 1 adapter). In addition, it allows developers to `#include <wasi/preview2.h>` in their code and make use of those APIs directly even if wasi-libc is not using them yet. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
This commit is contained in:
parent
55df1f54e2
commit
0fe51d2582
7
Makefile
7
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 $<
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,4 @@
|
||||
__addtf3
|
||||
__component_type_object_force_link_preview2
|
||||
__divtf3
|
||||
__eqtf2
|
||||
__extenddftf2
|
||||
|
Loading…
Reference in New Issue
Block a user