@@ -642,7 +642,7 @@ profile-gen-stamp: profile-clean-stamp
642642 exit 1;\
643643 fi
644644 @echo "Building with support for profile generation:"
645- $(MAKE) build_all_generate_profile
645+ $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
646646 touch $@
647647
648648# Run task with profile generation build to create profile information.
@@ -652,28 +652,16 @@ profile-run-stamp:
652652 # enabled.
653653 $(MAKE) profile-gen-stamp
654654 # Next, run the profile task to generate the profile information.
655- $(MAKE) run_profile_task
656- $(MAKE) build_all_merge_profile
655+ @ # FIXME: can't run for a cross build
656+ $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
657+ $(LLVM_PROF_MERGER)
657658 # Remove profile generation binary since we are done with it.
658659 $(MAKE) clean-retain-profile
659660 # This is an expensive target to build and it does not have proper
660661 # makefile dependency information. So, we create a "stamp" file
661662 # to record its completion and avoid re-running it.
662663 touch $@
663664
664- .PHONY: build_all_generate_profile
665- build_all_generate_profile:
666- $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
667-
668- .PHONY: run_profile_task
669- run_profile_task:
670- @ # FIXME: can't run for a cross build
671- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
672-
673- .PHONY: build_all_merge_profile
674- build_all_merge_profile:
675- $(LLVM_PROF_MERGER)
676-
677665# Compile Python binary with profile guided optimization.
678666# To force re-running of the profile task, remove the profile-run-stamp file.
679667.PHONY: profile-opt
0 commit comments