summaryrefslogtreecommitdiff
path: root/glibc-32/glibc-2.35-make-4.4-MAKEFLAGS.patch
blob: 51fbe5f54074f860938e7ee70c92aa9ba12ea9e3 (plain)
    1 https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2d7ed98add14f75041499ac189696c9bd3d757fe
    2 https://bugs.gentoo.org/869263
    3 
    4 From 2d7ed98add14f75041499ac189696c9bd3d757fe Mon Sep 17 00:00:00 2001
    5 From: Sergei Trofimovich <slyich@gmail.com>
    6 Date: Tue, 13 Sep 2022 13:39:13 -0400
    7 Subject: [PATCH] Makerules: fix MAKEFLAGS assignment for upcoming make-4.4
    8  [BZ# 29564]
    9 
   10 make-4.4 will add long flags to MAKEFLAGS variable:
   11 
   12     * WARNING: Backward-incompatibility!
   13       Previously only simple (one-letter) options were added to the MAKEFLAGS
   14       variable that was visible while parsing makefiles.  Now, all options
   15       are available in MAKEFLAGS.
   16 
   17 This causes locale builds to fail when long options are used:
   18 
   19     $ make --shuffle
   20     ...
   21     make  -C localedata install-locales
   22     make: invalid shuffle mode: '1662724426r'
   23 
   24 The change fixes it by passing eash option via whitespace and dashes.
   25 That way option is appended to both single-word form and whitespace
   26 separated form.
   27 
   28 While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
   29 out --long-options. Otherwise options like --shuffle flag enable silent
   30 mode unintentionally. $(silent-make) variable consolidates the checks.
   31 
   32 Resolves: BZ# 29564
   33 
   34 CC: Paul Smith <psmith@gnu.org>
   35 CC: Siddhesh Poyarekar <siddhesh@gotplt.org>
   36 Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
   37 Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
   38 --- a/Makeconfig
   39 +++ b/Makeconfig
   40 @@ -43,6 +43,22 @@ else
   41  $(error objdir must be defined by the build-directory Makefile)
   42  endif
   43  
   44 +# Did we request 'make -s' run? "yes" or "no".
   45 +# Starting from make-4.4 MAKEFLAGS now contains long
   46 +# options like '--shuffle'. To detect presence of 's'
   47 +# we pick first word with short options. Long options
   48 +# are guaranteed to come after whitespace. We use '-'
   49 +# prefix to always have a word before long options
   50 +# even if no short options were passed.
   51 +# Typical MAKEFLAGS values to watch for:
   52 +#   "rs --shuffle=42" (silent)
   53 +#   " --shuffle" (not silent)
   54 +ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
   55 +silent-make := no
   56 +else
   57 +silent-make := yes
   58 +endif
   59 +
   60  # Root of the sysdeps tree.
   61  sysdep_dir := $(..)sysdeps
   62  export sysdep_dir := $(sysdep_dir)
   63 @@ -917,7 +933,7 @@ endif
   64  # umpteen zillion filenames along with it (we use `...' instead)
   65  # but we don't want this echoing done when the user has said
   66  # he doesn't want to see commands echoed by using -s.
   67 -ifneq	"$(findstring s,$(MAKEFLAGS))" ""	# if -s
   68 +ifeq ($(silent-make),yes)			# if -s
   69  +cmdecho	:= echo >/dev/null
   70  else						# not -s
   71  +cmdecho	:= echo
   72 --- a/Makerules
   73 +++ b/Makerules
   74 @@ -794,7 +794,7 @@ endif
   75  # Maximize efficiency by minimizing the number of rules.
   76  .SUFFIXES:	# Clear the suffix list.  We don't use suffix rules.
   77  # Don't define any builtin rules.
   78 -MAKEFLAGS := $(MAKEFLAGS)r
   79 +MAKEFLAGS := $(MAKEFLAGS) -r
   80  
   81  # Generic rule for making directories.
   82  %/:
   83 @@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
   84  .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
   85  
   86  # Use the verbose option of ar and tar when not running silently.
   87 -ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
   88 +ifeq ($(silent-make),no)			# if not -s
   89  verbose := v
   90  else	   					# -s
   91  verbose	:=
   92 --- a/elf/rtld-Rules
   93 +++ b/elf/rtld-Rules
   94 @@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
   95  	mv -f $@T $@
   96  
   97  # Use the verbose option of ar and tar when not running silently.
   98 -ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
   99 +ifeq ($(silent-make),no)			# if not -s
  100  verbose := v
  101  else						# -s
  102  verbose	:=

Generated by cgit