Skip to content

Commit 9a47585

Browse files
bpo-35499: make profile-opt don't override CFLAGS_NODIST (GH-11164) (GH-11179)
"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. (cherry picked from commit 640ed52) Co-authored-by: Victor Stinner <[email protected]>
1 parent d5176fe commit 9a47585

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Makefile.pre.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ profile-run-stamp:
497497
touch $@
498498

499499
build_all_generate_profile:
500-
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
500+
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
501501

502502
run_profile_task:
503503
@ # FIXME: can't run for a cross build
@@ -511,7 +511,7 @@ build_all_merge_profile:
511511
profile-opt: profile-run-stamp
512512
@echo "Rebuilding with profile guided optimizations:"
513513
-rm -f profile-clean-stamp
514-
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)"
514+
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)"
515515

516516
# Compile and run with gcov
517517
.PHONY=coverage coverage-lcov coverage-report
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``make profile-opt`` no longer replaces ``CFLAGS_NODIST`` with ``CFLAGS``. It
2+
now adds profile-guided optimization (PGO) flags to ``CFLAGS_NODIST``: existing
3+
``CFLAGS_NODIST`` flags are kept.

0 commit comments

Comments
 (0)