[llvm] Add a filegroup containing _all_ sources to the libc build rules (PR #169155)

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 23 09:46:06 PST 2025


vonosmas wrote:

> > Could you clarify what/how you're trying to build? E.g. we have an llvm-libc BUILD target (cc_library) here: [`main`/utils/bazel/llvm-project-overlay/libc/BUILD.bazel#L1817-L1831](https://github.com/llvm/llvm-project/blob/main/utils/bazel/llvm-project-overlay/libc/BUILD.bazel#L1817-L1831)
> > that is used in downstream Bazel build of libcxx (it's simply listed as a dependency of proper rules for libcxx).
> 
> I'm trying to assemble a package with Bazel that has all the sources needed to build libc++, not trying to build libc++ itself.
> 
> The goal is to allow Carbon to support building runtimes on-demand in all cases, so we're installing all the source files and building in build steps that we'll run automatically as needed.
> 
> From some discussions with other llvm-libc folks, it seemed like using the sources directly was an intended and supported use case (and that matches having the file groups for the dependencies), so I was sending this PR to somewhat complete the picture. But can also keep this out of tree if needed.
> 
> I don't quite have the last patches for libc++ polished, but happy to point folks to them once they are.

Noted. Do you also assemble a package with the sources needed to build llvm-libc? If yes, do you use smth. like `libc_release_library` with a list of functions that the Carbon needs? I'm asking because we do have some
concerns about the scalability of the current approach in the downstream builds -- where Bazel has to analyze
hundreds / thousands of targets from runtimes-on-demand libc for every single build.

@jtstogel planned to look into this, and explore an idea of adding a separate step of auto-generating BUILD.bazel
file for RoD llvm-libc configuration (which might be expanded to include libc++ as well) with just the sources/headers
we need. I would like us to get a somewhat aligned approach here.

https://github.com/llvm/llvm-project/pull/169155


More information about the llvm-commits mailing list