Cross compiling libc

What are the best practices to cross build LLVM with libc?

I'm trying to cross build LLVM with libc and compiler-rt (without sanitizers) and there seem to be cross dependencies between the latter projects. For example, compiler-rt/lib/builtins/int_util.c includes stdlib.h.

I'm probably doing it in the wrong sequence, but I'd appreciate if anyone could point me in the right direction.

Thank you,


LLVM libc is not complete enough to be the only libc for an application like LLVM/Clang. But, one should be able to statically link to the items from LLVM libc and get the rest from the system libc. Note that, one will have to use the header files from the system libc and not the ones from LLVM libc as LLVM libc’s header files are not complete (there will potentially be ABI issues but we can restrict to functions which are not ABI critical like string and math functions). Does such a scheme interest you. We have a downstream config where we do this but I never tried it with an external project. If there is a wider interest in such a scheme, we should be able to add/document instructions on how to do it.

Siva Chandra

Hi, Siva.

Sure. Will do so soon and get back to you.