From patchwork Tue Oct 11 22:13:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Edwards X-Patchwork-Id: 680960 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 3strrd65wLz9sQw for ; Wed, 12 Oct 2016 09:14:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=ctqATHFs; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references; q= dns; s=default; b=msFyDWa7w+yfwDC95/2TowA+Ft3iOYSVbby8bshzzA5ZIS OPTnikhivK4a9TEyRipVeITOT6kLwirlrrc7S1SpFoXYchFaFVFnyw+MEFBYbj0a el8pFlPmQM+okfymm0byo/EPrTmalzKCLqbkSmMuV8b3jbq4sPax4rn5fN+to= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references; s= default; bh=AtZPAMEvtNnUuxqg8B8lFixq6L8=; b=ctqATHFsqKle/R8XHEWb U9K17ud0//Q5DYCcmjuzy4UCobCyNwzqjCtNHwwMzX6qTxTHjkS2SKSN53/mr1l5 7uAQ/cOBJ87TWUvDyZHN2oZW9+sNdpjnDEqkesD+vG5P63v6+lYX6U4z09aJtlZe QaXoo5fRuF9vemWS4ey3TRQ= Received: (qmail 54198 invoked by alias); 11 Oct 2016 22:14:32 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org Received: (qmail 54184 invoked by uid 89); 11 Oct 2016 22:14:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.6 required=5.0 tests=BAYES_50, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=dual, rr, forever, rR X-HELO: blaine.gmane.org Received: from Unknown (HELO blaine.gmane.org) (195.159.176.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Oct 2016 22:14:21 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bu5JL-0005KU-RH for crossgcc@sourceware.org; Wed, 12 Oct 2016 00:14:11 +0200 To: crossgcc@sourceware.org From: Grant Edwards Subject: Re: Now problem with make recursion in 1.16.0 Date: Tue, 11 Oct 2016 22:13:32 +0000 (UTC) Lines: 54 Message-ID: References: User-Agent: slrn/1.0.2 (Linux) X-IsSubscribed: yes On 2016-10-11, Grant Edwards wrote: > I'm trying to rebuild a toolchain using ctng-1.16.0 (updating isn't > really an option at this point in time). > > At some point within the past year, the build worked fine. Now it > fails. The build script, configuration files, and all source files > are under version control. I'm positive they haven't changed. What > probably has changed are the versions of make and autotools that are > running on the build host. The ct-ng Makefile wants to be run with '-R -r' flags. So, it checks the MAKEFLAGS, and if it's not happy it munges them a bit and then calls itself recrusively with the MAKEFLAGS it wants. The problem is that the MAKEFLAGS munging it does doesn't result in MAKEFLAGS that make the child happy, so it would recurse forever if not caught and failed by the MAKELEVEL check. The ct-ng Makefile is checking to see if the MAKEFLAGS contain Rr or -Rr, but there's no guarantee of the order the flag characters are going to show up. In my case, the initial make adds "-Rr" to MAKEFLAGS, but what the child gets is 'rR' which doesn't satisfy it, so the whole thing repeats. I doubt that anybody cares, but here's the patch to Makefile.in that fixes the problem: ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ diff -r -U5 orig/crosstool-ng-1.16.0/Makefile.in fixed/crosstool-ng-1.16.0/Makefile.in --- orig/crosstool-ng-1.16.0/Makefile.in 2012-08-04 16:41:28.000000000 -0500 +++ fixed/crosstool-ng-1.16.0/Makefile.in 2016-10-11 16:42:14.798098680 -0500 @@ -24,11 +24,15 @@ # Note: dual test, because if -R and -r are given on the command line # (who knows?), MAKEFLAGS contains 'Rr' instead of '-Rr', while adding # '-Rr' to MAKEFLAGS adds it literaly ( and does not add 'Rr' ) ifeq ($(filter Rr,$(MAKEFLAGS)),) ifeq ($(filter -Rr,$(MAKEFLAGS)),) +ifeq ($(filter rR,$(MAKEFLAGS)),) +ifeq ($(filter -rR,$(MAKEFLAGS)),) CT_MAKEFLAGS += -Rr +endif # No -rR +endif # No rR endif # No -Rr endif # No Rr # Remove any suffix rules .SUFFIXES: