[libc-dev] Bazel rules for libc and libcxx

Siva Chandra via libc-dev libc-dev at lists.llvm.org
Mon Dec 6 13:32:13 PST 2021


On Mon, Dec 6, 2021 at 1:19 PM Кирилл Забелин via libc-dev <
libc-dev at lists.llvm.org> wrote:

> Hello, everybody
>
> I have some questions regarding Bazel rules for llvm targets.
> In our project we plan to build llvm-project via Bazel. Currently only
> rules for clang, llvm, libunwind, lld and mlir are presented in the llvm
> tree. But we also plan to build libc and libcxx targets via Bazel, the
> rules for these targets aren't in llvm tree yet. As far as I know they
> exist only in internal Google monorepo.
>
> *So, my questions:*
> * Are there any plans to add Bazel rules for libc and libcxx to the llvm
> tree under llvm-projects/utils/bazel/llvm-project-overlay?
>

As pointed out on the github discussion you linked below, we are currently
working on putting them in place.


> * And if they are, then is it an ongoing task or only plans for now? Are
> there any thoughts on when such rules could become available?
>

As +Guillaume Chatelet <gchatelet at google.com> explained on the github
discussion, we are evaluating a few possible directions we can take. We
will share them publicly as soon as we can.


> * Or there aren't such plans? Or they wound't be implemented soon and we
> better start writing these rules by ourselves?
>

I would say, wait for a few weeks and we should be able to provide you with
concrete plans and procedures to start using libc's Bazel rules. You also
see patches for this soon.


> From the short discussion in github here -
> https://github.com/llvm/llvm-project/commit/693a95a69416e23a31e46d3d2c81e854688e606e
> (probably not really suitable place to start such discussion, I should had
> write it here at the beginning) it seems that there are such plans, but it
> isn't clear for me if somebody working on this now.
>
> *@sivachandra <https://github.com/sivachandra>* also pointed out some
> design goal for these rules:
>
>
>>    - We want the individual functions to be mutually exclusive. So, we
>>    ideally want a separate target for every libc function.
>>    - What actually is in a user's libc will be left up to the user. That
>>    is, the users are free to pick-and-choose what they want from LLVM libc and
>>    get the rest from another libc if they so choose to. Hence, we ideally *do
>>    not* want to provide a Bazel target for the final libc. The users
>>    will list the cc_library targets of the individual functions of their
>>    interest as deps to the actual libc target.
>>
>> *Another question: *Would it be the same for libcxx? Or libcxx is
> completely different topic to discuss?
>

Yes, libcxx is a completely different topic and discussions related to it
should be taken up on a libcxx specific forum.


>
> I would really appreciate any help :)
>
> Best regards,
> Kirill Zabelin
>
> * <https://github.com/sivachandra>*
> _______________________________________________
> libc-dev mailing list
> libc-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/libc-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libc-dev/attachments/20211206/c776df20/attachment.html>


More information about the libc-dev mailing list