tools: Lock wasm archive during ar rcs

Fix issues with multi thread compilation.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2023-09-12 10:28:41 +08:00 committed by Xiang Xiao
parent ab7fd12e1d
commit a22aeb00ed

View File

@ -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')) \