features_backfill: fix for multilib
cover features_backfill: fix for multilib
From: Jackie Huang <[email protected]>
Tested with:
1) local.conf:
MACHINE = "qemumips64" MULTILIB_GLOBAL_VARIANTS_append = " libn32" MULTILIBS = "multilib:libn32" DEFAULTTUNE_virtclass-multilib-libn32 ?= "mips64-n32" require conf/multilib.conf
2) run bitbake -e to check the features:
$ bitbake -e libn32-gobject-introspection | grep '^MACHINE_FEATURES'
(before the fix)
MACHINE_FEATURES="alsa bluetooth usbgadget screen rtc qemu-usermode" MACHINE_FEATURES_BACKFILL="rtc qemu-usermode" MACHINE_FEATURES_BACKFILL_CONSIDERED=" qemu-usermode"
(after the fix)
MACHINE_FEATURES="alsa bluetooth usbgadget screen rtc" MACHINE_FEATURES_BACKFILL="rtc qemu-usermode" MACHINE_FEATURES_BACKFILL_CONSIDERED=" qemu-usermode" MACHINE_FEATURES_ORIGINAL="alsa bluetooth usbgadget screen"
3) world build:
$ bitbake world
builds without error.
--
The following changes since commit 4469acdf1d0338220f3fe2ecb5e079eea6fda375:
lib/oe/utils: remove param_bool() (2017-12-02 11:25:34 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib.git jhuang0/d_backfill_multilib_171207_0
http://git.pokylinux.org/cgit.cgi//log/?h=jhuang0/d_backfill_multilib_171207_0
Jackie Huang (1):
features_backfill: fix for multilib
meta/classes/multilib.bbclass | 4 ++++ meta/lib/oe/utils.py | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/1 features_backfill: fix for multilib
From: Jackie Huang <[email protected]>
The backfilling feature doesn't work for multilib,
e.g. build with:
MACHINE = "qemumips64" MULTILIB_GLOBAL_VARIANTS_append = " libn32" MULTILIBS = "multilib:libn32" DEFAULTTUNE_virtclass-multilib-libn32 ?= "mips64-n32" require conf/multilib.conf
And we have backfill_considered in machine/include/mips/arch-mips.inc:MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'qemu-usermode', '', d)}"
For libn32 builds, 'qemu-usermode' is not expected but it still presents in MACHINE_FEATURES.
To fix the issue:
* Change the oe.utils.features_backfill to always compare with the original features(before backfilled), so we can run the function multiple times when needed.
* run oe.utils.features_backfill at the end of multilib_virtclass_handler to update the backfilled features to ensure it's correct for multilib.
[YOCTO #12373]
--- meta/classes/multilib.bbclass | 4 ++++ meta/lib/oe/utils.py | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
meta/classes/multilib.bbclass +4 -0
@@ -77,6 +77,10 @@ python multilib_virtclass_handler () { if newtune: e.data.setVar("DEFAULTTUNE", newtune) e.data.setVar('DEFAULTTUNE_ML_%s' % variant, newtune) + + # Update the backfilled features after DEFAULTTUNE changed + oe.utils.features_backfill("DISTRO_FEATURES", e.data) + oe.utils.features_backfill("MACHINE_FEATURES", e.data) } addhandler multilib_virtclass_handler
meta/lib/oe/utils.py +7 -2
@@ -107,13 +107,18 @@ def features_backfill(var,d): backfill = (d.getVar(var+"_BACKFILL") or "").split() considered = (d.getVar(var+"_BACKFILL_CONSIDERED") or "").split() + features_original = (d.getVar(var + "_ORIGINAL") or "").split() + if not features_original: + features_original = features + d.setVar(var + "_ORIGINAL", " ".join(features_original)) + addfeatures = [] for feature in backfill: - if feature not in features and feature not in considered: + if feature not in features_original and feature not in considered: addfeatures.append(feature) if addfeatures: - d.appendVar(var, " " + " ".join(addfeatures)) + d.setVar(var, " ".join(features_original) + " " + " ".join(addfeatures)) def all_distro_features(d, features, truevalue="1", falsevalue=""): """
Signature · 1 line
1.9.1
Armin, assuming there are no concerns raised in review and this is integrated into master, we'd like to get this backported to Rocko as well.
(I believe the patch can be applied as-is.)
Thanks!
--Mark
Quoted 50 lines · On 12/6/17 8:33 PM, [email protected] wrote:
From: Jackie Huang <[email protected]>
Tested with:
1) local.conf:
MACHINE = "qemumips64"MULTILIB_GLOBAL_VARIANTS_append= " libn32" MULTILIBS = "multilib:libn32" DEFAULTTUNE_virtclass-multilib-libn32 ?= "mips64-n32" requireconf/multilib.conf2) run bitbake -e to check the features:
$ bitbake -e libn32-gobject-introspection | grep '^MACHINE_FEATURES'(before the fix)
MACHINE_FEATURES="alsa bluetooth usbgadget screen rtc qemu-usermode" MACHINE_FEATURES_BACKFILL="rtc qemu-usermode" MACHINE_FEATURES_BACKFILL_CONSIDERED=" qemu-usermode"(after the fix)
MACHINE_FEATURES="alsa bluetooth usbgadget screen rtc" MACHINE_FEATURES_BACKFILL="rtc qemu-usermode" MACHINE_FEATURES_BACKFILL_CONSIDERED=" qemu-usermode" MACHINE_FEATURES_ORIGINAL="alsa bluetooth usbgadget screen"3) world build:
$ bitbake worldbuilds without error.
--
The following changes since commit4469acdf1d0338220f3fe2ecb5e079eea6fda375:
lib/oe/utils: removeparam_bool()(2017-12-02 11:25:34 +0000)are available in the git repository at:
git://git.pokylinux.org/poky-contrib.gitjhuang0/d_backfill_multilib_171207_0
http://git.pokylinux.org/cgit.cgi//log/?h=jhuang0/d_backfill_multilib_171207_0Jackie Huang (1):
features_backfill: fix for multilibmeta/classes/multilib.bbclass | 4 ++++ meta/lib/oe/utils.py | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)