From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id CE85C3858430 for ; Thu, 24 Feb 2022 03:06:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CE85C3858430 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 0ED17342B76; Thu, 24 Feb 2022 03:06:57 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH/committed] newlib: fix multilib libg.a parallel builds Date: Wed, 23 Feb 2022 22:06:56 -0500 Message-Id: <20220224030656.4922-1-vapier@gentoo.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220217044532.10798-1-vapier@gentoo.org> References: <20220217044532.10798-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Feb 2022 03:07:00 -0000 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. --- 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 1a5123f0a4c6..0479ca4f5b61 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 $@ -- 2.34.1