rt: move slice append helpers from lib/slices/ into libwwrt.a

This commit is contained in:
2026-05-11 16:56:46 +09:00
parent 8ffe6dbee6
commit 5408160d49
5 changed files with 23 additions and 34 deletions

View File

@@ -39,7 +39,8 @@ W6L_SRC = cmd/w6l/main.c cmd/w6l/obj.c cmd/w6l/sym.c cmd/w6l/pass.c cmd/w6l/out.
W6L_OBJ = $(W6L_SRC:cmd/w6l/%.c=$(OBJ)/w6l/%.o)
RT_S = rt/start.s rt/syscall.s rt/alloc.s rt/streq.s rt/abort.s
RT_OBJ = $(RT_S:rt/%.s=$(OBJ)/rt/%.o)
RT_WW = rt/append.ww
RT_OBJ = $(RT_S:rt/%.s=$(OBJ)/rt/%.o) $(RT_WW:rt/%.ww=$(OBJ)/rt/%.o)
# Cstage: one-time C bootstrap (see BOOTSTRAP.md). Built by `cc`.
# Goes away at v1.0, replaced by a checked-in stage-0 binary.
@@ -191,6 +192,14 @@ $(BIN)/ww_ww: selfhost/cmd/ww/main.ww selfhost/cmd/wcc/mem.ww lib/os/os.ww \
$(OBJ)/rt/%.o: rt/%.s $(BIN)/w6a | $(OBJ)/rt
$(BIN)/w6a -o $@ $<
# ww-side runtime helpers (rt/*.ww): compile via w6c to .s, then w6a.
# Each .ww module is standalone — uses @symbol FFI for rt_alloc/rt_free
# rather than `use os;` so no bundling is required.
$(OBJ)/rt/%.s: rt/%.ww $(BIN)/w6c | $(OBJ)/rt
$(BIN)/w6c $< > $@
$(OBJ)/rt/%.o: $(OBJ)/rt/%.s $(BIN)/w6a | $(OBJ)/rt
$(BIN)/w6a -o $@ $<
$(LIB)/libwwrt.a: $(RT_OBJ) | $(LIB)
$(AR) rcs $@ $(RT_OBJ)