@@ -883,23 +883,25 @@ endif
883883
884884libc : include_dirs $(STATIC_LIBS )
885885
886- dummy_libs :
886+ DUMMY := m rt pthread crypt util xnet resolv
887+ DUMMY_LIBS := $(patsubst % ,$(SYSROOT_LIB ) /lib% .a,$(DUMMY ) )
888+ $(DUMMY_LIBS ) :
887889 #
888890 # Create empty placeholder libraries.
889891 #
890- mkdir -p " $( SYSROOT_LIB) " && \
891- for name in m rt pthread crypt util xnet resolv ; do \
892- $(AR ) crs " $( SYSROOT_LIB ) /lib $$ {name}.a " ; \
892+ mkdir -p " $( SYSROOT_LIB) "
893+ for lib in $@ ; do \
894+ $(AR ) crs " $$ lib " ; \
893895 done
894896
895- finish : startup_files libc dummy_libs
897+ finish : startup_files libc $( DUMMY_LIBS )
896898 #
897899 # The build succeeded! The generated sysroot is in $(SYSROOT).
898900 #
899901
900902ifeq ($(LTO ) ,no)
901903# The check for defined and undefined symbols expects there to be a heap
902- # alloctor (providing malloc, calloc, free, etc). Skip this step if the build
904+ # allocator (providing malloc, calloc, free, etc). Skip this step if the build
903905# is done without a malloc implementation.
904906ifneq ($(MALLOC_IMPL ) ,none)
905907finish : check-symbols
@@ -1099,4 +1101,4 @@ clean:
10991101 $(RM ) -r " $( OBJDIR) "
11001102 $(RM ) -r " $( SYSROOT) "
11011103
1102- .PHONY : default startup_files libc libc_so dummy_libs finish install include_dirs clean check-symbols bindings
1104+ .PHONY : default startup_files libc libc_so finish install include_dirs clean check-symbols bindings
0 commit comments