<?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>1361</bug_id>
          
          <creation_ts>2011-08-10 22:43:20 +0000</creation_ts>
          <short_desc>empty.c: code model not supported in 32bit mode error with lib32 image build</short_desc>
          <delta_ts>2011-09-02 14:29:52 +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>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</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>1.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jiajun Xu">jiajun.xu</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>dongxiao.xu</cc>
    
    <cc>ke.yu</cc>
    
    <cc>lianhao.lu</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>15388</commentid>
    <comment_count>0</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2011-08-10 22:43:20 +0000</bug_when>
    <thetext>Tree/Branch: poky/master
commit: 786033f53cad2a196ae6f3a05574148578ea3894

With latest master branch, when I build a lib32 core-image-sato with qemux86-64, it fails with error when compile linux-yocto. Error message as below:

######
ERROR: Function &apos;do_compile&apos; failed (see /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/temp/log.do_compile.8803 for further information)
ERROR: Logfile of failure stored in: /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/temp/log.do_compile.8803
Log data follows:
| ERROR: Function &apos;do_compile&apos; failed (see /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/temp/log.do_compile.8803 for further information)
| NOTE: make -j 9 include/linux/version.h CC=i586-pokymllib32-linux-gcc  --sysroot=/home/jxu49/osel/poky/build/tmp/sysroots/qemux86-64 LD=i586-pokymllib32-linux-ld  --sysroot=/home/jxu49/osel/poky/build/tmp/sysroots/qemux86-64
| make -C /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux O=/home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux-qemux86-64-standard-build/. include/linux/version.h
|   CHK     include/linux/version.h
| NOTE: make -j 9 bzImage CC=i586-pokymllib32-linux-gcc  --sysroot=/home/jxu49/osel/poky/build/tmp/sysroots/qemux86-64 LD=i586-pokymllib32-linux-ld  --sysroot=/home/jxu49/osel/poky/build/tmp/sysroots/qemux86-64
| make -C /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux O=/home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux-qemux86-64-standard-build/. bzImage
|   GEN     /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux-qemux86-64-standard-build/Makefile
|   CHK     include/linux/version.h
|   Using /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux as source for kernel
|   CHK     include/generated/utsrelease.h
|   CC      scripts/mod/empty.o
| /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux/scripts/mod/empty.c:1:0: error: code model â~@~Xkernelâ~@~Y not supported in the 32 bit mode
| /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux/scripts/mod/empty.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
| make[4]: *** [scripts/mod/empty.o] Error 1
| make[3]: *** [scripts/mod] Error 2
| make[2]: *** [scripts] Error 2
| make[2]: *** Waiting for unfinished jobs....
|   CC      kernel/bounds.s
| /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux/kernel/bounds.c:1:0: error: code model â~@~Xkernelâ~@~Y not supported in the 32 bit mode
| /home/jxu49/osel/poky/build/tmp/work/qemux86_64-pokymllib32-linux/lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20/linux/kernel/bounds.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
| make[3]: *** [kernel/bounds.s] Error 1
| make[2]: *** [prepare0] Error 2
| make[1]: *** [sub-make] Error 2
| make: *** [all] Error 2
| ERROR: oe_runmake failed
NOTE: package lib32-linux-yocto-2.6.37+git1+84f1a422d7e21fbc23a687035bdf9d42471f19e0_1+be49445d1504c3d4021c01471223208cd3cc9c4f-r20: task do_compile: Failed
ERROR: Task 548 (virtual:multilib:lib32:/home/jxu49/osel/poky/meta/recipes-kernel/linux/linux-yocto_2.6.37.bb, do_compile) failed with exit code &apos;1&apos;
Waiting for 1 active tasks to finish:
0: lib32-gcc-runtime-4.6.1+svnr175454-r4 do_compile (pid 8802)
Waiting for 2 active tasks to finish:
0: lib32-gcc-runtime-4.6.1+svnr175454-r4 do_compile (pid 8802)
1: lib32-eglibc-locale-2.13-r16 do_package_write_rpm (pid 9218)
NOTE: package lib32-eglibc-locale-2.13-r16: task do_package_write_rpm: Started
Waiting for 1 active tasks to finish:
0: lib32-eglibc-locale-2.13-r16 do_package_write_rpm (pid 9218)
NOTE: package lib32-gcc-runtime-4.6.1+svnr175454-r4: task do_compile: Succeeded
NOTE: package lib32-eglibc-locale-2.13-r16: task do_package_write_rpm: Succeeded
ERROR: &apos;virtual:multilib:lib32:/home/jxu49/osel/poky/meta/recipes-kernel/linux/linux-yocto_2.6.37.bb&apos; failed
######</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15402</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-08-11 06:49:45 +0000</bug_when>
    <thetext>There are some parts of the system we shouldn&apos;t extend to different multilibs, the kernel is one of them...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15404</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2011-08-11 09:14:15 +0000</bug_when>
    <thetext>This isn&apos;t a bug in the multilib system.  The linux kernel can only be built with the &quot;largest&quot; endian available to the system.  I.e. on x86_64, it must be built as x86_64.

The remaining bug, if any, is simply a way to prevent certain packages from working in a multilib config.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15405</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-08-11 09:58:56 +0000</bug_when>
    <thetext>Simply raising SkipPackage in appropriate cases is likely the best solution. The kernel is specific enough that I&apos;m happy for it to be coded against testing for inherit kernel or module-base and then picking the &quot;larger&quot; one. We&apos;d probably have to code that 64 bit wins over 32 bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15483</commentid>
    <comment_count>4</comment_count>
    <who name="Ke Yu">ke.yu</who>
    <bug_when>2011-08-16 01:45:39 +0000</bug_when>
    <thetext>I&apos;ve done a POC patch as below. then the bitbake lib32-core-image-sato will fail in parsing as expected, since virtual/lib32-kernel is not available. so i wonder if it is acceptable? If so, how should we test the lib32-core-image-sato?

&quot;
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7dc9cc6..fbd567d 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -9,6 +9,7 @@ INHIBIT_DEFAULT_DEPS = &quot;1&quot;
 KERNEL_IMAGETYPE ?= &quot;zImage&quot;
 INITRAMFS_IMAGE ?= &quot;&quot;
 INITRAMFS_TASK ?= &quot;&quot;
+NO_MULTILIB ?= &quot;1&quot;

 python __anonymous () {
     kerneltype = bb.data.getVar(&apos;KERNEL_IMAGETYPE&apos;, d, 1) or &apos;&apos;
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 6e1669f..34744cd 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -6,6 +6,9 @@ python multilib_virtclass_handler () {
     variant = e.data.getVar(&quot;BBEXTENDVARIANT&quot;, True)
     if cls != &quot;multilib&quot; or not variant:
         return
+
+    if e.data.getVar(&quot;NO_MULTILIB&quot;, True) == &quot;1&quot;:
+        raise bb.parse.SkipPackage(&quot;NO_MULTILIB is set&quot;)

     override = &quot;:virtclass-multilib-&quot; + variant
&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15486</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-08-16 03:26:58 +0000</bug_when>
    <thetext>I&apos;m thinking we need something more along the lines of:

http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/ml4&amp;id=7198e9962235b2d144c63c02823f9b46211c997a

which raises the SkipParse error in the multilib cases and manipulates PROVIDES in the non-multilib case to include the multilib variants.

The patch above is a work in progress though and I was only half way through writing it before travel interrupted the work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15979</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-09-02 14:29:52 +0000</bug_when>
    <thetext>Fixed in master, http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=f9c3639238c2a9f1072e39ba26d0e521c5951b95</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>