Skip to content

Commit 782e1d5

Browse files
vstinnerned-deily
authored andcommitted
bpo-35499: make profile-opt don't override CFLAGS_NODIST (GH-11164) (GH-11267)
"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)
1 parent 789b0ee commit 782e1d5

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
@@ -472,7 +472,7 @@ profile-opt:
472472
$(MAKE) profile-removal
473473

474474
build_all_generate_profile:
475-
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
475+
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
476476

477477
run_profile_task:
478478
: # FIXME: can't run for a cross build
@@ -482,7 +482,7 @@ build_all_merge_profile:
482482
$(LLVM_PROF_MERGER)
483483

484484
build_all_use_profile:
485-
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)"
485+
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)"
486486

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