From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id B2074388E805; Tue, 5 Jan 2021 14:07:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B2074388E805 Received: by mail-ot1-x335.google.com with SMTP id d8so29337533otq.6; Tue, 05 Jan 2021 06:07:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MA248YAZZoJz7Nw+oI1mBLSzpgS6aGt3GbgZc+Sj11Q=; b=sNx4Sm66Xu1+0J0Dz7zCteQ+h9nyrQWT6Ok0yyF6EbgYJqbet9ZRcduVhRqb67Ckl1 YWh7YozS0o54xoYpifoY9OreS+QaNVSw4zSrm6GEhy1/O3pz0pp5XnYuQj7DpzHOOw+l 3xGJRQSYJf52XnNil7euNa6eHnfDDfa1IYFabAgV2aCCGcRiOjnJfTzrBnH8ETG5Y09l sc0egun5zL4EplqTGu4j20UYx77KDWEweXyIotArnGlTOWOWOgDksR5o/BjEhKTwFS+O 24flJS/xAfDox55Cxpfpeq7xv9etG1cPPF1id4hAe4oZqa83Kla1gktB6+mwpx44m6sd qHFw== X-Gm-Message-State: AOAM531zaDWNeNsBXrOr9nUQ4xjQlcB1FJ2uJE/DYnJoyc6KkAsMrDj/ WsvIkSXGsFuP8TUwICJKFGEKL4PJIMdq0G+tddTKaBTFSQM= X-Google-Smtp-Source: ABdhPJybnhJnChiK0xskY7Wh9TNVV/e/OJBfC6q/GzAmzxkjf8DtGwM0mrn4nnDaKvqID6pj8fLK4NEqwSwEzQcqgF0= X-Received: by 2002:a05:6830:10d2:: with SMTP id z18mr55783362oto.90.1609855640117; Tue, 05 Jan 2021 06:07:20 -0800 (PST) MIME-Version: 1.0 References: <20201219181036.178248-1-hjl.tools@gmail.com> <20201219181036.178248-6-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 5 Jan 2021 06:06:44 -0800 Message-ID: Subject: Re: V3 [PATCH 5/5] gnulib: Support variables from the top level Makefile To: Christian Biesinger Cc: Joseph Myers , Matthias Klose , GCC Patches , Binutils , GDB Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3030.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2021 14:07:23 -0000 On Tue, Jan 5, 2021 at 5:27 AM Christian Biesinger wrote: > > On Fri, Jan 1, 2021 at 1:07 AM H.J. Lu via Gdb-patches > wrote: > > > > On Thu, Dec 31, 2020 at 3:50 PM Joseph Myers wrote: > > > > > > On Sat, 19 Dec 2020, H.J. Lu via Gcc-patches wrote: > > > > > > > Work around what appears to be a GNU make bug handling MAKEFLAGS > > > > values defined in terms of make variables, as is the case for CC and > > > > friends when we are called from the top level Makefile. > > > > > > This description, and the comment in Makefile.am repeating it, is rather > > > unhelpful as it provides no way for a reader to know what the supposed bug > > > is. Reviewers need to be able to work out whether the proposed workaround > > > is correct or the right approach for working around the bug. Maintainers > > > in future need to be able to tell what the bug is. So the comment needs > > > to explain what the bug is and give a reference to a report for the bug in > > > the GNU make bug tracker, so that subsequent maintainers can look at that > > > bug to tell if the workaround is still needed at all. > > > > > > > I just copied the same workaround from other directories in GCC. > > But could you explain under which circumstances the bug happens? > To rebuild a subdirectory with different CFLAGS/CXXFLAGS without regenerating new Makefiles, like bootstrapping GCC and doing PGO build in binutils/GDB, we pass new CFLAGS/CXXFLAGS from toplevel Makefile to the subdirectory. Without this workaround, the old CFLAGS/CXXFLAGS are used in the subdirectory. The same workaround is used in subdirectories for bootstrapping GCC. My patch extends it to GDB for PGO build. -- H.J.