<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>6844</bug_id>
          
          <creation_ts>2014-10-16 06:11:09 +0000</creation_ts>
          <short_desc>[multilib] lib32-core-image-minimal&apos;s WORKDIR is incorrect</short_desc>
          <delta_ts>2014-11-05 02:30:10 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.8</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hongxu Jia">hongxu.jia</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>46349</commentid>
    <comment_count>0</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2014-10-16 06:11:09 +0000</bug_when>
    <thetext>1. env
vim local.conf
...
MACHINE = &quot;qemux86-64&quot;
require conf/multilib.conf
MULTILIBS ?= &quot;multilib:lib32&quot;
DEFAULTTUNE_virtclass-multilib-lib32 ?= &quot;x86&quot;
...

2. build lib32-core-image-minimal and core-image-minimal
$ bitbake lib32-core-image-minimal
$ bitbake core-image-minimal

3. Check both images&apos;s WORKDIR, they are located in the same dir
$ ls tmp/work/qemux86_64-poky-linux/ -al
...
drwxrwxr-x  3 jiahongxu jiahongxu 4096 Oct 13 16:01 core-image-minimal
drwxrwxr-x  3 jiahongxu jiahongxu 4096 Oct 16 11:11 lib32-core-image-minimal
...

4.lib32-core-image-minimal&apos;s WORKDIR is supposed to be in
  tmp/work/qemux86_64-pokymllib32-linux/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46352</commentid>
    <comment_count>1</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2014-10-16 07:39:27 +0000</bug_when>
    <thetext>The reason is variable TARGET_VENDOR was not override for multilib
in that situation.

Is it necessary to do the multilib expansion on TARGET_VENDOR ? (See
the following patch)

It affected many other variables, such as:
&quot;HOST_VENDOR, STAGING_BINDIR_TOOLCHAIN, TARGET_SYS, MULTIMACH_TARGET_SYS,
REAL_MULTIMACH_TARGET_SYS, SSTATE_PKGSPEC&quot;

If we do the modification, there may be potential issues which were
caused by the above variables.

Any suggestions is welcomed.

//Hongxu</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46354</commentid>
    <comment_count>2</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2014-10-16 07:40:00 +0000</bug_when>
    <thetext>While building multilib extended images such as libXX-core-image-minimal,
the WORKDIR has the same dir with the building of core-image-minimal.

$ ls tmp/work/qemux86_64-poky-linux/ -al
...
drwxrwxr-x  3 jiahongxu jiahongxu 4096 Oct 13 16:01 core-image-minimal
drwxrwxr-x  3 jiahongxu jiahongxu 4096 Oct 16 11:11 lib32-core-image-minimal
...

While image class is inherited, it did not assign OVERRIDES with
&apos;virtclass-multilib-libXXX&apos;, so the reason is variable TARGET_VENDOR was
not override for multilib in that situation.

It refers what did for PN and MLPREFIX, and manually do the multilib
override for TARGET_VENDOR in RecipePreFinalise handler.

[YOCTO #6844]

Signed-off-by: Hongxu Jia &lt;hongxu.jia@windriver.com&gt;
---
 meta/classes/multilib.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 6e143dd..2a90d9e 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -21,6 +21,9 @@ python multilib_virtclass_handler () {
     if bb.data.inherits_class(&apos;image&apos;, e.data):
         e.data.setVar(&quot;MLPREFIX&quot;, variant + &quot;-&quot;)
         e.data.setVar(&quot;PN&quot;, variant + &quot;-&quot; + e.data.getVar(&quot;PN&quot;, False))
+        target_vendor = e.data.getVar(&quot;TARGET_VENDOR_&quot; + &quot;virtclass-multilib-&quot; + variant, False)
+        if target_vendor:
+            e.data.setVar(&quot;TARGET_VENDOR&quot;, target_vendor)
         return
 
     if bb.data.inherits_class(&apos;cross-canadian&apos;, e.data):
--</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46755</commentid>
    <comment_count>3</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2014-11-05 02:30:10 +0000</bug_when>
    <thetext>Merged into master:

commit facfeb0b4475a88eed2694ee95d570f66ec6601e
Author: Hongxu Jia &lt;hongxu.jia@windriver.com&gt;
Date:   Thu Oct 16 15:16:25 2014 +0800

    multilib.bbclass: fix incorrect TARGET_VENDOR in multilib image
    
    While building multilib extended images such as libXX-core-image-minimal,
    the WORKDIR has the same dir with the building of core-image-minimal.
    
    $ ls tmp/work/qemux86_64-poky-linux/ -al
    ...
    drwxrwxr-x  3 jiahongxu jiahongxu 4096 Oct 13 16:01 core-image-minimal
    drwxrwxr-x  3 jiahongxu jiahongxu 4096 Oct 16 11:11 lib32-core-image-minimal
    ...
    
    While image class is inherited, it did not assign OVERRIDES with
    &apos;virtclass-multilib-libXXX&apos;, so the reason is variable TARGET_VENDOR was
    not override for multilib in that situation.
    
    It refers what did for PN and MLPREFIX, and manually do the multilib
    override for TARGET_VENDOR in RecipePreFinalise handler.
    
    [YOCTO #6844]
    
    (From OE-Core rev: 7ca012fb3addb11ba3f899efa0619ddd8d3c6946)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>