From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2180C3858D28 for ; Wed, 9 Nov 2022 19:39:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2180C3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668022773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:content-type:content-type; bh=d1gialQuLlUclQ4Mhc1F3DpuJesrdisd1IYJ8/gcUXU=; b=JfDUiNeZMU80cAZ/hi1I0UOfnTHgG2cMzIoVvf9qmIulKB/MMkD2NPvLTFTX6fXqY8XBfm rjUHKsAPDZEtaAJm0PAtliUyxK7jq5Ca7CYx9pSKSCPIpGxE+8j/lshaVRctk3Jp1c8w8W jM+MkFhAuSd+abHXDceznDex0XW6SkY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-JopfWVuwM-G4q1P3nmQmzg-1; Wed, 09 Nov 2022 14:39:26 -0500 X-MC-Unique: JopfWVuwM-G4q1P3nmQmzg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 89EB6882820 for ; Wed, 9 Nov 2022 19:39:18 +0000 (UTC) Received: from greed.delorie.com (unknown [10.22.9.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C6B7112131B for ; Wed, 9 Nov 2022 19:39:18 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.15.2/8.15.2) with ESMTP id 2A9Jd78H1429405 for ; Wed, 9 Nov 2022 14:39:07 -0500 Date: Wed, 09 Nov 2022 14:39:07 -0500 Message-Id: From: DJ Delorie To: libc-stable@sourceware.org Subject: [COMMITTED 2.34] Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564] X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-16.2 required=5.0 tests=BAYES_00,DKIM_INVALID,DKIM_SIGNED,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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. Resolves: BZ# 29564 CC: Paul Smith CC: Siddhesh Poyarekar Signed-off-by: Sergei Trofimovich Reviewed-by: Siddhesh Poyarekar (cherry picked from commit 2d7ed98add14f75041499ac189696c9bd3d757fe) diff --git a/Makeconfig b/Makeconfig index 2fa0884b4e..92affd81b0 100644 --- a/Makeconfig +++ b/Makeconfig @@ -42,6 +42,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) @@ -912,7 +928,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 7fbe85719a..e5916f29fa 100644 --- a/Makerules +++ b/Makerules @@ -810,7 +810,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. %/: @@ -827,7 +827,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 10de81918c..a452536d39 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 :=