<?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>5054</bug_id>
          
          <creation_ts>2013-08-27 16:22:16 +0000</creation_ts>
          <short_desc>syslinux-native depends on i386 libc headers on amd64 (gcc-4.7 works, gcc-4.8 needs gcc-multilib)</short_desc>
          <delta_ts>2015-02-09 23:36: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>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>1.4.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>23 December 2013: Doc flag reset to &quot;Done&quot;</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Olof Johansson">olof.johansson</reporter>
          <assigned_to name="Scott Rifenbark">srifenbark</assigned_to>
          <cc>dvhart</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>msvilans</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>srifenbark</cc>
    
    <cc>tf+bugs.yocto</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35950</commentid>
    <comment_count>0</comment_count>
    <who name="Olof Johansson">olof.johansson</who>
    <bug_when>2013-08-27 16:22:16 +0000</bug_when>
    <thetext>Syslinux is built with -march=i386 (set by the syslinux build system), but without the build host having installed libc6-dev-i386 (debian package containing i386 libc headers) or similar, the build fails, sometimes with strange errors like gcc not recognizing -malign-labels=0 or &quot;CPU you selected does not support x86-64 instruction set&quot;. The root cause being:

gcc  -isystem/mnt/builds/olof/poky/master/build/galileo/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -std=gnu99 -m32
In file included from &lt;command-line&gt;:0:0:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory
 #include &lt;bits/predefs.h&gt;

Syslinux tries to compile a dummy.c to determine if a flag is accepted by gcc or not, and seeing any failure, it assumes it doesn&apos;t (the failures mentioned above is caused by failing tests for -m32 and -malign-labels=0). That&apos;s an oddity of the syslinux buildsystem, but the issue for the oe metadata is the it makes the build host depend on libc headers for i386. Any ideas how this can be solved in an appropriate way?

I&apos;ve been seeing this on Debian Sid (Unstable) with GCC 4.8, but I&apos;m not sure if that&apos;s relevant.

This issue exists on both dylan and master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35957</commentid>
    <comment_count>1</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-08-27 21:26:01 +0000</bug_when>
    <thetext>Does this happen when building syslinux-native for a 32 bit machine using bitbake? Such as qemux86 or genericx86?

$ bitbake syslinux-native

I do not have libc6-dev-i386 on my Ubuntu 12.04 system and can successfully build syslinux-native for genericx86.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35958</commentid>
    <comment_count>2</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-08-27 22:06:03 +0000</bug_when>
    <thetext>I&apos;m not seeing march=i386, malign, not -m32 in the compile log for syslinux-native.

I do see those when building syslinux for qemux86 (-m32 -march=i586, but still no malign - although it is clearly in the various .mk files).... but that is built using the cross compiler, which should not be depending on your host libc. Can you provide details on the build environment and target. Typically the initial output of bitbake provides this in a tabular format. I think I&apos;m missing something about your setup....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35959</commentid>
    <comment_count>3</comment_count>
    <who name="Olof Johansson">olof.johansson</who>
    <bug_when>2013-08-27 23:05:52 +0000</bug_when>
    <thetext>I had this issue for both meta-intel&apos;s nuc as well as qemux86. But nuc is x86_64 so I don&apos;t know... The build machine is x86_64. lp on IRC had the same issue, but not sure what he built for.

This is what the bitbake output looks like now. I was able to reproduce the issue without any layers outside poky (for qemux86).

Build Configuration:
BB_VERSION        = &quot;1.19.1&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;Debian-unstable&quot;
TARGET_SYS        = &quot;x86_64-poky-linux&quot;
MACHINE           = &quot;nuc&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;1.4+snapshot-20130827&quot;
TUNE_FEATURES     = &quot;m64&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-yocto        = &quot;(detachedfromb2ff1ad):325ee9b5fcebe902dfea78750502d8f6667d0a97&quot;
meta-oe           = &quot;master:72e23c12296fbc77193898c38426add58d0c2d71&quot;
meta-intel        
meta-nuc          = &quot;master:164067980e18e8ba60b317677ced2d75c3725dbe&quot;
meta-galileo      = &quot;master:9f2fd127bc9b119391d37e28a6944328e44b872e&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35960</commentid>
    <comment_count>4</comment_count>
    <who name="Olof Johansson">olof.johansson</who>
    <bug_when>2013-08-27 23:08:11 +0000</bug_when>
    <thetext>Note also that the errors show up in do_install, since com32/ isn&apos;t built until then it seems... :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35961</commentid>
    <comment_count>5</comment_count>
    <who name="Olof Johansson">olof.johansson</who>
    <bug_when>2013-08-27 23:13:39 +0000</bug_when>
    <thetext>Uhrm, that should be tf on IRC, not lp. I&apos;ll get some sleep now. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35977</commentid>
    <comment_count>6</comment_count>
    <who name="tf">tf+bugs.yocto</who>
    <bug_when>2013-08-28 08:37:29 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Does this happen when building syslinux-native for a 32 bit machine using
