<?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>1525</bug_id>
          
          <creation_ts>2011-09-26 12:50:21 +0000</creation_ts>
          <short_desc>[multilib] Triggering building a 64 bit kernel with a 32 bit userspace</short_desc>
          <delta_ts>2026-06-25 15:24:41 +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>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Matthew McClintock">msm-oss</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>akuster</cc>
    
    <cc>bruce.ashfield</cc>
    
    <cc>dvhart</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>msm-oss</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>shane.wang</cc>
    
    <cc>song.liu</cc>
    
    <cc>srifenbark</cc>
    
    <cc>zhe.he</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>16481</commentid>
    <comment_count>0</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2011-09-26 12:50:21 +0000</bug_when>
    <thetext>For example, if we are building a multilib system that is 32bit and adding certain 64bit packages we most likely want to promote the kernel configuration to a 64bit kernel so it can run all the packages installed on the root file system</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16482</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-09-26 12:54:20 +0000</bug_when>
    <thetext>I&apos;d like to keep this specific to the kernel. Just to clarify what we&apos;re talking about here, the problem is when you build a 32 bit userspace but add 64 bit multilibs. Somehow we need to change the kernel we generate to 64 bit. I&apos;m hoping with linux-yocto, this should be as straight foward as changing the KMACHINE from a 32 bit to a 64 bit one? If so, we just need to figure out how to trigger that change and document how to do it. Any comments Bruce?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16483</commentid>
    <comment_count>2</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2011-09-26 13:00:42 +0000</bug_when>
    <thetext>Hopefully, this is done in such a way it works such that we can promote other recipes to 64bit as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16484</commentid>
    <comment_count>3</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2011-09-26 13:01:56 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Hopefully, this is done in such a way it works such that we can promote other
&gt; recipes to 64bit as well.

Or least other *simple* linux kernel recipes - right now don&apos;t use the linux-yocyo tree just yet and might not ever for certain releases we make.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16485</commentid>
    <comment_count>4</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2011-09-26 13:13:50 +0000</bug_when>
    <thetext>This is trivial for the linux-yocto kernel(s). But you still need to know the
configuration that you&apos;d like to add. i.e. just changing it to CONFIG_64BIT is not
always enough, at times there are other changes that you may or may not need to 
make.

If you want to bump a 32 bit kernel to 64 bit, you can either embed a 64 bit fragment in the meta branch and just add:

  KERNEL_FEATURES_append=&quot; cfg/64bit.scc&quot;

And you&apos;d be done. If you don&apos;t have it in the tree, just add a cfg fragment
onto the SRC_URI that has the same contents as you&apos;d have in the in-tree
variant.

This could be done via python, shell, variable, whatever you want to
trigger the promotion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16486</commentid>
    <comment_count>5</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2011-09-26 13:20:54 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; This is trivial for the linux-yocto kernel(s). But you still need to know the
&gt; configuration that you&apos;d like to add. i.e. just changing it to CONFIG_64BIT is
&gt; not
&gt; always enough, at times there are other changes that you may or may not need to 
&gt; make.
&gt; 
&gt; If you want to bump a 32 bit kernel to 64 bit, you can either embed a 64 bit
&gt; fragment in the meta branch and just add:
&gt; 
&gt;   KERNEL_FEATURES_append=&quot; cfg/64bit.scc&quot;
&gt; 
&gt; And you&apos;d be done. If you don&apos;t have it in the tree, just add a cfg fragment
&gt; onto the SRC_URI that has the same contents as you&apos;d have in the in-tree
&gt; variant.
&gt; 
&gt; This could be done via python, shell, variable, whatever you want to
&gt; trigger the promotion.

And if we just added multilib to overrides we could fixup each recipe based off that value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25074</commentid>
    <comment_count>6</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2012-09-12 01:15:05 +0000</bug_when>
    <thetext>Does just adding CONFIG_64BIT work for other arches? There are no toolchain issues?

-M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25075</commentid>
    <comment_count>7</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-09-12 02:13:01 +0000</bug_when>
    <thetext>I&apos;ve used the CONFIG_64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25076</commentid>
    <comment_count>8</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-09-12 02:14:52 +0000</bug_when>
    <thetext>scratch that last comment, it decided to post itself :)

I&apos;ve used the CONFIG_64BIT &apos;trick&apos; on most arches and boards that support
64 bit kernels, but sometimes have base 32 bit BSPs. Same thing for endian
swaps.

