public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Michael Frysinger <vapier@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] newlib: fix multilib libg.a parallel builds
Date: Thu, 24 Feb 2022 03:05:05 +0000 (GMT)	[thread overview]
Message-ID: <20220224030505.B406A3858430@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=acf642177b81543a4d954e58cfb24347c02b125a

commit acf642177b81543a4d954e58cfb24347c02b125a
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Wed Feb 23 22:01:05 2022 -0500

    newlib: fix multilib libg.a parallel builds
    
    I split libg.a out into a sep target from libc.a for the main dir in
    commit f2b053f49ed2bd7b4da8cf4ed3a608dc2f425c2b ("newlib: separate out
    libg from libc"), but missed the multilib dirs.  That leads to an
    uncommon parallel build failure:
    - libc.a rule runs & finishes
    - $(BUILD_MULTISUBDIR)/libc.a rule runs
      -> failure due to libg.a not yet existing
    - libg.a rule runs & finishes
    
    Split the multilib libg rule out from libc too so it can depend on the
    main libg directly and avoid this race.

Diff:
---
 newlib/Makefile.am | 8 +++++---
 newlib/Makefile.in | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 1a5123f0a..0479ca4f5 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -161,10 +161,12 @@ $(BUILD_MULTISUBDIR)/crt0.o: $(CRT0_DIR)$(CRT0) $(BUILD_MULTISUBDIR)
 	ln $< $@ >/dev/null 2>/dev/null || cp $< $@
 
 $(BUILD_MULTISUBDIR)/libc.a: libc.a $(BUILD_MULTISUBDIR)
-	rm -f $@ $(BUILD_MULTISUBDIR)/libg.a
+	rm -f $@
+	ln $< $@ >/dev/null 2>/dev/null || cp $< $@
+
+$(BUILD_MULTISUBDIR)/libg.a: libg.a ${BUILD_MULTISUBDIR}
+	rm -f $@
 	ln $< $@ >/dev/null 2>/dev/null || cp $< $@
-	ln libg.a $(BUILD_MULTISUBDIR)/libg.a >/dev/null 2>/dev/null || \
-	cp libg.a $(BUILD_MULTISUBDIR)/libg.a
 
 $(BUILD_MULTISUBDIR)/libm.a: libm.a $(BUILD_MULTISUBDIR)
 	rm -f $@
diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index cc7afc704..106f11ba0 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -8672,10 +8672,12 @@ libm.a: $(libm_a_OBJECTS) $(libm_a_DEPENDENCIES)
 @HAVE_MULTISUBDIR_TRUE@	ln $< $@ >/dev/null 2>/dev/null || cp $< $@
 
 @HAVE_MULTISUBDIR_TRUE@$(BUILD_MULTISUBDIR)/libc.a: libc.a $(BUILD_MULTISUBDIR)
-@HAVE_MULTISUBDIR_TRUE@	rm -f $@ $(BUILD_MULTISUBDIR)/libg.a
+@HAVE_MULTISUBDIR_TRUE@	rm -f $@
+@HAVE_MULTISUBDIR_TRUE@	ln $< $@ >/dev/null 2>/dev/null || cp $< $@
+
+@HAVE_MULTISUBDIR_TRUE@$(BUILD_MULTISUBDIR)/libg.a: libg.a ${BUILD_MULTISUBDIR}
+@HAVE_MULTISUBDIR_TRUE@	rm -f $@
 @HAVE_MULTISUBDIR_TRUE@	ln $< $@ >/dev/null 2>/dev/null || cp $< $@
-@HAVE_MULTISUBDIR_TRUE@	ln libg.a $(BUILD_MULTISUBDIR)/libg.a >/dev/null 2>/dev/null || \
-@HAVE_MULTISUBDIR_TRUE@	cp libg.a $(BUILD_MULTISUBDIR)/libg.a
 
 @HAVE_MULTISUBDIR_TRUE@$(BUILD_MULTISUBDIR)/libm.a: libm.a $(BUILD_MULTISUBDIR)
 @HAVE_MULTISUBDIR_TRUE@	rm -f $@


                 reply	other threads:[~2022-02-24  3:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220224030505.B406A3858430@sourceware.org \
    --to=vapier@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).