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