From a22aeb00ed9b865ab86778f984b618d7f9cfe9c6 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Tue, 12 Sep 2023 10:28:41 +0800 Subject: [PATCH] tools: Lock wasm archive during ar rcs Fix issues with multi thread compilation. Signed-off-by: Huang Qi --- tools/Wasm.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Wasm.mk b/tools/Wasm.mk index 92d308124..6314f652a 100644 --- a/tools/Wasm.mk +++ b/tools/Wasm.mk @@ -143,7 +143,7 @@ $(WOBJS): %.c$(SUFFIX).wo : %.c $(WBIN): $(WOBJS) $(shell mkdir -p $(APPDIR)/wasm) - $(Q) $(WAR) $@ $(filter-out $(MAINSRC:=$(SUFFIX).wo),$^) + $(Q) flock $(WBIN).lock -c '$(WAR) $@ $(filter-out $(MAINSRC:=$(SUFFIX).wo),$^)' $(foreach main,$(MAINSRC), \ $(eval progname=$(strip $(PROGNAME_$(main:=$(SUFFIX)$(OBJEXT))))) \ $(eval dstname=$(shell echo $(main:=$(SUFFIX).wo) | sed -e 's/\//_/g')) \