Even if it is more involved than just CONFIG_64BIT, the arch can be picked up in the fragments and secondary options added.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25085</commentid>
    <comment_count>9</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2012-09-12 03:59:43 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; scratch that last comment, it decided to post itself :)
&gt; 
&gt; I&apos;ve used the CONFIG_64BIT &apos;trick&apos; on most arches and boards that support
&gt; 64 bit kernels, but sometimes have base 32 bit BSPs. Same thing for endian
&gt; swaps.
&gt; 
&gt; Even if it is more involved than just CONFIG_64BIT, the arch can be picked
&gt; up in the fragments and secondary options added.

There are actually toolchain issues on powerpc with doing this...

Is see there is a DISTRO_FEATURE = multiarch, and it&apos;s fixing some issues (with some recipe hacks) but now I&apos;m hitting some linker issues... still investigating.

-M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25087</commentid>
    <comment_count>10</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2012-09-12 04:26:30 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; &gt; scratch that last comment, it decided to post itself :)
&gt; &gt; 
&gt; &gt; I&apos;ve used the CONFIG_64BIT &apos;trick&apos; on most arches and boards that support
&gt; &gt; 64 bit kernels, but sometimes have base 32 bit BSPs. Same thing for endian
&gt; &gt; swaps.
&gt; &gt; 
&gt; &gt; Even if it is more involved than just CONFIG_64BIT, the arch can be picked
&gt; &gt; up in the fragments and secondary options added.
&gt; 
&gt; There are actually toolchain issues on powerpc with doing this...
&gt; 
&gt; Is see there is a DISTRO_FEATURE = multiarch, and it&apos;s fixing some issues
&gt; (with some recipe hacks) but now I&apos;m hitting some linker issues... still
&gt; investigating.
&gt; 
&gt; -M

Looks like I just needed this in my kernel recipe:

+KERNEL_CC_append_e6500 = &quot; -m64&quot;
+KERNEL_LD_append_e6500 = &quot; -melf64ppc&quot;

Which is not that surprising considering the default for the 32-bit toolchain is 32 bit stuff... I&apos;m still sort of curious how the CodeSourcery toolchains seem to get away without specifying this...

-M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25088</commentid>
    <comment_count>11</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2012-09-12 04:28:36 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; (In reply to comment #8)
&gt; &gt; &gt; scratch that last comment, it decided to post itself :)
&gt; &gt; &gt; 
&gt; &gt; &gt; I&apos;ve used the CONFIG_64BIT &apos;trick&apos; on most arches and boards that support
&gt; &gt; &gt; 64 bit kernels, but sometimes have base 32 bit BSPs. Same thing for endian
&gt; &gt; &gt; swaps.
&gt; &gt; &gt; 
&gt; &gt; &gt; Even if it is more involved than just CONFIG_64BIT, the arch can be picked
&gt; &gt; &gt; up in the fragments and secondary options added.
&gt; &gt; 
&gt; &gt; There are actually toolchain issues on powerpc with doing this...
&gt; &gt; 
&gt; &gt; Is see there is a DISTRO_FEATURE = multiarch, and it&apos;s fixing some issues
&gt; &gt; (with some recipe hacks) but now I&apos;m hitting some linker issues... still
&gt; &gt; investigating.
&gt; &gt; 
&gt; &gt; -M
&gt; 
&gt; Looks like I just needed this in my kernel recipe:
&gt; 
&gt; +KERNEL_CC_append_e6500 = &quot; -m64&quot;
&gt; +KERNEL_LD_append_e6500 = &quot; -melf64ppc&quot;
&gt; 
&gt; Which is not that surprising considering the default for the 32-bit
&gt; toolchain is 32 bit stuff... I&apos;m still sort of curious how the CodeSourcery
&gt; toolchains seem to get away without specifying this...
&gt; 
&gt; -M

Ooooh spoke too soon, not we have kernel module issues...

ERROR: QA Issue: Architecture did not match (20 to 21) on /work/t4240qds-poky-linux/linux-qoriq-sdk-3.0.34-r6/packages-split/kernel-module-sctp/lib/modules/3.0.34-rt55/kernel/net/sctp/sctp.ko

Should be easy enough to work around.

-M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25089</commentid>
    <comment_count>12</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-09-12 04:33:50 +0000</bug_when>
    <thetext>I&apos;ve seen both of these in the past, but the solution has always
