[cfe-users] C/C++ system include dirs when cross-compiling

Patrick Boettcher via cfe-users cfe-users at lists.llvm.org
Mon Apr 4 02:46:25 PDT 2016

On Thu, 31 Mar 2016 13:56:48 -0400
Jeffrey Walton <noloader at gmail.com> wrote:

> >> We were working around the broken C++ header includes by
> >> specifically calling them out with -I. See the comment "Fix C++
> >> header paths for Ubuntu" at
> >> https://github.com/weidai11/cryptopp/blob/master/setenv-embedded.sh#L96.  
> >
> > That's what I did as well to work around.
> >  
> >> ARM's "GCC ARM Embedded Tools" works as expected. Its maintained by
> >> ARM employees. Also see the PPA at
> >> https://launchpad.net/gcc-arm-embedded.  
> >
> > Yeah, but is the problem clang not looking into the right paths or
> > gcc-toolchains having changed their layouts. Comparing older
> > gcc-toolchains I had in my attic it seems that clang is not looking
> > hard enough.  
> It sounds like a Clang bug. If you can reduce it to a minimal test
> case, consider filing a bug report.

After some more investigation I think the non-finding of c++-includes
is related to target-name. From it clang derives the OS and it is
essentially the OS is the tuple which enables the search of the

On my host it is Linux::AddClangCXXStdlibIncludeArgs which is doing the

When cross-compiling I'm with Generic_GCC which doesn't do anything (it
is empty).

I can regenerate a toolchain which will be called -linux, this might
help. Even though it is wrong, I'm on a bare-metal-machine. I just want
the (standard-)includes.


More information about the cfe-users mailing list