Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1 v2] features_backfill: fix for multilib
@ 2018-01-17  5:44 jackie.huang
  2018-01-17  5:44 ` [PATCH 1/1 " jackie.huang
  0 siblings, 1 reply; 2+ messages in thread
From: jackie.huang @ 2018-01-17  5:44 UTC (permalink / raw)
  To: openembedded-core

From: Jackie Huang <jackie.huang@windriver.com>

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(-)

-- 
2.11.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1 v2] features_backfill: fix for multilib
  2018-01-17  5:44 [PATCH 0/1 v2] features_backfill: fix for multilib jackie.huang
@ 2018-01-17  5:44 ` jackie.huang
  0 siblings, 0 replies; 2+ messages in thread
From: jackie.huang @ 2018-01-17  5:44 UTC (permalink / raw)
  To: openembedded-core

From: Jackie Huang <jackie.huang@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@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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-17  5:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-17  5:44 [PATCH 0/1 v2] features_backfill: fix for multilib jackie.huang
2018-01-17  5:44 ` [PATCH 1/1 " jackie.huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox