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

Jeffrey Walton via cfe-users cfe-users at lists.llvm.org
Thu Mar 24 12:29:29 PDT 2016

On Thu, Mar 24, 2016 at 11:48 AM, Arnaud Allard de Grandmaison via
cfe-users <cfe-users at lists.llvm.org> wrote:
> Hi Patrick,
> This is a common case when cross compiling, so clang knows how to use a
> gcc-toolchain installation: you just have to pass it the "--sysroot=..." and
> "--toolchain=..." arguments, and it will get the header files and linker /
> assembler for your target --- assuming your gcc-toolchain has a standard
> layout.

That last caveat is the one that gives me the most trouble on Ubuntu.
They seem to have an odd layout for their ARM-HF toolchain, and using
--sysroot fails to compile/link. Also see "g++-arm-linux-gnueabi
cannot compile a C++ program with --sysroot",


More information about the cfe-users mailing list