examples: Fix elf/module/posix_spawn sometimes parallel build errors at link time

It seems in the time window mksymtab.sh redirect to symtab.c, there is chance symtab.c
would also be built meantime. Then if built before symtab.c write done, link errors may
occur. So use rename and mv operation to reduce the possibility.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
liuhaitao 2020-03-21 17:50:43 +08:00 committed by Masayuki Ishikawa
parent ad552c8c7b
commit 54b375dc43
3 changed files with 8 additions and 4 deletions

View File

@ -141,7 +141,8 @@ $(DIRLIST_HDR) : populate
# Create the exported symbol table
$(SYMTAB_SRC): populate
$(Q) $(TESTS_DIR)/mksymtab.sh $(FSIMG_DIR) >$@
$(Q) $(TESTS_DIR)/mksymtab.sh $(FSIMG_DIR) >$@.tmp
$(Q) mv $@.tmp $@
# Clean each subdirectory

View File

@ -123,14 +123,16 @@ endif
# Create the exported symbol table
$(SYMTAB_SRC): populate
$(Q) $(DRIVER_DIR)/mksymtab.sh $(FSROOT_DIR) >$@
$(Q) $(DRIVER_DIR)/mksymtab.sh $(FSROOT_DIR) >$@.tmp
$(Q) mv $@.tmp $@
else
# Create the exported symbol table
$(SYMTAB_SRC): populate
$(Q) $(DRIVER_DIR)/mksymtab.sh $(FSROOT_DIR) >$@
$(Q) $(DRIVER_DIR)/mksymtab.sh $(FSROOT_DIR) >$@.tmp
$(Q) mv $@.tmp $@
endif

View File

@ -78,7 +78,8 @@ $(ROMFS_HDR) : $(ROMFS_IMG)
# Create the exported symbol table
$(SYMTAB_SRC): $(ROMFS_IMG)
$(Q) $(FILESYSTEM_DIR)$(DELIM)mksymtab.sh $(ROMFS_DIR) >$@
$(Q) $(FILESYSTEM_DIR)$(DELIM)mksymtab.sh $(ROMFS_DIR) >$@.tmp
$(Q) mv $@.tmp $@
# Clean each subdirectory