<?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>1369</bug_id>
          
          <creation_ts>2011-08-15 07:18:54 +0000</creation_ts>
          <short_desc>[Multilib] On-target gcc enhancement</short_desc>
          <delta_ts>2014-06-27 05:25:55 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>Infrastructure</classification>
          <product>Bugzilla</product>
          <component>bugzilla</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>703b70c98a86771a891b46382f3ee20c4ef93f39</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ke Yu">ke.yu</reporter>
          <assigned_to name="Michael Halstead">mhalstead</assigned_to>
          <cc>alexandru.damian</cc>
    
    <cc>atul.singh008</cc>
    
    <cc>bogdan.a.marinescu</cc>
    
    <cc>corneliux.stoicescu</cc>
    
    <cc>infras.bug.watcher</cc>
    
    <cc>Infras.watcher</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mihai.lindner</cc>
    
    <cc>msm-oss</cc>
    
    <cc>nitin.a.kamble</cc>
    
    <cc>radu.moisan</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>Unknown (Hard to categorize)</cf_regression_type>
          <cf_verified>--</cf_verified>
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>15465</commentid>
    <comment_count>0</comment_count>
    <who name="Ke Yu">ke.yu</who>
    <bug_when>2011-08-15 07:18:54 +0000</bug_when>
    <thetext>GCC has internal multilib handling code but it assumes a very specific rigid directory layout. The build system implementation of multilib layout is very generic and allows complete customisation of the library directories. 

64bithack.patch is a partial solution to allow any custom directories to be passed into gcc and handled correctly. It forces gcc to use the base_libdir (which is the current +directory, &quot;.&quot;). We need to do this for each multilib that is configured as we don&apos;t know which compiler options may be being passed into the compiler. Since we have a compiler per mulitlib at this point that isn&apos;t an issue. 

The one problem is the target compiler is only going to work for the default multlilib at this point. Ideally we&apos;d figure out which multilibs were being enabled with which paths and be able to patch these entries with a complete set of correct paths but this we don&apos;t have such code at this point. This is something the target gcc recipe should do and override these platform defaults in its build config.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18056</commentid>
    <comment_count>1</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2012-01-10 08:50:09 +0000</bug_when>
    <thetext>I am looking into this now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18086</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-01-11 15:21:12 +0000</bug_when>
    <thetext>*** Bug 1549 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22125</commentid>
    <comment_count>3</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2012-06-13 14:15:02 +0000</bug_when>
    <thetext>Here are my commits for this feature which I did for 1.2 release. I have ported the commits it to 1.3 in this branch, but they may not be working yet.

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=nitin/gcc-multilib-1.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22128</commentid>
    <comment_count>4</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2012-06-13 14:24:07 +0000</bug_when>
    <thetext>Bogdan, You can also work with Richard for this feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25056</commentid>
    <comment_count>5</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2012-09-11 16:21:56 +0000</bug_when>
    <thetext>Bogdan, Radu,
  So what is the current status of this work now? The last I heard is that Bogdan rebased the previous code to gcc 4.7. but I did not see any code, or update after it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25092</commentid>
    <comment_count>6</comment_count>
    <who name="Radu Moisan">radu.moisan</who>
    <bug_when>2012-09-12 07:44:01 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; Bogdan, Radu,
&gt;   So what is the current status of this work now? The last I heard is that
&gt; Bogdan rebased the previous code to gcc 4.7. but I did not see any code, or
&gt; update after it.

Bogdan switched to some other work, I&apos;ll be taking care of this, but for now I didn&apos;t had time to look over. I&apos;ll post updates soon as I&apos;ll start investigation (I&apos;ll probably need to gather some info anyway to get started with it).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25398</commentid>
    <comment_count>7</comment_count>
    <who name="Radu Moisan">radu.moisan</who>
    <bug_when>2012-09-19 10:40:18 +0000</bug_when>
    <thetext>Agreed with Richard to move this to 1.4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27456</commentid>
    <comment_count>8</comment_count>
    <who name="Radu Moisan">radu.moisan</who>
    <bug_when>2012-11-14 22:57:30 +0000</bug_when>
    <thetext>I will be takink care of this as soon as I finish with with systemd. My initial estimation is 10 days but this will probably change once I get into it and clean up my view over this feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29498</commentid>
    <comment_count>9</comment_count>
    <who name="Constantin Musca">constantinx.musca</who>
    <bug_when>2013-02-04 15:19:08 +0000</bug_when>
    <thetext>Patch merged. (commit 703b70c98a86771a891b46382f3ee20c4ef93f39)

