<?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>10354</bug_id>
          
          <creation_ts>2016-09-30 17:46:08 +0000</creation_ts>
          <short_desc>gcc-runtime_5.3: misplaced include files</short_desc>
          <delta_ts>2016-10-10 16:24:26 +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>2.1.2</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></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M4</target_milestone>
          <dependson>10380</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michel D&apos;HOOGE">michel.dhooge</reporter>
          <assigned_to name="Juro Bystricky">juro.bystricky</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <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>66772</commentid>
    <comment_count>0</comment_count>
    <who name="Michel D&apos;HOOGE">michel.dhooge</who>
    <bug_when>2016-09-30 17:46:08 +0000</bug_when>
    <thetext>I bitbaked the meta-toolchain with the following local.conf:

MACHINE = &quot;genericx86-64&quot;
DEFAULTTUNE = &quot;x86-64-x32&quot;
baselib = &quot;${@d.getVar(&apos;BASE_LIB_tune-&apos; + (d.getVar(&apos;DEFAULTTUNE&apos;, True) or &apos;INVALID&apos;), True) or &apos;lib&apos;}&quot;
DISTRO = &quot;poky&quot;
PACKAGE_CLASSES = &quot;package_rpm&quot;

The following include files are placed into folder /sysroots/x86_64_x32-poky-linux-gnux32/usr/include/c++/5.3.0/x86_64-poky-linux-gnux32 and they cannot be found by the g++ compiler.

bits:
atomic_word.h   c++config.h  cpu_defines.h   cxxabi_tweaks.h    gthr-default.h  gthr-single.h       os_defines.h  time_members.h
basic_file.h    c++io.h      ctype_base.h    error_constants.h  gthr.h          messages_members.h  stdc++.h
c++allocator.h  c++locale.h  ctype_inline.h  extc++.h           gthr-posix.h    opt_random.h        stdtr1c++.h

ext:
opt_random.h

If I merge the x86_64-poky-linux-gnux32/bits &amp; x86_64-poky-linux-gnux32/ext folders with their matching siblings one level above, everything is fine.

The following simple main.cpp, with a single include and no body, is enough to test:
#include &lt;bits/c++config.h&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66774</commentid>
    <comment_count>1</comment_count>
    <who name="Michel D&apos;HOOGE">michel.dhooge</who>
    <bug_when>2016-09-30 19:50:02 +0000</bug_when>
    <thetext>To be sure, I compared with a plain genericx86-64 meta-toolchain (i.e. without DEFAULTTUNE set to x86-64-x32).

The headers are also in a subfolder (x86_64-poky-linux), but they are correctly found by the g++ compiler.

HTH</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66901</commentid>
    <comment_count>2</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-04 20:45:58 +0000</bug_when>
    <thetext>Yes, CPP is looking for the include files in a folder which does not exist.
This can/should be fixed by a symlink in location:

&lt;sdkinstall&gt;/sysroots/x86_64_x32-poky-linux-gnux32/usr/include/c++/6.2.0

which should contain a symlink named &quot;x86_64-poky-linux&quot; with the target
&quot;x86_64-poky-linux-gnux32&quot; 

Because CPP looks for the include files in:
&lt;sdkinstall&gt;/sysroots/x86_64_x32-poky-linux-gnux32/usr/include/c++/6.2.0/x86_64-poky-linux

however the files are located in the folder 

&lt;sdkinstall&gt;/sysroots/x86_64_x32-poky-linux-gnux32/usr/include/c++/6.2.0/x86_64-poky-linux-gnunx32</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67091</commentid>
    <comment_count>3</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-10 16:24:26 +0000</bug_when>
    <thetext>Patch fixing the problem merged with master:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8209a01242b3ea265c69049879e9ade951bf9602</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>