Browse Source

nptl: fix race condition when generating libpthread.so

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 15 years ago
parent
commit
1a21381a06
1 changed files with 3 additions and 3 deletions
  1. 3 3
      libpthread/nptl/Makefile.in

+ 3 - 3
libpthread/nptl/Makefile.in

@@ -286,9 +286,9 @@ lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
 
 $(top_builddir)lib/libpthread.so: $(PTHREAD_OUT)/libpthread_so.a $(libc.depend) $(libdl.depend) $(top_builddir)lib/libpthread_nonshared.a
 	$(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
-	$(Q)$(RM) $@
-	$(Q)cp $(top_srcdir)extra/scripts/format.lds $@
-	$(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@
+	$(Q)cat $(top_srcdir)extra/scripts/format.lds > $@.tmp
+	$(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp
+	$(Q)mv $@.tmp $@
 
 $(PTHREAD_OUT)/libpthread_so.a: $(libpthread-so-y)
 	$(Q)$(RM) $@