aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-11-25 14:11:04 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-05-17 10:10:46 +0300
commitc7ead50fa42a0c7e3a3fb589a98e870111571091 (patch)
tree827cdde0d94b027971560d6bbe5e6217741b54ca
parentf72f3ecfb77c032ad3f3ff0c23cb18c53f01c170 (diff)
downloadopenembedded-core-contrib-c7ead50fa42a0c7e3a3fb589a98e870111571091.tar.gz
python3-native: support profile optimized build
This feature is virtually identical to that of python-native. Profile guided optimization is enabled by defining PYTHON3_NATIVE_PROFILE_OPT = "1" in local.conf. In addition, the profile task may be defined with PYTHON3_NATIVE_PROFILE_TASK. [YOCTO #9338] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--meta/recipes-devtools/python/python3-native_3.5.2.bb9
-rw-r--r--meta/recipes-devtools/python/python3/000-cross-compile.patch9
2 files changed, 9 insertions, 9 deletions
diff --git a/meta/recipes-devtools/python/python3-native_3.5.2.bb b/meta/recipes-devtools/python/python3-native_3.5.2.bb
index edcf2244f5..1d99e56054 100644
--- a/meta/recipes-devtools/python/python3-native_3.5.2.bb
+++ b/meta/recipes-devtools/python/python3-native_3.5.2.bb
@@ -56,10 +56,19 @@ EXTRA_OEMAKE = '\
# No ctypes option for python 3
PYTHONLSBOPTS = ""
+PYTHON3_NATIVE_MAKE_TARGET ?= "${@'profile-opt' if d.getVar('PYTHON3_NATIVE_PROFILE_OPT', True) == '1' else ''}"
+
do_configure_append() {
autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
}
+do_compile() {
+ if [ -n "${PYTHON3_NATIVE_PROFILE_TASK}" ]; then
+ sed -i -e 's,^PROFILE_TASK=.*,PROFILE_TASK=${PYTHON3_NATIVE_PROFILE_TASK},g' Makefile
+ fi
+ oe_runmake ${PYTHON3_NATIVE_MAKE_TARGET}
+}
+
do_install() {
install -d ${D}${libdir}/pkgconfig
oe_runmake 'DESTDIR=${D}' install
diff --git a/meta/recipes-devtools/python/python3/000-cross-compile.patch b/meta/recipes-devtools/python/python3/000-cross-compile.patch
index 2d822218f4..d6d7820ee8 100644
--- a/meta/recipes-devtools/python/python3/000-cross-compile.patch
+++ b/meta/recipes-devtools/python/python3/000-cross-compile.patch
@@ -29,15 +29,6 @@ Index: Python-3.5.2/Makefile.pre.in
PSRCS= \
Parser/acceler.c \
-@@ -509,7 +511,7 @@ build_all_generate_profile:
-
- run_profile_task:
- : # FIXME: can't run for a cross build
-- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
-+ $(LLVM_PROF_FILE) $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) || true
-
- build_all_merge_profile:
- $(LLVM_PROF_MERGER)
@@ -792,7 +794,7 @@ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
@$(MKDIR_P) Include
# Avoid copying the file onto itself for an in-tree build