bpo-35499: make profile-opt don't override CFLAGS_NODIST (GH-11164)

"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.
This commit is contained in:
Victor Stinner 2018-12-16 18:00:42 +01:00 committed by GitHub
parent f5107dfd42
commit 640ed520dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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.