depended on the kernel .. so yes, getting something generic, and 
kernel version independent is the trick.

As for the -m64, I&apos;ve added it to KERNEL_CC or we&apos;ve patched the
kernel Makefiles to be a bit smarter and specify it themselves.
Typically it is only the arch/boot code that gets tied up with this.

The QA warning, I&apos;ve had much more recent experience. Since oe-core
doesn&apos;t expect the 32 -&gt; 64 bit mismatch, you can either mark all the
modules with INSANE_SKIP (which isn&apos;t necessarily trivial) or you can
modify the insane class to have a kernel exception in the checking
(there&apos;s already one for kernel + x32) .. but that exception is a
bit tricky since non kernel-packaged (external) modules will be missed
and from what I&apos;ve been told, the oe-core design really expects a 
separate 64 bit kernel to be built from the 32 bit userspace (I think
I have that right). But one would think that the multilib support could
trigger an exception to this test, I just haven&apos;t found a clean way
to do it yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25091</commentid>
    <comment_count>13</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2012-09-12 04:39:20 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; I&apos;ve seen both of these in the past, but the solution has always
&gt; depended on the kernel .. so yes, getting something generic, and 
&gt; kernel version independent is the trick.
&gt; 
&gt; As for the -m64, I&apos;ve added it to KERNEL_CC or we&apos;ve patched the
&gt; kernel Makefiles to be a bit smarter and specify it themselves.
&gt; Typically it is only the arch/boot code that gets tied up with this.

Hmmmm, OK.
 
&gt; The QA warning, I&apos;ve had much more recent experience. Since oe-core
&gt; doesn&apos;t expect the 32 -&gt; 64 bit mismatch, you can either mark all the
&gt; modules with INSANE_SKIP (which isn&apos;t necessarily trivial) or you can
&gt; modify the insane class to have a kernel exception in the checking
&gt; (there&apos;s already one for kernel + x32) .. but that exception is a
&gt; bit tricky since non kernel-packaged (external) modules will be missed
&gt; and from what I&apos;ve been told, the oe-core design really expects a 
&gt; separate 64 bit kernel to be built from the 32 bit userspace (I think
&gt; I have that right). But one would think that the multilib support could
&gt; trigger an exception to this test, I just haven&apos;t found a clean way
&gt; to do it yet.

This one we can probably work around with the gcc multiarch functions already present, and the qa test and add a proper exception for kernel-modules.

-M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27170</commentid>
    <comment_count>14</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2012-11-02 02:33:39 +0000</bug_when>
    <thetext>We have done some things for this in meta-fsl-ppc and they are probably hacky but seem to work OK. We added a BUILD_64BIT_KERNEL variable to promote the kernel to a 64-bit variant on a 32-bit machine. 

I&apos;m just asking to look at and keep these in mind, I&apos;m planning on joining any discussion that takes place to solve this problem permanently.

-M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27210</commentid>
    <comment_count>15</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-11-02 14:26:43 +0000</bug_when>
    <thetext>I had a look at meta-fsl-ppc and will definitely keep that approach in mind, and it&apos;s similar to 
what I&apos;ve done in the past:

KERNEL_EXTRA_CC_OPTIONS ?= &quot;${@bb.utils.contains(&quot;TRANSLATED_TARGET_ARCH&quot;, &quot;powerpc64&quot;, &quot;-m64&quot;, &quot;&quot;, d)}&quot;
KERNEL_EXTRA_LD_OPTIONS ?= &quot;${@bb.utils.contains(&quot;TRANSLATED_TARGET_ARCH&quot;, &quot;powerpc64&quot;, &quot;-melf64ppc&quot;, &quot;&quot;, d)}&quot;

(assuming that KERNEL_EXTRA_CC_OPTIONS is available).

The inhibiting of the QA check is also interesting. I also do it via variables, but had to do
extra work to pickup modules.

How are you inhibiting module checks ? Is it the all_qa (I&apos;m not completely familiar with it from
memory).

But definitely, good input. We likely want to make the QA checks smarter, with some flags to allow
certain mismatches, but this is a good starting point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27211</commentid>
    <comment_count>16</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-11-02 14:28:55 +0000</bug_when>
    <thetext>Moving this to 1.4. 

