<?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>7342</bug_id>
          
          <creation_ts>2015-02-20 17:40:29 +0000</creation_ts>
          <short_desc>Installing a toolchain to a non-standard directory results in cross gcc with broken include path</short_desc>
          <delta_ts>2015-03-26 06:33:30 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>Installation</product>
          <component>Installation</component>
          <version>1.7.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.8 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Kaiser">yocto</reporter>
          <assigned_to name="Aníbal Limón">anibal.limon</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>anibal.limon</cc>
    
    <cc>kevin.tian</cc>
    
    <cc>sgw</cc>
          
          <qa_contact name="Alexandru Georgescu">alexandru.c.georgescu</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>48963</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Kaiser">yocto</who>
    <bug_when>2015-02-20 17:40:29 +0000</bug_when>
    <thetext>I built a cross-toolchain for armvte and eventually got a
poky-glibc-x86_64-core-image-minimal-armv5te-toolchain-1.7.1.sh

that I can use for installing the toolchain. The base dir defaults to /opt/poky/1.7.1/

If I choose a different dir (e.g. /usr/local/poky-1.7.1/), the environment setup script adds a sysroot setting. However, the cross gcc has hard-coded default include paths pointing to the (non-existent) dir /opt/poky/1.7.1/...


`$CC -print-prog-name=cc1plus` --sysroot=/usr/local/poky-1.7.1/sysroots/armv5te-poky-linux-gnueabi -v

ignoring nonexistent directory &quot;/opt/poky/1.7.1/sysroots/armv5te-poky-linux-gnueabi/usr/include/c++/4.9.1&quot;
ignoring nonexistent directory &quot;/opt/poky/1.7.1/sysroots/armv5te-poky-linux-gnueabi/usr/include/c++/4.9.1/arm-poky-linux-gnueabi&quot;
ignoring nonexistent directory &quot;/opt/poky/1.7.1/sysroots/armv5te-poky-linux-gnueabi/usr/include/c++/4.9.1/backward&quot;
...

Therefore, I get compile errors on programs that #include &lt;sys/types.h&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49105</commentid>
    <comment_count>1</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2015-02-26 23:35:57 +0000</bug_when>
    <thetext>The problem is about cc1plus that don&apos;t understand --sysroot option, cc1plus use -isysroot example,

`$CC -print-prog-name=cc1plus` -isysroot /usr/local/poky-1.7.1/sysroots/armv5te-poky-linux-gnueabi -v

But if you want to use the preprocessor i suggest you to use the $CPP enviroment variable that is set for sdk envscript.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49778</commentid>
    <comment_count>2</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2015-03-26 06:33:30 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; The problem is about cc1plus that don&apos;t understand --sysroot option, cc1plus
&gt; use -isysroot example,
&gt; 
&gt; `$CC -print-prog-name=cc1plus` -isysroot
&gt; /usr/local/poky-1.7.1/sysroots/armv5te-poky-linux-gnueabi -v
&gt; 
&gt; But if you want to use the preprocessor i suggest you to use the $CPP
&gt; enviroment variable that is set for sdk envscript.

Verified as per Anibal&apos;s comments.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>