From patchwork Fri Aug 12 15:40:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 109861 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A6985B6F70 for ; Sat, 13 Aug 2011 01:41:01 +1000 (EST) Received: (qmail 21696 invoked by alias); 12 Aug 2011 15:40:58 -0000 Received: (qmail 21688 invoked by uid 22791); 12 Aug 2011 15:40:57 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Aug 2011 15:40:40 +0000 Received: by qwh5 with SMTP id 5so1812742qwh.20 for ; Fri, 12 Aug 2011 08:40:39 -0700 (PDT) Received: by 10.229.78.197 with SMTP id m5mr673156qck.268.1313163639417; Fri, 12 Aug 2011 08:40:39 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-199-31.ip51.fastwebnet.it [93.34.199.31]) by mx.google.com with ESMTPS id s14sm2334839qct.30.2011.08.12.08.40.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Aug 2011 08:40:37 -0700 (PDT) Message-ID: <4E454971.6060509@gnu.org> Date: Fri, 12 Aug 2011 17:40:33 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0 MIME-Version: 1.0 To: "H.J. Lu" CC: Pedro Alves , gcc-patches@gcc.gnu.org, Rainer Orth Subject: Re: [build] Move unwinder to toplevel libgcc (v2) References: <4E4519D1.7080005@gnu.org> <201108121338.06776.pedro@codesourcery.com> In-Reply-To: Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org >> Can't this sequence happen? >> >> proc1: cp unwind.h $(gcc_objdir)/include/tmp-unwind.h >> proc2: cp unwind.h $(gcc_objdir)/include/tmp-unwind.h >> proc1: sh $(srcdir)/../move-if-change \ >> $(gcc_objdir)/include/tmp-unwind.h \ >> $(gcc_objdir)/include/unwind.h >> proc2: sh $(srcdir)/../move-if-change \ >> $(gcc_objdir)/include/tmp-unwind.h \ >> $(gcc_objdir)/include/unwind.h >> >> It sounds like the latter move-if-change could trip on >> a non-extant tmp-unwind.h. > > Yes, we should use an unique tmp unwind.h. Thanks, you are correct. Paolo 2011-08-12 Paolo Bonzini * Makefile.in (install-unwind_h): Create $(gcc_objdir)/include/unwind.h atomically. Index: Makefile.in =================================================================== --- Makefile.in (revision 177688) +++ Makefile.in (working copy) @@ -991,8 +1001,9 @@ gcc-extra-parts: all: $(extra-parts) install-unwind_h: - rm -f $(gcc_objdir)/include/unwind.h - cp unwind.h $(gcc_objdir)/include/unwind.h - chmod a+r $(gcc_objdir)/include/unwind.h + dest=$(gcc_objdir)/include/tmp$$$$-unwind.h; \ + cp unwind.h $$dest; \ + chmod a+r $$dest; \ + sh $(srcdir)/../move-if-change $$dest $(gcc_objdir)/include/unwind.h all: install-unwind_h