Skip to contentSkip to conversation

multilib.bbclass: update DEFAULTTUNE for image recipe

PATCH New Robert Yang 1 participant 2 messages Nov 29, 2016

lore
Share & tools
lore
#0 lore raw

cover multilib.bbclass: update DEFAULTTUNE for image recipe

The following changes since commit af280990bff4a484fd8a18e3442b56a0a39b7611:

Revert "classes/populate_sdk_ext: require uninative" (2016-11-28 14:49:37 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/img
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/img

Robert Yang (1):
multilib.bbclass: update DEFAULTTUNE for image recipe

 meta/classes/multilib.bbclass | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
2.9.0
#1 lore raw

PATCH 1/1 multilib.bbclass: update DEFAULTTUNE for image recipe

Fixed:
MACHINE = "qemux86-64"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

$ bitbake -e lib32-core-image-minimal | grep ^TUNE_ARCH=
TUNE_ARCH="x86_64"

This is incorrect, it should be i686 (or other 32 bit tunes), this makes we can't conditionlly install some packages, for example, the recipe-A sets:
COMPATIBLE_HOST = "x86_64.*-linux"

Then it only can be installed when TARGET_ARCH is x86_64:
IMAGE_INSTALL_x86-64 += "package-A"

But it would be error when "bitbake lib32-core-image-minimal":
ERROR: lib32-recipe-A was skipped: incompatible with host i686-pokymllib32-linux (not in COMPATIBLE_HOST)

This is because TARGET_ARCH is not updated to "i686" when multilib, this patch can fix the problem.

---
 meta/classes/multilib.bbclass | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
meta/classes/multilib.bbclass +11 -5
index d5a3128..5d2d048 100644
@@ -23,6 +23,13 @@ python multilib_virtclass_handler () {
     overrides = overrides.replace("pn-${PN}", "pn-${PN}:pn-" + pn)
     e.data.setVar("OVERRIDES", overrides)
 
+    def multilib_set_default_tune():
+        # DEFAULTTUNE can change TARGET_ARCH override so expand this now before update_data
+        newtune = e.data.getVar("DEFAULTTUNE_" + "virtclass-multilib-" + variant, False)
+        if newtune:
+            e.data.setVar("DEFAULTTUNE", newtune)
+            e.data.setVar('DEFAULTTUNE_ML_%s' % variant, newtune)
+
     if bb.data.inherits_class('image', e.data):
         e.data.setVar("MLPREFIX", variant + "-")
         e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
@@ -30,6 +37,9 @@ python multilib_virtclass_handler () {
         target_vendor = e.data.getVar("TARGET_VENDOR_" + "virtclass-multilib-" + variant, False)
         if target_vendor:
             e.data.setVar("TARGET_VENDOR", target_vendor)
+
+        multilib_set_default_tune()
+
         return
 
     if bb.data.inherits_class('cross-canadian', e.data):
@@ -65,11 +75,7 @@ python multilib_virtclass_handler () {
             pkgs += " " + variant + "-" + pkg
         e.data.setVar(whitelist, pkgs)
 
-    # DEFAULTTUNE can change TARGET_ARCH override so expand this now before update_data
-    newtune = e.data.getVar("DEFAULTTUNE_" + "virtclass-multilib-" + variant, False)
-    if newtune:
-        e.data.setVar("DEFAULTTUNE", newtune)
-        e.data.setVar('DEFAULTTUNE_ML_%s' % variant, newtune)
+    multilib_set_default_tune()
 }
 
 addhandler multilib_virtclass_handler
Signature · 1 line
2.9.0