From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id EBD003858D3C for ; Mon, 12 Sep 2022 23:08:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EBD003858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x530.google.com with SMTP id y8so8094260edc.10 for ; Mon, 12 Sep 2022 16:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=0PosQO7+zVcmYp1267stnnDsGWWdSkBJpvKRu50S7cE=; b=Ho0JzvElh5ifviOjyaO5buZGu0rGYdFewYrEd2ZTIh5QXM/YtY2CWrZ/SqtBy0uL2U 3yLLzW2fodEhARA29QBaBXN1GoQRLfBntLX8/TTPSvHZKOt7Uraty+qkxEjSuxGYKjMd 8LvS1TvsRsRcJYBbERhEIEqtjKmnVMXg9w/S7ubAHwzjSpYiPyB8wasMIbWjFRgif06X y/cG4IgR2TbtnqX7ASd2l7u+1eYWLIr/nnSInHQiS8+kOPBLPPvNAahqqBa3tb73QvrL uM5PXJ0PZPnTSuzDGE6w2RcZZx9Shxp+I8LiwJhAJPM3g2tkQ5VnG1sYDe9y5PhmIUpy axDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=0PosQO7+zVcmYp1267stnnDsGWWdSkBJpvKRu50S7cE=; b=BQJmaFMvU94kncOL6y2fd8UHbNIgw0Vr/O0wuOQiwB1qzbCpFGXDrDX+/ZP7yZuNKT D734H8sxm7pkFWBmJiWDHkytNjROX6MFLZQRxktQKIrRkD7ZGDCtf569P5sFoonZPUmZ XeEZU1hh7VHrx3kTzjKBjOkFUYloYKHONmQg4mgJdcJkRWijqs+VBbRQ5g8TH1hVNUXa AgcdLR27ASpn+033h5XpZaOnRsGNy8RlLltPiLh0x2vPNKFAuh3OCJmLYRcfkMCaYLw2 8iQGYsvrSpbbqs3giBhkDdFfqzrxGD0Oh9aQM5BW4TBpIWCLmkWw9262MDQdkq/iM8da adZw== X-Gm-Message-State: ACgBeo2HLiTgsCU3e8UY5/Z4Do0EVnh+Xj8UkyRcg2xZ6WYrxCRY8SFB 6S4gn32M9Y9NYoAK3534q0k= X-Google-Smtp-Source: AA6agR4T5IjeZ4842lRiOOG8MMNpL4wwRVNue10K7CMsx/4wEF94eHTr+CnkqTp6xuRIQ/RyLO489A== X-Received: by 2002:a05:6402:176f:b0:44e:deb5:8fcc with SMTP id da15-20020a056402176f00b0044edeb58fccmr23242298edb.167.1663024081294; Mon, 12 Sep 2022 16:08:01 -0700 (PDT) Received: from nz.home (host81-147-8-17.range81-147.btcentralplus.com. [81.147.8.17]) by smtp.gmail.com with ESMTPSA id z20-20020a170906715400b0073d65a95161sm5039486ejj.222.2022.09.12.16.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 16:08:00 -0700 (PDT) Received: by nz.home (Postfix, from userid 1000) id 0F1CC6BF73F10; Tue, 13 Sep 2022 00:08:00 +0100 (BST) From: Sergei Trofimovich To: libc-alpha@sourceware.org Cc: Sergei Trofimovich , Paul Smith , Siddhesh Poyarekar Subject: [PATCH v3] Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564] Date: Tue, 13 Sep 2022 00:07:58 +0100 Message-Id: <20220912230758.7370-1-slyich@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <874f0d588c3f96e96a3e2971eaa43b070ba4172e.camel@gnu.org> References: <874f0d588c3f96e96a3e2971eaa43b070ba4172e.camel@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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: 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 --- 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 := -- 2.37.2