From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id ACA403858D3C for ; Mon, 12 Sep 2022 21:27:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ACA403858D3C 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-wm1-x333.google.com with SMTP id e18so1861341wmq.3 for ; Mon, 12 Sep 2022 14:27:22 -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=/U9LFG36XaDOd4CA5sjzqL6W9ajNorfgw6syyvgZ6zY=; b=j4VG+JEeiWVaznKvrLbQxkXozK7dkg+w555oOQbO7bmdVcZf7feG0MYTbWFWNJlJ2b NydP8X7SIG6DUpO1d+v9ZTmxZ+hp4v9d2idhrEaCuBV1vNy55BLcfJOPA3dU9RflHz0T FBRbEM9FePf8W1oyBeZuE+0nLUJG5N9DYzy17Vw9bQKoK7tR9BeItV4W4Tv0gQy8GWWM nYG4YOfoaDMHlpt9EcxnpA/KkvmI17EetLd3xnzeyWMP3yi/8nZ8d02IDlzR4FWyH3sI Yt17h6GN4IovXO8+bpMPPQYW/OdZ0kb3mmYBqOL1/mQWE1IgRlMDfGU2IDr6zPCXQbKd 2GYQ== 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=/U9LFG36XaDOd4CA5sjzqL6W9ajNorfgw6syyvgZ6zY=; b=N5Kq+QtFVpcMwhaHCQj4arx2EcsPBW35rIgXq7zGcBnZAGi82l3clQMLERq2AehL1S TtERhXi/ZzyrRr8a1G5WV8aRLKiBj5vFAcgTJ5v1OrPMPvAuuBCE6znr/ffoTUbkk6rX uHVR0BWCYJqJEgjU/n/TPGepB0YwklYLc1PmAgt+CtcfXXtq05BKyyLF6Wq6t4BWxQA1 AQfTzqUpEwWS7KZmAPvA25wKIpK7JaJKCDgySgg4IExFIxTC5tGnGhD3jBCqj5mGnFM1 LVnVoYlOGkZRsoyswjCcs6yg8cTh0OxZs81yYHyAwoEp8WoJ8j3fFRVjd7ARCfy/Zm7W 4lnA== X-Gm-Message-State: ACgBeo2+jsOjBJ+C0iPdCIx336gGp1LUj/j3CH78Q+Bnm8z9iTyLMIHu RpdG3/CO0Q4zLhe9Dl9yuIM= X-Google-Smtp-Source: AA6agR5hhnWr7N4LZ1zaMfA8KrmX9eVQaEC4RLMWyc2SINth7Tjih421sVjlWSSkO05D4aV3N5V+sA== X-Received: by 2002:a7b:c34c:0:b0:3b3:4067:d473 with SMTP id l12-20020a7bc34c000000b003b34067d473mr213157wmj.52.1663018041356; Mon, 12 Sep 2022 14:27:21 -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 i1-20020a05600c354100b003b497138093sm81358wmq.47.2022.09.12.14.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 14:27:20 -0700 (PDT) Received: by nz.home (Postfix, from userid 1000) id 2C4CA6BE94342; Mon, 12 Sep 2022 22:27:20 +0100 (BST) From: Sergei Trofimovich To: libc-alpha@sourceware.org Cc: Sergei Trofimovich , psmith@gnu.org, Siddhesh Poyarekar Subject: [PATCH v2] Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564] Date: Mon, 12 Sep 2022 22:27:11 +0100 Message-Id: <20220912212711.2819763-1-slyich@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: 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: psmith@gnu.org CC: Siddhesh Poyarekar Signed-off-by: Sergei Trofimovich --- Change since v1: - Fixed $(MAKEFLAGS) introspection to avoid false positives on long options. - Fixed 'Makefules' typo in the subject line. Makeconfig | 16 +++++++++++++++- Makerules | 4 ++-- elf/rtld-Rules | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makeconfig b/Makeconfig index f8164a0025..b47dcea251 100644 --- a/Makeconfig +++ b/Makeconfig @@ -43,6 +43,20 @@ 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 filter out long options first and then check +# for 's' in short options. +# Typical MAKEFLAGS values to watch for: +# "rs --shuffle=42" (silent) +# " --shuffle" (not silent) +ifeq ($(findstring s, $(filter-out --% , $(MAKEFLAGS))),) +silent-make := no +else +silent-make := yes +endif + # Root of the sysdeps tree. sysdep_dir := $(..)sysdeps export sysdep_dir := $(sysdep_dir) @@ -917,7 +931,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