Cheers,
Constantin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31239</commentid>
    <comment_count>10</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2013-03-27 14:11:22 +0000</bug_when>
    <thetext>Hello,

What should I add in local.conf in order to get a core-image-sato-sdk to test this?

I added the following but got a &quot;-sh: gcc: command not found&quot; message:

MACHINE = &quot;qemux86-64&quot;
require conf/multilib.conf
MULTILIBS = &quot;multilib:lib32&quot;
DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;
IMAGE_INSTALL_append = &quot; lib32-gcc&quot;

NOTE: By adding the above lines in local.conf without the last one, I could not create 32 bit binaries on the x86-64 machine.

Awaiting for input from Radu or Nitin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31240</commentid>
    <comment_count>11</comment_count>
    <who name="Radu Moisan">radu.moisan</who>
    <bug_when>2013-03-27 14:27:24 +0000</bug_when>
    <thetext>Constantin is the right person to ask.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31765</commentid>
    <comment_count>12</comment_count>
    <who name="Mihai Lindner">mihai.lindner</who>
    <bug_when>2013-04-09 13:51:17 +0000</bug_when>
    <thetext>
Build Configuration:
BB_VERSION        = &quot;1.17.1&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;Unknown&quot;
TARGET_SYS        = &quot;x86_64-poky-linux&quot;
MACHINE           = &quot;qemux86-64&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;1.3+snapshot-20130409&quot;
TUNE_FEATURES     = &quot;m64&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-yocto        
meta-yocto-bsp    = &quot;master:02ae9b357676c904721d92a9c6f74ecc6b7a4476&quot;


Shell commands:
root@qemux86-64:~# cat test.c 
#include &lt;stdio.h&gt;

int main () {
        printf (&quot;Hello World!\n&quot;);
}
root@qemux86-64:~# gcc test.c -o test
root@qemux86-64:~# file test
test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=af4a65fde9035710493b8dad3212f4095e660b9a, not stripped
root@qemux86-64:~# gcc -m64 test.c -o test
root@qemux86-64:~# file test
test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=af4a65fde9035710493b8dad3212f4095e660b9a, not stripped
root@qemux86-64:~# gcc -m32 test.c -o test      
root@qemux86-64:~# file test
test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=60066bf9f2ff17efcb7cb324df4c601bea0a57d1, not stripped</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44219</commentid>
    <comment_count>13</comment_count>
    <who name="ATUL">atul.singh008</who>
    <bug_when>2014-06-27 05:25:55 +0000</bug_when>
    <thetext>Hi,

I tried the above suggestion for multilib support on current head release of yocto for machine x86-64.
But it only create lib64 folder.
Also while compiling for m32 i am getting mention below:

sysroots/i686-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64                                                -poky-linux/gcc/x86_64-poky-linux/4.9.0/ld: skipping incompatible /home/atulk/X86_multilib/sysroots                                                /core2-64-poky-linux/usr/lib64/x86_64-poky-linux/4.9.0//libgcc.a when searching for -lgcc
/home/atulk/X86_multilib/sysroots/i686-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64                                                -poky-linux/gcc/x86_64-poky-linux/4.9.0/ld: skipping incompatible /home/atulk/X86_multilib/sysroots                                                /core2-64-poky-linux/usr/lib64/x86_64-poky-linux/4.9.0/libgcc.a when searching for -lgcc
/home/atulk/X86_multilib/sysroots/i686-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64                                                -poky-linux/gcc/x86_64-poky-linux/4.9.0/ld: cannot find -lgcc

Please help me with your valuable suggestion on the same.

Thanks and regards,
Atul</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>