[llvm-dev] Clang Cross compilation GCC Source Requirement

Peter Smith via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 3 06:48:51 PDT 2018


Hello Mike,

It is likely that you are doing it right, although you might be able
to use the --gcc-toolchain option to point clang at your gcc
toolchain. This should prevent you having to add -I arguments although
my experience has been that you often need --sysroot as well. Without
-gcc-toolchain clang will follow some heuristics to find a
cross-compilation toolchain that may or may not work depending on
where you have gcc installed.

There is some information available on
https://llvm.org/docs/HowToCrossCompileBuiltinsOnArm.html that you
might find helpful.

Hope this is of some use

Peter

On 3 April 2018 at 14:20, Michael Dalpee via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hi,
>
> I am new to CLANG/LLVM and wish to use it to cross compile an application
> for an arm target.   I was able to get this to work for a small test
> application, but only after I pointed clang at the gcc toolchain source I
> was formerly using by providing --sysroot and -I arguments - otherwise, I
> was getting undefined header file errors.
>
> It seems a bit odd that given CLANG is intended to be a gcc replacement, I
> still need to provide a gcc toolchain for it to work.  Am I doing this
> right?
>
> Mike
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


More information about the llvm-dev mailing list