packages/lang/python/python3/patches/009-don-t-run-profile-task-...

35 lines
1.2 KiB
Diff

From 97a92f2e7a77c39d087892f5c9a7350c31f3d65b Mon Sep 17 00:00:00 2001
From: Alexandru Ardelean <alex@shruggie.ro>
Date: Sun, 24 Nov 2024 10:59:27 +0200
Subject: [PATCH] Do not run profile task during cross build
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -856,6 +856,7 @@ profile-gen-stamp: profile-clean-stamp
# Run task with profile generation build to create profile information.
profile-run-stamp:
+ifneq ($(PROFILE_TASK),)
@echo "Running code to generate profile data (this can take a while):"
# First, we need to create a clean build with profile generation
# enabled.
@@ -869,6 +870,7 @@ profile-run-stamp:
# This is an expensive target to build and it does not have proper
# makefile dependency information. So, we create a "stamp" file
# to record its completion and avoid re-running it.
+endif
touch $@
# Compile Python binary with profile guided optimization.
--- a/configure.ac
+++ b/configure.ac
@@ -1862,7 +1862,7 @@ fi
AC_ARG_VAR([PROFILE_TASK], [Python args for PGO generation task])
AC_MSG_CHECKING([PROFILE_TASK])
-if test -z "$PROFILE_TASK"
+if test -z "$PROFILE_TASK" -a "x$cross_compiling" = xno
then
PROFILE_TASK='-m test --pgo --timeout=$(TESTTIMEOUT)'
fi