I&apos;m also thinking that this may get into some kernel specific areas, do we want someone
from the kernel &quot;team&quot; to be the assignee for this in 1.4 ? Or is this already well underway ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27212</commentid>
    <comment_count>17</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2012-11-02 15:36:28 +0000</bug_when>
    <thetext>(In reply to comment #15)
&gt; I had a look at meta-fsl-ppc and will definitely keep that approach in mind,
&gt; and it&apos;s similar to 
&gt; what I&apos;ve done in the past:
&gt; 
&gt; KERNEL_EXTRA_CC_OPTIONS ?= &quot;${@bb.utils.contains(&quot;TRANSLATED_TARGET_ARCH&quot;,
&gt; &quot;powerpc64&quot;, &quot;-m64&quot;, &quot;&quot;, d)}&quot;
&gt; KERNEL_EXTRA_LD_OPTIONS ?= &quot;${@bb.utils.contains(&quot;TRANSLATED_TARGET_ARCH&quot;,
&gt; &quot;powerpc64&quot;, &quot;-melf64ppc&quot;, &quot;&quot;, d)}&quot;
&gt; 
&gt; (assuming that KERNEL_EXTRA_CC_OPTIONS is available).

Probably is available, I used others probably because I saw that method first

&gt; The inhibiting of the QA check is also interesting. I also do it via
&gt; variables, but had to do
&gt; extra work to pickup modules.
&gt; 
&gt; How are you inhibiting module checks ? Is it the all_qa (I&apos;m not completely
&gt; familiar with it from
&gt; memory).

Presumably by removing one of the two being removed. I stopped doing a lot of investigation after the error went away ;)

&gt; But definitely, good input. We likely want to make the QA checks smarter,
&gt; with some flags to allow
&gt; certain mismatches, but this is a good starting point.

Agreed, x32 has some of the same issues with specific exceptions for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27455</commentid>
    <comment_count>18</comment_count>
    <who name="Radu Moisan">radu.moisan</who>
    <bug_when>2012-11-14 22:40:38 +0000</bug_when>
    <thetext>(In reply to comment #16)
&gt; Moving this to 1.4. 
&gt; 
&gt; I&apos;m also thinking that this may get into some kernel specific areas, do we
&gt; want someone
&gt; from the kernel &quot;team&quot; to be the assignee for this in 1.4 ? Or is this
&gt; already well underway ?

As far as I know there is no work underway for this. Is there anybody from kernel team that can jump in? I&apos;m trying a workload estimation for 1.4 for this task and I don&apos;t have a starting point. It seems to me more like a kernel issue, or am I wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27475</commentid>
    <comment_count>19</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-11-15 16:47:03 +0000</bug_when>
    <thetext>It is more of a kernel issue. I&apos;d estimate that this is  10 perfect days work, due to the
time required to discuss and try the various solutions.

I&apos;m adding Darren as the assignee for now, just so he&apos;s  aware of this as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27476</commentid>
    <comment_count>20</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-11-15 16:47:33 +0000</bug_when>
    <thetext>I meant &quot;Adding Darren to the cc&quot;

Bruce</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27483</commentid>
    <comment_count>21</comment_count>
    <who name="Matthew McClintock">msm-oss</who>
    <bug_when>2012-11-15 16:56:45 +0000</bug_when>
    <thetext>I can try to help with this, either some specific task or just testing this out... let me know.

-M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29256</commentid>
    <comment_count>22</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-01-28 19:08:14 +0000</bug_when>
    <thetext>bumping this out.  will kick up a design thread once some other issues for M4 have been dealt with (like a new kernel version).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30839</commentid>
    <comment_count>23</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-03-19 12:58:02 +0000</bug_when>
    <thetext>We have some ideas for this, but it&apos;s too late for 1.4, the status quo of insane skip will
stay for now. The changes this late in the -dev cycle would carry enough risk to make
bumping this a better idea than pushing it into the release.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36885</commentid>
    <comment_count>24</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-09-18 15:16:59 +0000</bug_when>
    <thetext>moving to 1.6, will do this early in the new development cycle.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51401</commentid>
    <comment_count>25</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-06-01 21:33:10 +0000</bug_when>
    <thetext>Hi, 

This actually looks like something that will need to be documentezasd in the YP user manuals once a solution is figured out.  I am noting that here mostly for myself so I don&apos;t lose sight of it.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106018</commentid>
    <comment_count>26</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-06-25 15:24:41 +0000</bug_when>
    <thetext>This is not a common use-case so the user should take responsibilty for that proper kernel configuration.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>