Skip to content

Commit 640ed52

Browse files
authored
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.
1 parent f5107df commit 640ed52

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
@@ -496,7 +496,7 @@ profile-run-stamp:
496496
touch $@
497497

498498
build_all_generate_profile:
499-
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
499+
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
500500

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

515515
# Compile and run with gcov
516516
.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)