&gt; bitbake? Such as qemux86 or genericx86?
&gt; 
&gt; $ bitbake syslinux-native
&gt; 

Yes, this fails for me for genericx86 with pristine Poky master with host gcc 4.8.1 and libc 2.17. As Olaf mentioned in the absence of the devfiles all the syslinux gcc flag tests fail, so various fallbacks are used, including -malign-lables (in place of -falign-labels) which causes the build failure (the -malign substitution is a syslinux bug, -malign-labels is available on FVR only).

I suspect this is either specifict to the compiler version or the libc version (worked fine until recent system update) and I think is ultimately a host misconfiguration issue rather than a Yocto bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37033</commentid>
    <comment_count>7</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-09-21 00:12:49 +0000</bug_when>
    <thetext>I was able to reproduce at long last on a newly deployed debian sid 64 when building syslinux-native (MACHINE=qemux86). Now I can start looking into it. Thanks for the details on reproduction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37089</commentid>
    <comment_count>8</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-09-23 22:45:45 +0000</bug_when>
    <thetext>This appears to be compiler specific. On my Debian Sid x86_64 VM host if I build with /usr/bin/gcc-&gt;/usr/bin/gcc-4.8, the build fails as described here. If I change the symlink so /usr/bin/gcc-&gt;/usr/bin/gcc-4.7, it builds and installs successfully.

BAD: gcc-4.8 (Debian 4.8.1-10) 4.8.1

GOOD: gcc (Debian 4.7.3-7) 4.7.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37090</commentid>
    <comment_count>9</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-09-23 23:46:24 +0000</bug_when>
    <thetext>Discussed with HPA and he replied in part:

---
This is odd in a number of ways.

dummy.c doesn&apos;t include any headers at all (on purpose) so this is a
header file gcc itself decides it needs.

In other words, it might be that gcc -m32 is broken in your setup unless
at least this header is available.  This is disturbing; this seems to be
a pretty drastic departure in typical gcc behavior.
---

So, we need a toolchain expert in here to start digging into what is different about gcc 4.8 in this regard. I wouldn&apos;t mind seeing a reproduction on something other than Debian Sid as well to make sure it isn&apos;t just gcc4.8 on that installation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37120</commentid>
    <comment_count>10</comment_count>
    <who name="Olof Johansson">olof.johansson</who>
    <bug_when>2013-09-24 14:05:54 +0000</bug_when>
    <thetext>Thanks for looking into this issue! I can reproduce that changing the /usr/bin/gcc symlink to gcc-4.7 makes it build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38667</commentid>
    <comment_count>11</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-11-07 18:48:15 +0000</bug_when>
    <thetext>*** Bug 5440 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38668</commentid>
    <comment_count>12</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-11-07 18:50:04 +0000</bug_when>
    <thetext>Someone else reported this in Bug 5440 and installing gcc-multilib resolved the issue for them. Olof, is this sufficient to address this for you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38692</commentid>
    <comment_count>13</comment_count>
    <who name="Olof Johansson">olof.johansson</who>
    <bug_when>2013-11-08 19:51:22 +0000</bug_when>
    <thetext>Sure. Like I said, installing the libc-i686 package (bringing in gcc-multilib as a dependency) solves the issue indeed. And if the solution is to document this dependency, I don&apos;t have any issues with that. Again, thanks for your work investigating this issue :-).

Did you got any more hints on why this works with gcc-4.7 but not gcc-4.8 though?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38693</commentid>
    <comment_count>14</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-11-08 22:46:58 +0000</bug_when>
    <thetext>Ah right, that is still outstanding, and worth understanding. I&apos;ll leave this open for that reason. I won&apos;t be able to dig into that myself for a while. Since there is a workaround, I&apos;m going to move this to Future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39334</commentid>
    <comment_count>15</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-12-11 10:36:37 +0000</bug_when>
    <thetext>The autobuilders are now falling over with the error, e.g.:

http://autobuilder.yoctoproject.org/main/builders/nightly-x86-64/builds/40/steps/Building%20Images_1/logs/stdio

so at the very least we need to update the documentation to include the requirement on gcc-multilib on things like Ubuntu 13.10 which appears to have the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39575</commentid>
    <comment_count>16</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2013-12-23 20:15:42 +0000</bug_when>
    <thetext>The inclusion of gcc_multilib as an essential package is already documented.  I am resetting the doc flag here to &quot;Done&quot;.  I am not messing with the status of the bug because it is not assigned to me.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39576</commentid>
    <comment_count>17</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-12-23 20:28:51 +0000</bug_when>
    <thetext>Thanks Scott. Yes, we should still try and sort out what changed with the gcc version to require this additional package - but at least for now people shouldn&apos;t trip over it when following the docs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48664</commentid>
    <comment_count>18</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2015-02-09 23:36:41 +0000</bug_when>
    <thetext>Close this since our doc will prevent people on hitting the issue</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>