Skip to contentSkip to conversation

features_backfill: fix for multilib

PATCH New [email protected] 1 participant 2 messages Jan 17, 2018

lore
Share & tools
lore
#0 lore raw

v2 cover features_backfill: fix for multilib

From: Jackie Huang <[email protected]>

v2 comments:
Rebase the patch

--
The following changes since commit d7cf7d6d032158690d6503ddc2c20bc5cd614264:

bitbake: bitbake-user-manual: Removed stray parenthesis (2018-01-16 20:38:58 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib.git jhuang0/d_feature_backfill_180117_0
http://git.pokylinux.org/cgit.cgi//log/?h=jhuang0/d_feature_backfill_180117_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
2.11.0
#1 lore raw

PATCH v2 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
index dc0868be3e..8e2cd57eec 100644
@@ -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
meta/lib/oe/utils.py +7 -2
index 7a79d752b6..b6c10424e7 100644
@@ -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
2.11.0