Bug 7342 - Installing a toolchain to a non-standard directory results in cross gcc with broken include path
Summary: Installing a toolchain to a non-standard directory results in cross gcc with ...
Status: VERIFIED NOTABUG
Alias: None
Product: Installation
Classification: Runtime
Component: Installation (show other bugs)
Version: 1.7.1
Hardware: x86 arm
: Medium+ normal
Target Milestone: 1.8 M4
Assignee: Aníbal Limón
QA Contact: Alexandru Georgescu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-02-20 17:40 UTC by Martin Kaiser
Modified: 2015-03-26 06:33 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Kaiser 2015-02-20 17:40:29 UTC
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 "/opt/poky/1.7.1/sysroots/armv5te-poky-linux-gnueabi/usr/include/c++/4.9.1"
ignoring nonexistent directory "/opt/poky/1.7.1/sysroots/armv5te-poky-linux-gnueabi/usr/include/c++/4.9.1/arm-poky-linux-gnueabi"
ignoring nonexistent directory "/opt/poky/1.7.1/sysroots/armv5te-poky-linux-gnueabi/usr/include/c++/4.9.1/backward"
...

Therefore, I get compile errors on programs that #include <sys/types.h>
Comment 1 Aníbal Limón 2015-02-26 23:35:57 UTC
The problem is about cc1plus that don'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.
Comment 2 Alexandru Georgescu 2015-03-26 06:33:30 UTC
(In reply to comment #1)
> The problem is about cc1plus that don'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.

Verified as per Anibal's comments.