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>
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.
(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.