diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-11-25 14:11:04 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2018-04-16 09:54:19 +0300 |
commit | 54800c587dba2a9419cf79da134e6624019e396a (patch) | |
tree | 06d4be2358b73a31a5044e642e3b49e47465fb17 | |
parent | ac582a8f856de8dde6a04d9c1da58618b80559b6 (diff) | |
download | openembedded-core-contrib-54800c587dba2a9419cf79da134e6624019e396a.tar.gz |
python3-native: support profile optimized build
Make it possible to build python3-native with profile directed optimization
enabled. The feature is enabled by specifying
PYTHON3_NATIVE_PROFILE_OPT = "1" in local.conf.
The profile task to be run may be specified with PYTHON3_NATIVE_PROFILE_TASK
variable in local.conf, e.g.
PYTHON3_NATIVE_PROFILE_TASK = "${S}/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck"
[YOCTO #9338]
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r-- | meta/recipes-devtools/python/python3-native_3.5.5.bb | 13 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-cross-compile-support.patch | 9 |
2 files changed, 10 insertions, 12 deletions
diff --git a/meta/recipes-devtools/python/python3-native_3.5.5.bb b/meta/recipes-devtools/python/python3-native_3.5.5.bb index 70c1512b5b..2794951ded 100644 --- a/meta/recipes-devtools/python/python3-native_3.5.5.bb +++ b/meta/recipes-devtools/python/python3-native_3.5.5.bb @@ -56,17 +56,24 @@ 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 sed -i -e 's,#define HAVE_GETRANDOM 1,/\* #undef HAVE_GETRANDOM \*/,' ${B}/pyconfig.h } -# Regenerate all of the generated files -# This ensures that pgen and friends get created during the compile phase -do_compile_prepend() { +do_compile() { # Has to be done ahead of other regen- targets due to https://bugs.python.org/issue33080 oe_runmake regen-importlib + # Regenerate all of the generated files + # This ensures that pgen and friends get created during the compile phase oe_runmake regen-all + + 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() { diff --git a/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch b/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch index 7cd7e3b490..1a0353d3ad 100644 --- a/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch +++ b/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch @@ -37,15 +37,6 @@ index 144c1f8629..f252ac2417 100644 PSRCS= \ Parser/acceler.c \ -@@ -478,7 +480,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) @@ -772,7 +774,7 @@ regen-grammar: $(PGEN) # Regenerate Include/graminit.h and Python/graminit.c # from Grammar/Grammar using pgen |