[PATCH] Add missing changes to Makefile.tpl

H.J. Lu via Gdb-patches
2021-02-28T12:45:30Z

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

On Sat, Feb 27, 2021 at 11:01 PM Mike Frysinger <vapier@gentoo.org> wrote:
>
> On 19 Dec 2020 10:10, H.J. Lu via Gdb-patches wrote:
> > --- a/Makefile.in
> > +++ b/Makefile.in
> >
> > +PGO_BUILD_TRAINING_FLAGS_TO_PASS = \
> > + PGO_BUILD_TRAINING=yes \
> > + CFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CFLAGS)" \
> > + CXXFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CXXFLAGS)"
> > +
> > +# Ignore "make check" errors in PGO training runs.
> > +PGO_BUILD_TRAINING_MFLAGS = -i
>
> these lines are in Makefile.in but not Makefile.tpl. so regenerating
> the file causes them to be removed. can you take a look please ?
>

I checked in this patch as an obvious change.

Thanks.

--
H.J.

[-- Attachment #2: 0001-Add-missing-changes-to-Makefile.tpl.patch --]
[-- Type: text/x-patch, Size: 2163 bytes --]

From 1dbde357be3ce2641595b10436822e699abe32a0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sun, 28 Feb 2021 04:39:38 -0800
Subject: [PATCH] Add missing changes to Makefile.tpl

Update Makefile.tpl to add missing changes in

commit af019bfde9b13d628202fe58054ec7ff08d92a0f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Jan 9 06:51:15 2021 -0800

Support the PGO build for binutils+gdb

"autogen Makefile.def" showed no changes in Makefile.in.

PR binutils/26766
* Makefile.tpl (PGO_BUILD_TRAINING_FLAGS_TO_PASS): Add
PGO_BUILD_TRAINING=yes.
(PGO_BUILD_TRAINING_MFLAGS): New.
(all): Pass $(PGO_BUILD_TRAINING_MFLAGS) to the PGO build.
---
ChangeLog | 8 ++++++++
Makefile.tpl | 5 +++++
2 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e9a5611c5e7..4cd48fa1dad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-02-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/26766
+ * Makefile.tpl (PGO_BUILD_TRAINING_FLAGS_TO_PASS): Add
+ PGO_BUILD_TRAINING=yes.
+ (PGO_BUILD_TRAINING_MFLAGS): New.
+ (all): Pass $(PGO_BUILD_TRAINING_MFLAGS) to the PGO build.
+
2021-02-09 Alan Modra <amodra@gmail.com>

* configure.ac: Delete arm*-*-symbianelf* entry.
diff --git a/Makefile.tpl b/Makefile.tpl
index 38f0b021f43..84fee3dd0f7 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -440,9 +440,13 @@ PGO_BUILD_TRAINING_CFLAGS:= \
PGO_BUILD_TRAINING_CXXFLAGS:= \
$(filter-out -specs=%,$(PGO_BUILD_TRAINING_CXXFLAGS))
PGO_BUILD_TRAINING_FLAGS_TO_PASS = \
+ PGO_BUILD_TRAINING=yes \
CFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CFLAGS)" \
CXXFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CXXFLAGS)"

+# Ignore "make check" errors in PGO training runs.
+PGO_BUILD_TRAINING_MFLAGS = -i
+
# Additional PGO and LTO compiler options to use profiling data for the
# PGO build.
PGO_BUILD_USE_FLAGS_TO_PASS = \
@@ -784,6 +788,7 @@ all:
$(PGO_BUILD_GEN_FLAGS_TO_PASS) all-host all-target \
@if pgo-build
&& $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
+ $(PGO_BUILD_TRAINING_MFLAGS) \
$(PGO_BUILD_TRAINING_FLAGS_TO_PASS) \
$(PGO_BUILD_TRAINING) \
&& $(MAKE) $(RECURSE_FLAGS_TO_PASS) clean \
--
2.29.2