From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dog.birch.relay.mailchannels.net (dog.birch.relay.mailchannels.net [23.83.209.48]) by sourceware.org (Postfix) with ESMTPS id D75B93856965 for ; Tue, 13 Sep 2022 14:21:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D75B93856965 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 14E9B3E1E9E; Tue, 13 Sep 2022 14:21:42 +0000 (UTC) Received: from pdx1-sub0-mail-a307 (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4DA783E1082; Tue, 13 Sep 2022 14:21:41 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1663078901; a=rsa-sha256; cv=none; b=fvfBP5hoRDJ3LRZIJj8D2ne/5gEmIy3Siluvw8EWojRM5zOsto9QUokNEojGXfPnSU0Qyk r3bzznFmlbIVK7vGdrxIQYcScFVYM1/13xNeNbJVnNe1qFj8QT17K+a0JwrsQ3ARLGV89F Ohgft+2uRJdH9YOZmaZKNC+2M1zHlHkgUStdJ3sJnw8Bt/GXaFkEzF9FpNHjIEWaCnTEVo VzBIRfvQk69glK+yMmzOYv6GMBvSeM8ISdD+kU4/RQ3BYdCOkttY9Nhg4YVuU4JwDVvxw5 li/K4gdzXf//OLFwlOGxKpudvpVKDrLcSCzgQwio82QP4q1APrXAIxqwdgYfmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1663078901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vjR3BibHHkEWjfU9odHwLum62m26+7u8Htk91XvpxBA=; b=EtlKT6puyC5pAyE4EpDpUx2fdASwKIqRKY4373sCnPWdNb2QEHULScn+3WAw4yJhHbG+oO dcRhhXriXWSvhGABACemgfS5aH7siHAvTcIaIRJNWrJLm6C1QsVi1YSxoIXLuGaKC6geja Ieoq4FEnIZmyMvxM+Nx52xZP+a8d6jzLlC+e7KQcqg0vJVppF1BNdA4l2PQ1llUZngJ4ow k/22lp41XDVwie+gXl+f/77qXLA/fzHYAtjsHWo6v2tKR1ZM+MmZmicBDpoJ3wxnPbzKp5 yh7Dsdp8eAE61ncqA1AVG5ZcFTrmcK9xpm80qhUfjBonNLK7jTRnK3JOe7TKgA== ARC-Authentication-Results: i=1; rspamd-f776c45b8-4hrph; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Company-Obese: 24c145dc6b5e3701_1663078901735_2738827694 X-MC-Loop-Signature: 1663078901735:1495849230 X-MC-Ingress-Time: 1663078901735 Received: from pdx1-sub0-mail-a307 (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.119.76.153 (trex/6.7.1); Tue, 13 Sep 2022 14:21:41 +0000 Received: from [192.168.0.182] (bras-vprn-toroon4834w-lp130-16-184-147-84-238.dsl.bell.ca [184.147.84.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a307 (Postfix) with ESMTPSA id 4MRlyW4vQSzdf; Tue, 13 Sep 2022 07:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1663078900; bh=ULY56+GxYU1xIMbpCEyydbfsBmcVG71vMBiBsl7v1R8=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=dM/jrQ4YN3TOpKC9+0nrQjIO/oEDYEqocAFmNVbV4k1nOb73h4b8ZYO/XLFFTsC6h dnyQWwJ63Pd72jnz5nL6cWyyYz3hj4HFQRiTp/STu6VxM0XVdbicFjV7+n3uwXV0kr +hR2tMwHxU3z+TbX2LhEYQ8GVGQpzJXPCUfcuRvkLQ6AfQqKBOJ8iTdvYmi0scAWjm 6S4IJiHb1RUzRErhSE6SxA/PIGweVA3MJI9aV0TBuUR7uZ/wp45ZdSVmm0I5B0z0E+ yMd7g8tXKUkSSAF7FKGDAOEqESZW/yJxYWZZYymB/nCtadkw5Y6tFNmVXEViB8F+R1 O7NqnHPE68B8A== Message-ID: Date: Tue, 13 Sep 2022 10:21:36 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v3] Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564] Content-Language: en-US To: Sergei Trofimovich , libc-alpha@sourceware.org Cc: Paul Smith References: <874f0d588c3f96e96a3e2971eaa43b070ba4172e.camel@gnu.org> <20220912230758.7370-1-slyich@gmail.com> From: Siddhesh Poyarekar In-Reply-To: <20220912230758.7370-1-slyich@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3038.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2022-09-12 19:07, Sergei Trofimovich wrote: > make-4.4 will add long flags to MAKEFLAGS variable: > > * WARNING: Backward-incompatibility! > Previously only simple (one-letter) options were added to the MAKEFLAGS > variable that was visible while parsing makefiles. Now, all options > are available in MAKEFLAGS. > > This causes locale builds to fail when long options are used: > > $ make --shuffle > ... > make -C localedata install-locales > make: invalid shuffle mode: '1662724426r' > > The change fixes it by passing eash option via whitespace and dashes. > That way option is appended to both single-word form and whitespace > separated form. > > While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering > out --long-options. Otherwise options like --shuffle flag enable silent > mode unintentionally. $(silent-make) variable consolidates the checks. > > CC: Paul Smith > CC: Siddhesh Poyarekar > Signed-off-by: Sergei Trofimovich > --- LGTM. I'll commit this in a while. Reviewed-by: Siddhesh Poyarekar > Change since v2: > - Used more robust '$(firstword' for suggested by Paul Smith. > Change since v1: > - Fixed $(MAKEFLAGS) introspection to avoid false positives on long > options. > - Fixed 'Makefules' typo in the subject line. > Makeconfig | 18 +++++++++++++++++- > Makerules | 4 ++-- > elf/rtld-Rules | 2 +- > 3 files changed, 20 insertions(+), 4 deletions(-) > > diff --git a/Makeconfig b/Makeconfig > index f8164a0025..842f49eb58 100644 > --- a/Makeconfig > +++ b/Makeconfig > @@ -43,6 +43,22 @@ else > $(error objdir must be defined by the build-directory Makefile) > endif > > +# Did we request 'make -s' run? "yes" or "no". > +# Starting from make-4.4 MAKEFLAGS now contains long > +# options like '--shuffle'. To detect presence of 's' > +# we pick first word with short options. Long options > +# are guaranteed to come after whitespace. We use '-' > +# prefix to always have a word before long options > +# even if no short options were passed. > +# Typical MAKEFLAGS values to watch for: > +# "rs --shuffle=42" (silent) > +# " --shuffle" (not silent) > +ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),) > +silent-make := no > +else > +silent-make := yes > +endif > + > # Root of the sysdeps tree. > sysdep_dir := $(..)sysdeps > export sysdep_dir := $(sysdep_dir) > @@ -917,7 +933,7 @@ endif > # umpteen zillion filenames along with it (we use `...' instead) > # but we don't want this echoing done when the user has said > # he doesn't want to see commands echoed by using -s. > -ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s > +ifeq ($(silent-make),yes) # if -s > +cmdecho := echo >/dev/null > else # not -s > +cmdecho := echo > diff --git a/Makerules b/Makerules > index d1e139d03c..09c0cf8357 100644 > --- a/Makerules > +++ b/Makerules > @@ -794,7 +794,7 @@ endif > # Maximize efficiency by minimizing the number of rules. > .SUFFIXES: # Clear the suffix list. We don't use suffix rules. > # Don't define any builtin rules. > -MAKEFLAGS := $(MAKEFLAGS)r > +MAKEFLAGS := $(MAKEFLAGS) -r > > # Generic rule for making directories. > %/: > @@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r > .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c)) > > # Use the verbose option of ar and tar when not running silently. > -ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s > +ifeq ($(silent-make),no) # if not -s > verbose := v > else # -s > verbose := > diff --git a/elf/rtld-Rules b/elf/rtld-Rules > index ca00dd1fe2..3c5e273f2b 100644 > --- a/elf/rtld-Rules > +++ b/elf/rtld-Rules > @@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\ > mv -f $@T $@ > > # Use the verbose option of ar and tar when not running silently. > -ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s > +ifeq ($(silent-make),no) # if not -s > verbose := v > else # -s > verbose :=