From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85050 invoked by alias); 16 Dec 2015 17:05:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 84955 invoked by uid 89); 16 Dec 2015 17:05:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 16 Dec 2015 17:05:08 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 557C3C0B2ED6; Wed, 16 Dec 2015 17:05:07 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-83.phx2.redhat.com [10.3.113.83]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBGH55QW006055; Wed, 16 Dec 2015 12:05:06 -0500 Subject: Re: [PATCH, PR67627][RFC] broken libatomic multilib parallel build To: Szabolcs Nagy , "gcc-patches@gcc.gnu.org" References: <56618964.3020209@arm.com> Cc: Marcus Shawcroft From: Jeff Law Message-ID: <567199C1.1020100@redhat.com> Date: Wed, 16 Dec 2015 17:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56618964.3020209@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg01638.txt.bz2 On 12/04/2015 05:39 AM, Szabolcs Nagy wrote: > As described in pr other/67627, the all-multi target can be > built in parallel with the %_.lo targets which generate make > dependencies that are parsed during the build of all-multi. > > gcc -MD does not generate the makefile dependencies in an > atomic way so make can fail if it concurrently parses those > half-written files. > (not observed on x86, but happens on arm native builds.) > > this workaround forces all-multi to only run after the *_.lo > targets are done, but there might be a better solution using > automake properly. (automake should know about the generated > make dependency files that are included into the makefile so > no manual tinkering is needed to get the right build order, > but i don't know how to do that.) > > 2015-12-04 Szabolcs Nagy > > PR other/67627 > * Makefile.am (all-multi): Add dependency. > * Makefile.in: Regenerate. ISTM that many of the libraries have this problem. [law@localhost gcc]$ grep all-am: */Makefile.in | grep -v install boehm-gc/Makefile.in:all-am: Makefile $(LTLIBRARIES) all-multi gotools/Makefile.in:all-am: Makefile $(PROGRAMS) $(MANS) libatomic/Makefile.in:all-am: Makefile $(LTLIBRARIES) all-multi auto-config.h libbacktrace/Makefile.in:all-am: Makefile $(LTLIBRARIES) all-multi config.h libcc1/Makefile.in:all-am: Makefile $(LTLIBRARIES) cc1plugin-config.h libcilkrts/Makefile.in:all-am: Makefile $(LTLIBRARIES) all-multi $(HEADERS) libffi/Makefile.in:all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) all-multi $(DATA) \ libgfortran/Makefile.in:all-am: Makefile $(LTLIBRARIES) all-multi $(DATA) $(HEADERS) config.h libgo/Makefile.in:all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) all-multi $(DATA) \ libgomp/Makefile.in:all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) all-multi $(HEADERS) \ libitm/Makefile.in:all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) all-multi $(HEADERS) \ libjava/Makefile.in:all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) all-multi \ libmpx/Makefile.in:all-am: Makefile all-multi $(HEADERS) config.h liboffloadmic/Makefile.in:all-am: Makefile $(LTLIBRARIES) all-multi $(HEADERS) all-local libquadmath/Makefile.in:all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) all-multi $(HEADERS) \ libsanitizer/Makefile.in:all-am: Makefile all-multi $(HEADERS) config.h libssp/Makefile.in:all-am: Makefile $(LTLIBRARIES) all-multi $(HEADERS) config.h libstdc++-v3/Makefile.in:all-am: Makefile all-multi config.h libvtv/Makefile.in:all-am: Makefile $(LTLIBRARIES) all-multi $(HEADERS) lto-plugin/Makefile.in:all-am: Makefile $(LTLIBRARIES) config.h all-local zlib/Makefile.in:all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) all-multi And if you look at the all-multi targets in each of those, all-multi has no dependencies. So any of them which use auto-dependency generation are potentially going to bump into this problem. We can't fix it by twiddling Makefile.in as that's a generated file. I think it has to happen at the automake level. jeff