[OE-core] [PATCH 1/1 v2] features_backfill: fix for multilib
jackie.huang at windriver.com
jackie.huang at windriver.com
Wed Jan 17 05:44:18 UTC 2018
From: Jackie Huang <jackie.huang at windriver.com>
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]
Signed-off-by: Jackie Huang <jackie.huang at windriver.com>
---
meta/classes/multilib.bbclass | 4 ++++
meta/lib/oe/utils.py | 9 +++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index dc0868be3e..8e2cd57eec 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -76,6 +76,10 @@ python multilib_virtclass_handler () {
newtune = e.data.getVar("DEFAULTTUNE_" + "virtclass-multilib-" + variant, False)
if newtune:
e.data.setVar("DEFAULTTUNE", 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
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 7a79d752b6..b6c10424e7 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -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=""):
"""
--
2.11.0
More information about the Openembedded-core
mailing list