From patchwork Mon Jan 6 23:34:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 307475 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1EC002C00CF for ; Tue, 7 Jan 2014 10:35:07 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:content-type; q=dns; s=default; b=VSV+PG+EHpLtje+RGo2Kp f6Q1Iz728E6raHghD/woNxwkam0MZ4Y0KblkKb09rzKh6cV/iJWL53BjXLKDBX9B VOiR0aNSB8xL3fF0YBeLRKU2RkhmkfkUyAGPM3u/z/9nqGk3QxIrK0dsrfBiZswr yf4QC4fDs1d06k9JS+nOwQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:content-type; s=default; bh=ENtMBK3IYhtL9cR4DLYfjrMwo+M =; b=Sk5UQDgqeoeM19QPkFHR5ta65NUMxEqUToP4kIC6pLucbhBdOZdRnl/l9W3 Kpbgyzps6gV/Ezq3fIiRbhlUGpMb9FG20svLl3Tyiid+Mk/O/WUFuFwoM4mavpDq dLAzxxF9VzVgPyWihWKr4gQEJR7MhqrD8j37CRRaA32qEQiU= Received: (qmail 11542 invoked by alias); 6 Jan 2014 23:35:01 -0000 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 Received: (qmail 11517 invoked by uid 89); 6 Jan 2014 23:35:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-pb0-f45.google.com Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com) (209.85.160.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 06 Jan 2014 23:34:59 +0000 Received: by mail-pb0-f45.google.com with SMTP id rp16so19214567pbb.32 for ; Mon, 06 Jan 2014 15:34:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=ZQWlnEV9oqwkgtU3GUteW7GrSEm1boATZAKlXLuASdY=; b=F/Eg4DyjASHrMED+YEfztZuB4a5t6q6kDcJ9GigJAk4tt9h81VTCxGpnya4XwvZUtE jITMP2ljgAtyxD7gcckbaBQygs2Rj0JzcDoqbrJb5o+1Pn5XDVvSMvj8DVg2wETpCbPL qMts3Xzg4EkIy8zhhJC+oJshdrqXPloWj7/JjRuFaMWed5MuLjO+lEhCYaKFNrdv61EY iNneXvz5IYcSukA3gbiF3HxMJ9EuDcIJPJMqNKMr+mQ1cvS0XmkR+/kYQClFxLkH0JtF 93syEHMSM7SLcPdp6a282dnPF9klr7rFKWk27dz8dFHZeOo78HMSULAPN/MRQHnProph Iwnw== X-Gm-Message-State: ALoCoQm5jIbD7o35tg4GQ20sfCQ2bjboJv5+L9qlWSwuGvAHIDJd3TXXJwtoGMEqnUOIpP0gmWQm MIME-Version: 1.0 X-Received: by 10.68.241.234 with SMTP id wl10mr58761067pbc.121.1389051297896; Mon, 06 Jan 2014 15:34:57 -0800 (PST) Received: by 10.70.38.232 with HTTP; Mon, 6 Jan 2014 15:34:57 -0800 (PST) In-Reply-To: References: Date: Mon, 6 Jan 2014 18:34:57 -0500 Message-ID: Subject: Re: Fix build under "make --no-builtin-rules" From: Patrick Palka To: gcc-patches@gcc.gnu.org On Mon, Jan 6, 2014 at 6:33 PM, Patrick Palka wrote: > Hi, > > The following tiny patch allows GCC to be built with the > "--no-builtin-rules" GNU make flag. It replaces two usages of the > automatic variable $* within the body of an explicit rule. Using $* > inside the body of an explicit rule should be avoided[0] and, as in > this scenario, may break an otherwise fine Makefile under the > --no-builtin-rules flag. > > From what I inferred from the make manual[0], $* is functionally > equivalent to $(basename $@) in this case. This patch therefore > replaces $* with $(basename $@). I tested this patch by successfully > performing a 3-stage bootstrap and a non-bootstrap build with and > without the --no-builtin-rules flag. Without the patch, the build > would fail during the compilation of libgcc/morestack.S under the > --no-builtin-rules flag. > > This patch is interesting because the --no-builtin-rules flag may > significantly shorten rebuild times. For example, on my machine an > idempotent rebuild of the (non-bootstrapped) compiler takes 2s with > the flag versus 2.6s without. Similarly, a rebuild after changing a > single source file takes 20s versus 22s. This patch lets you > seamlessly build and rebuild the compiler under the --no-builtin-rules > flag without having to worry about possible build errors. > > [0]: http://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html#Automatic-Variables Oops, forgot the patch: --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2014-01-06 Patrick Palka + + * shared-object.mk ($(base)$(objext)): Don't use $*. + * static-object.mk ($(base)$(objext)): Likewise. + 2014-01-02 Joseph Myers * config/rs6000/ibm-ldouble.c (__gcc_qdiv): Scale up arguments in diff --git a/libgcc/shared-object.mk b/libgcc/shared-object.mk index d9ee922..adbd165 100644 --- a/libgcc/shared-object.mk +++ b/libgcc/shared-object.mk @@ -25,7 +25,7 @@ endif endif $(base)$(objext): $o $(base).vis - $(gcc_compile) -c -xassembler-with-cpp -include $*.vis $< + $(gcc_compile) -c -xassembler-with-cpp -include $(basename $@).vis $< $(base).vis: $(base)_s$(objext) $(gen-hide-list) diff --git a/libgcc/static-object.mk b/libgcc/static-object.mk index 4f53636..19c3006 100644 --- a/libgcc/static-object.mk +++ b/libgcc/static-object.mk @@ -25,7 +25,7 @@ endif endif $(base)$(objext): $o $(base).vis - $(gcc_compile) -c -xassembler-with-cpp -include $*.vis $< + $(gcc_compile) -c -xassembler-with-cpp -include $(basename $@).vis $< $(base).vis: $(base)_s$(objext) $(gen-hide-list)