[libc-dev] Cross compiling libc

Siva Chandra via libc-dev libc-dev at lists.llvm.org
Wed Aug 12 10:35:16 PDT 2020


On Tue, Aug 11, 2020 at 12:51 PM Evandro Menezes via libc-dev <
libc-dev at lists.llvm.org> wrote:

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


Hi,

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.

Thanks,
Siva Chandra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libc-dev/attachments/20200812/fca4b2de/attachment.html>


More information about the libc-dev mailing list