From 123f165013c6a923e3b47422e09f456ab24a28e9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 14 Dec 2018 19:30:10 +0100 Subject: [PATCH] bpo-35499: make profile-opt don't override CFLAGS_NODIST "make profile-opt" no longer replaces CFLAGS_NODIST with CFLAGS. It now adds profile-guided optimization (PGO) flags to CFLAGS_NODIST, existing CFLAGS_NODIST flags are kept. --- Makefile.pre.in | 4 ++-- .../next/Build/2018-12-14-19-36-05.bpo-35499.9yAldM.rst | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2018-12-14-19-36-05.bpo-35499.9yAldM.rst diff --git a/Makefile.pre.in b/Makefile.pre.in index f16eb96418e97b..9c790f1bc60b3e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -496,7 +496,7 @@ profile-run-stamp: touch $@ build_all_generate_profile: - $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)" + $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)" run_profile_task: @ # FIXME: can't run for a cross build @@ -510,7 +510,7 @@ build_all_merge_profile: profile-opt: profile-run-stamp @echo "Rebuilding with profile guided optimizations:" -rm -f profile-clean-stamp - $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)" + $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)" # Compile and run with gcov .PHONY=coverage coverage-lcov coverage-report diff --git a/Misc/NEWS.d/next/Build/2018-12-14-19-36-05.bpo-35499.9yAldM.rst b/Misc/NEWS.d/next/Build/2018-12-14-19-36-05.bpo-35499.9yAldM.rst new file mode 100644 index 00000000000000..ed730b9d9b4a49 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-12-14-19-36-05.bpo-35499.9yAldM.rst @@ -0,0 +1,3 @@ +``make profile-opt`` no longer replaces ``CFLAGS_NODIST`` with ``CFLAGS``. It +now adds profile-guided optimization (PGO) flags to ``CFLAGS_NODIST``: existing +``CFLAGS_NODIST`` flags are kept.